diff --git a/.classpath b/.classpath index 9e4aea59b..139752929 100644 --- a/.classpath +++ b/.classpath @@ -68,7 +68,7 @@ - + diff --git a/source/net/yacy/cora/document/id/MultiProtocolURL.java b/source/net/yacy/cora/document/id/MultiProtocolURL.java index 18758b72e..c8af66661 100644 --- a/source/net/yacy/cora/document/id/MultiProtocolURL.java +++ b/source/net/yacy/cora/document/id/MultiProtocolURL.java @@ -271,14 +271,18 @@ public class MultiProtocolURL implements Serializable, Comparable 4 && h.charAt(3) == ':' && h.charAt(4) != '/' && h.charAt(4) != '\\') { + // wrong windows path, after the doublepoint there should be a backslash + h = h.substring(0, 4) + '\\' + h.substring(4); + } int q = h.indexOf('/', 2); - if (q < 0) { + if (q < 0 || h.length() > 3 && h.charAt(3) == ':') { this.path = h.substring(2); // "path" or "c:/path" } else { this.host = h.substring(2, q ); // TODO: handle "c:" ? @@ -2310,14 +2314,15 @@ public class MultiProtocolURL implements Serializable, Comparable 0) normalizedURL = normalizedURL.substring(p + 2); return splitpattern.split(normalizedURL.toLowerCase()); // word components of the url } -/* - public static void main(final String[] args) { - for (final String s: args) System.out.println(toTokens(s)); - } -*/ + public static void main(final String[] args) { final String[][] test = new String[][]{ - new String[]{null, "file://Z:\\"}, + new String[]{null, "file://y:/"}, + new String[]{null, "file://y:/yacy"}, + new String[]{null, "file://y:/yacy/"}, + new String[]{null, "file://y:"}, + new String[]{null, "file://Z:admin\\home"}, // thats wrong but may appear + new String[]{null, "file://Z:\\admin\\home"}, new String[]{null, "https://www.example.com/shoe/?p=2&ps=75#t={%22san_NaviPaging%22:2}"}, // ugly strange pagination link new String[]{null, "C:WINDOWS\\CMD0.EXE"}, new String[]{null, "file://C:WINDOWS\\CMD0.EXE"}, @@ -2388,7 +2393,11 @@ public class MultiProtocolURL implements Serializable, Comparable