Exemple #1
0
 private ZipEntry entry(TPath path) {
   String pathString = path.toPathString();
   if (pathString.startsWith("/")) {
     pathString = pathString.substring(1);
   }
   return file.getEntry(pathString);
 }
Exemple #2
0
 public void close() throws TIoException {
   try {
     file.close();
   } catch (IOException e) {
     throw new TIoException(TPath.parse("/"), "Cannot close jar file", e);
   }
 }
Exemple #3
0
 public URI toUri(TPath path) {
   try {
     return new URI("jar:" + jarFile.toURI().toString() + "!" + path.toPathString());
   } catch (URISyntaxException e) {
     throw new Error(e.getMessage(), e);
   }
 }
Exemple #4
0
 public static FileSystem readOnlyZipFileSystem(File jarFile) throws TIoException {
   ZipFileSystem zipFileSystem;
   try {
     zipFileSystem = new ZipFileSystem(jarFile);
   } catch (IOException e) {
     throw new TIoException(
         TPath.parse("/"), "Error opening zip file <" + jarFile.getAbsolutePath() + ">", e);
   }
   return ControlledFileSystem.readOnlyFileSystem(zipFileSystem);
 }
Exemple #5
0
 public int hashCode(TPath path) {
   return path.hashCode();
 }
Exemple #6
0
 public boolean equals(TPath path1, TPath path2) {
   return path1.equals(path2);
 }
Exemple #7
0
 public int compare(TPath path1, TPath path2) {
   return path1.compareTo(path2);
 }
Exemple #8
0
 public String pathString(TPath path) {
   StringBuffer buffer = new StringBuffer(file.getName());
   buffer.append("[").append(path.toPathString()).append("]");
   return buffer.toString();
 }