public DirectoryClassLoader(File dir, @Nullable String extraClassPath, ClassLoader parent, Iterable<String> libDirs) { super(getClassPathURLs(dir, extraClassPath, ImmutableSet.copyOf(libDirs)), parent); // Try to load the Manifest from the unpacked directory Manifest manifest = null; try { try ( InputStream input = new FileInputStream(new File(dir, JarFile.MANIFEST_NAME.replace('/', File.separatorChar))) ) { manifest = new Manifest(input); } } catch (IOException e) { // Ignore, since it's possible that there is no MANIFEST LOG.trace("No Manifest file under {}", dir, e); } this.manifest = manifest; }
public DirectoryClassLoader(File dir, @Nullable String extraClassPath, ClassLoader parent, Iterable<String> libDirs) { super(getClassPathURLs(dir, extraClassPath, ImmutableSet.copyOf(libDirs)), parent); // Try to load the Manifest from the unpacked directory Manifest manifest = null; try { try ( InputStream input = new FileInputStream(new File(dir, JarFile.MANIFEST_NAME.replace('/', File.separatorChar))) ) { manifest = new Manifest(input); } } catch (IOException e) { // Ignore, since it's possible that there is no MANIFEST LOG.trace("No Manifest file under {}", dir, e); } this.manifest = manifest; }