private synchronized File unpackFromFileURL(URL url, String fileName, ClassLoader cl) {
File resource;
try {
resource = new File(URLDecoder.decode(url.getPath(), "UTF-8"));
} catch (UnsupportedEncodingException e) {
throw new VertxException(e);
}
boolean isDirectory = resource.isDirectory();
File cacheFile = new File(cacheDir, fileName);
if (!isDirectory) {
cacheFile.getParentFile().mkdirs();
try {
Files.copy(resource.toPath(), cacheFile.toPath());
} catch (FileAlreadyExistsException ignore) {
// OK - this can happen if this is called multiple times on different threads
} catch (IOException e) {
throw new VertxException(e);
}
} else {
cacheFile.mkdirs();
String[] listing = resource.list();
for (String file: listing) {
String subResource = fileName + "/" + file;
URL url2 = cl.getResource(subResource);
unpackFromFileURL(url2, subResource, cl);
}
}
return cacheFile;
Files.copy(resource.toPath(), cacheFile.toPath());
private static final boolean ENABLE_CACHING = !Boolean.getBoolean(DISABLE_FILE_CACHING_PROP_NAME);
This will however not read the system property, but parse "vertx.disableFileCaching" to false..
Also I saw that the setting of the enableChaching Flag was changed to:private static final boolean ENABLE_CACHING = !Boolean.getBoolean(DISABLE_FILE_CACHING_PROP_NAME);
This will however not read the system property, but parse "vertx.disableFileCaching" to false..
Returnstrue
if and only if the system property named by the argument exists and is equal to the string"true"
. (Beginning with version 1.0.2 of the JavaTM platform, the test of this string is case insensitive.) A system property is accessible throughgetProperty
, a method defined by theSystem
class.