From cd1107d85e392c3bd555ee86cc24acf976f92971 Mon Sep 17 00:00:00 2001 From: borg-0300 Date: Fri, 4 Nov 2005 17:25:15 +0000 Subject: [PATCH] added support for URLs with '?&' git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1030 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/plasma/plasmaHTCache.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/de/anomic/plasma/plasmaHTCache.java b/source/de/anomic/plasma/plasmaHTCache.java index f8bcc4f08..cdf57d053 100644 --- a/source/de/anomic/plasma/plasmaHTCache.java +++ b/source/de/anomic/plasma/plasmaHTCache.java @@ -428,10 +428,10 @@ public final class plasmaHTCache { */ public File getCachePath(URL url) { // this.log.logFinest("plasmaHTCache: getCachePath: IN=" + url.toString()); - String remotePath = url.getPath(); - if (remotePath.endsWith("/")) { remotePath = remotePath + "ndx"; } + String remotePath = url.getFile(); + if (remotePath.endsWith("/")) { remotePath = remotePath + "index.html"; } if (!remotePath.startsWith("/")) { remotePath = "/" + remotePath; } -// remotePath = remotePath.replaceAll("[?&:]", "_"); // yes this is not reversible, but that is not needed + remotePath = remotePath.replaceAll("[?&:]", "_"); // yes this is not reversible, but that is not needed int port = url.getPort(); if (port < 0) { if (url.getProtocol().equalsIgnoreCase("http")) port = 80; @@ -478,7 +478,7 @@ public final class plasmaHTCache { s = s.substring(0, pos) + ":" + s.substring(pos + 1); } - if (s.endsWith("ndx")) { s = s.substring(0, s.length() - 3); } + if (s.endsWith("index.html")) { s = s.substring(0, s.length() - 10); } // this.log.logFinest("plasmaHTCache: getURL: OUT=" + s); try { return new URL(protocol + "://" + s);