[java] diagnostics for missing JRT FS provider (EA-84606)

This commit is contained in:
Roman Shevchenko
2016-07-01 19:37:06 +03:00
parent 79b057e5c8
commit a227adbc69
@@ -60,7 +60,9 @@ class JrtHandler extends ArchiveHandler {
fs = FileSystems.newFileSystem(ROOT_URI, Collections.singletonMap("java.home", getFile().getPath()));
}
else {
URL url = new File(getFile(), "jrt-fs.jar").toURI().toURL();
File file = new File(getFile(), "jrt-fs.jar");
if (!file.exists()) throw new IOException("Missing provider: " + file);
URL url = file.toURI().toURL();
ClassLoader loader = new URLClassLoader(new URL[]{url}, null);
fs = FileSystems.newFileSystem(ROOT_URI, Collections.emptyMap(), loader);
}