Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

*) Java 1.5 compatibility (see http://forum.yacy-websuche.de/viewtopic.php?f=8&t=2764)

low012dc93cec3a8c1
diff --git a/source/net/yacy/kelondro/data/meta/DigestURI.java b/source/net/yacy/kelondro/data/meta/DigestURI.java
index 3cf3f9ce7..232b0c9a5 100644
--- a/source/net/yacy/kelondro/data/meta/DigestURI.java
+++ b/source/net/yacy/kelondro/data/meta/DigestURI.java
@@ -729,17 +729,17 @@ public class DigestURI implements Serializable {
} else if (isFile()) {
defaultPort = true;
}
- final String path = this.getFile(excludeReference, removeSessionID);
+ final String urlPath = this.getFile(excludeReference, removeSessionID);
if (defaultPort) {
return
this.protocol + "://" +
((this.getHost() == null) ? "" : ((this.userInfo != null) ? (this.userInfo + "@") : ("")) + this.getHost().toLowerCase()) +
- path;
+ urlPath;
}
return this.protocol + "://" +
((this.userInfo != null) ? (this.userInfo + "@") : ("")) +
- this.getHost().toLowerCase() + ((defaultPort) ? ("") : (":" + this.port)) + path;
+ this.getHost().toLowerCase() + ((defaultPort) ? ("") : (":" + this.port)) + urlPath;
}
/* (non-Javadoc)
@@ -1111,12 +1111,13 @@ public class DigestURI implements Serializable {
}
return false;
}
-
- public boolean canExecute() {
- if (isFile()) return getFSFile().canExecute();
- if (isSMB()) return false; // no execute over smb
- return false;
- }
+
+ // commented out since the canExecute() method is not part of java 1.5
+// public boolean canExecute() {
+// if (isFile()) return getFSFile().canExecute();
+// if (isSMB()) return false; // no execute over smb
+// return false;
+// }
public boolean isHidden() {
if (isFile()) return getFSFile().isHidden();
@@ -1213,14 +1214,16 @@ public class DigestURI implements Serializable {
}
public MultiProtocolInputStream(SmbFile sf) throws IOException {
+ /* TODO: Forward Exception instead of String containing message once
+ * YaCy is ported to Java 1.6 some day. */
try {
this.is = new SmbFileInputStream(sf);
} catch (SmbException e) {
- throw new IOException(e);
+ throw new IOException(e.getMessage());
} catch (MalformedURLException e) {
- throw new IOException(e);
+ throw new IOException(e.getMessage());
} catch (UnknownHostException e) {
- throw new IOException(e);
+ throw new IOException(e.getMessage());
}
}