Beispiel #1
0
 public ZipFileSystem(File jarFile) throws IOException {
   entrySystem = new InMemoryFileSystem();
   entrySystem.setFileInitialCapacity(0);
   entrySystem.setFileSizeIncrement(0);
   factory = new TFileFactory(entrySystem);
   load(jarFile);
   this.jarFile = jarFile;
 }
Beispiel #2
0
 public InputStream createInputStream(TPath path) throws TIoException {
   if (!entrySystem.fileExists(path)) {
     throw new TFileNotFoundException(path);
   }
   ZipEntry entry = entry(path);
   try {
     return file.getInputStream(entry);
   } catch (IOException e) {
     throw new TIoException(path, "Error opening entry", e);
   }
 }
Beispiel #3
0
 public PathContent list(TPath path) {
   return entrySystem.list(path);
 }
Beispiel #4
0
 public boolean dirExists(TPath path) {
   return entrySystem.dirExists(path);
 }
Beispiel #5
0
 public boolean fileExists(TPath path) {
   return entrySystem.fileExists(path);
 }