Bugfix
This commit is contained in:
parent
793b14fe81
commit
3cedc18232
1 changed files with 7 additions and 5 deletions
|
|
@ -220,23 +220,25 @@ public class FileSearch implements Iterable<FileSearch.FileSearchItem>{
|
||||||
}
|
}
|
||||||
|
|
||||||
public class FileSearchZipItem implements FileSearchItem{
|
public class FileSearchZipItem implements FileSearchItem{
|
||||||
private String file;
|
private String zipFile;
|
||||||
private ZipEntry entry;
|
private ZipEntry entry;
|
||||||
|
private String fileName;
|
||||||
|
|
||||||
protected FileSearchZipItem(String file, ZipEntry entry){
|
protected FileSearchZipItem(String file, ZipEntry entry){
|
||||||
this.file = file;
|
this.zipFile = file;
|
||||||
this.entry = entry;
|
this.entry = entry;
|
||||||
|
this.fileName = new File(entry.getName()).getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() { return entry.getName(); }
|
public String getName() { return fileName; }
|
||||||
public String getPath() { return file; }
|
public String getPath() { return "zip://"+zipFile+":"+entry.getName(); }
|
||||||
|
|
||||||
public boolean isCompressed() { return true; }
|
public boolean isCompressed() { return true; }
|
||||||
public boolean isFile() { return !entry.isDirectory(); }
|
public boolean isFile() { return !entry.isDirectory(); }
|
||||||
public boolean isDirectory() { return entry.isDirectory(); }
|
public boolean isDirectory() { return entry.isDirectory(); }
|
||||||
|
|
||||||
public InputStream getInputStream() throws IOException {
|
public InputStream getInputStream() throws IOException {
|
||||||
ZipFile zip = new ZipFile(file);
|
ZipFile zip = new ZipFile(zipFile);
|
||||||
return new InputStreamCloser(zip.getInputStream(entry), zip);
|
return new InputStreamCloser(zip.getInputStream(entry), zip);
|
||||||
}
|
}
|
||||||
public String[] listFiles() { return null; }
|
public String[] listFiles() { return null; }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue