src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/FileSupport.java
Index Unified diffs Context diffs Sdiffs Frames Patch New Old Previous File Next File hotspot Cdiff src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/FileSupport.java

src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/FileSupport.java

Print this page

        

*** 18,27 **** --- 18,28 ---- * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ + package jdk.tools.jaotc.collect; import java.io.IOException; import java.net.*; import java.nio.file.*;
*** 34,55 **** public boolean isDirectory(Path path) { return Files.isDirectory(path); } ! private FileSystem makeJarFileSystem(Path path) { try { return FileSystems.newFileSystem(makeJarFileURI(path), new HashMap<>()); } catch (IOException e) { throw new InternalError(e); } } ! private URI makeJarFileURI(Path path) { try { String name = path.toAbsolutePath().toString(); ! name = name.replace('\\','/'); return new URI("jar:file:///" + name + "!/"); } catch (URISyntaxException e) { throw new InternalError(e); } } --- 35,56 ---- public boolean isDirectory(Path path) { return Files.isDirectory(path); } ! private static FileSystem makeJarFileSystem(Path path) { try { return FileSystems.newFileSystem(makeJarFileURI(path), new HashMap<>()); } catch (IOException e) { throw new InternalError(e); } } ! private static URI makeJarFileURI(Path path) { try { String name = path.toAbsolutePath().toString(); ! name = name.replace('\\', '/'); return new URI("jar:file:///" + name + "!/"); } catch (URISyntaxException e) { throw new InternalError(e); } }
*** 64,75 **** public ClassLoader createClassLoader(Path path) throws MalformedURLException { return URLClassLoader.newInstance(buildUrls(path)); } ! private URL[] buildUrls(Path path) throws MalformedURLException { ! return new URL[] { path.toUri().toURL() }; } public Path getJarFileSystemRoot(Path jarFile) { FileSystem fileSystem = makeJarFileSystem(jarFile); return fileSystem.getPath("/"); --- 65,76 ---- public ClassLoader createClassLoader(Path path) throws MalformedURLException { return URLClassLoader.newInstance(buildUrls(path)); } ! private static URL[] buildUrls(Path path) throws MalformedURLException { ! return new URL[]{path.toUri().toURL()}; } public Path getJarFileSystemRoot(Path jarFile) { FileSystem fileSystem = makeJarFileSystem(jarFile); return fileSystem.getPath("/");
*** 78,88 **** public boolean isAbsolute(Path entry) { return entry.isAbsolute(); } public Path getSubDirectory(FileSystem fileSystem, Path root, Path path) throws IOException { ! DirectoryStream<Path> paths = fileSystem.provider().newDirectoryStream(root,null); for (Path entry : paths) { Path relative = root.relativize(entry); if (relative.equals(path)) { return entry; } --- 79,89 ---- public boolean isAbsolute(Path entry) { return entry.isAbsolute(); } public Path getSubDirectory(FileSystem fileSystem, Path root, Path path) throws IOException { ! DirectoryStream<Path> paths = fileSystem.provider().newDirectoryStream(root, null); for (Path entry : paths) { Path relative = root.relativize(entry); if (relative.equals(path)) { return entry; }
src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/FileSupport.java
Index Unified diffs Context diffs Sdiffs Frames Patch New Old Previous File Next File