return null;
}
+ @Override
public String toString() {
StringBuffer buf = new StringBuffer();
boolean start = true;
this.file = file;
}
+ @Override
public InputStream getInputStream() throws IOException {
fis = new FileInputStream(file);
return fis;
}
+ @Override
public void close() {
try {
if (fis != null)
}
}
+ @Override
public String getPath() {
return file.getPath();
}
this.dirPath = dirPath;
}
+ @Override
public ClassFile find(String name) {
File f = new File(dirPath + File.separator + name.replace('.', File.separatorChar) + ".class");
if (f.isFile())
return null;
}
+ @Override
public String toString() {
return dirPath;
}
this.entry = entry;
}
+ @Override
public InputStream getInputStream() throws IOException {
is = zipFile.getZipFile().getInputStream(entry);
return is;
}
+ @Override
public void close() {
try {
if (is != null)
}
}
+ @Override
public String getPath() {
return entry.getName();
}
*/
static class JImageEntry extends Entry {
- private final static FileSystem fs = FileSystems.getFileSystem(JRT_URI);
+ private static FileSystem fs = null;
private final static Map<String, Path> fileCache = new SoftHashMap<String, Path>();
private static boolean packageCacheInitialized = false;
public JImageEntry() {
+ if (fs == null) {
+ try {
+ fs = FileSystems.getFileSystem(JRT_URI);
+ } catch (Throwable t) {
+ throw new IllegalStateException("Unexpectedly unable to initialize a JRT filesystem", t);
+ }
+ }
buildPackageMap();
}
return locator.found;
}
+ @Override
public ClassFile find(String name) throws IOException {
String fileName = name.replace('.', '/') + ".class";
Path file = fileCache.get(fileName);
return zipFile;
}
+ @Override
public ClassFile find(String name) throws IOException {
ensureOpen();
String key = name.replace('.', '/') + ".class";
public void closeSomeArchives(int n) {
for (int i = n - 1; i >= 0; i--) {
- ZipFile zf = (ZipFile) openArchives.get(i);
+ ZipFile zf = openArchives.get(i);
try {
zf.close();
} catch (IOException e) {
}
}
+ @Override
public String toString() {
return file.getName();
}