static IScannableCodeBase createFilesystemCodeBase(FilesystemCodeBaseLocator codeBaseLocator) throws IOException { String fileName = codeBaseLocator.getPathName(); File file = new File(fileName); if (!file.exists() || !file.canRead()) { return createEmptyCodeBase(codeBaseLocator, file); } else if (file.isDirectory()) { return new DirectoryCodeBase(codeBaseLocator, file); } else if (!file.isFile()) { return createEmptyCodeBase(codeBaseLocator, file); } else if (fileName.endsWith(".class")) { return new SingleFileCodeBase(codeBaseLocator, fileName); } else if (fileName.endsWith(File.separator + "jrt-fs.jar")) { return new JrtfsCodeBase(codeBaseLocator, fileName); } else { try { return ZipCodeBaseFactory.makeZipCodeBase(codeBaseLocator, file); } catch (IOException e) { return createEmptyCodeBase(codeBaseLocator, file); } } }
delegateCodeBase = ZipCodeBaseFactory.makeZipCodeBase(codeBaseLocator, tempFile); } finally { if (inputStream != null) {
static IScannableCodeBase createFilesystemCodeBase(FilesystemCodeBaseLocator codeBaseLocator) throws IOException { String fileName = codeBaseLocator.getPathName(); File file = new File(fileName); if (!file.exists()) { throw new FileNotFoundException("File " + file.getAbsolutePath() + " doesn't exist"); } else if (!file.canRead()) { throw new IOException("File " + file.getAbsolutePath() + " not readable"); } else if (file.isDirectory()) { return new DirectoryCodeBase(codeBaseLocator, file); } else if (!file.isFile()) { throw new IOException("File " + file.getAbsolutePath() + " is not a normal file"); } else if (fileName.endsWith(".class")) { return new SingleFileCodeBase(codeBaseLocator, fileName); } else { return ZipCodeBaseFactory.makeZipCodeBase(codeBaseLocator, file); } }
delegateCodeBase = ZipCodeBaseFactory.makeZipCodeBase(codeBaseLocator, tempFile); } finally { if (inputStream != null) {