diff --git a/netx/net/sourceforge/jnlp/cache/CacheUtil.java b/netx/net/sourceforge/jnlp/cache/CacheUtil.java index d298d203b..39b316e3b 100644 --- a/netx/net/sourceforge/jnlp/cache/CacheUtil.java +++ b/netx/net/sourceforge/jnlp/cache/CacheUtil.java @@ -680,9 +680,6 @@ public static File urlToPath(URL location, String subdir) { StringBuilder path = new StringBuilder(); - path.append(subdir); - path.append(File.separatorChar); - path.append(location.getProtocol()); path.append(File.separatorChar); path.append(location.getHost()); @@ -707,7 +704,7 @@ public static File urlToPath(URL location, String subdir) { * So without mercy, hash it */ String hexed = hex(new File(locationPath).getName(), locationPath); - return new File(path.toString(), hexed.toString()); + return new File(subdir, path.append(File.separatorChar).append(hexed).toString()); } catch (NoSuchAlgorithmException ex) { // should not occur, cite from javadoc: // every java implementation should support @@ -720,7 +717,7 @@ public static File urlToPath(URL location, String subdir) { path.append(".").append(location.getQuery()); } - File candidate = new File(FileUtils.sanitizePath(path.toString())); + File candidate = new File(subdir, FileUtils.sanitizePath(path.toString())); try { if (candidate.getName().length() > 255) { /**