Author: aum
Date: 2006-05-27 22:05:06 +0000 (Sat, 27 May 2006)
New Revision: 8887
Modified:
trunk/freenet/src/freenet/keys/FreenetURI.java
Log:
Modified the FreenetURI(String URI) constructor, to
remove any '.ext' tails from CHK at yadayada.ext URIs.
This permits URIs like 'CHK at blahblahblahblah,blahblahblah.html'.
Modified: trunk/freenet/src/freenet/keys/FreenetURI.java
===================================================================
--- trunk/freenet/src/freenet/keys/FreenetURI.java 2006-05-27 18:27:42 UTC
(rev 8886)
+++ trunk/freenet/src/freenet/keys/FreenetURI.java 2006-05-27 22:05:06 UTC
(rev 8887)
@@ -54,7 +54,11 @@
* The metastring is meant to be passed to the metadata processing systems that
* act on the retrieved document.
* </p>
- *
+ * <p>
+ * When constructing a FreenetURI with a String argument, it is now legal for
CHK keys
+ * to have a '.extension' tail, eg 'CHK at blahblahblah.html'. The constructor
will simply
+ * chop off at the first dot.
+ * </p>
* REDFLAG: Old code has a FieldSet, and the ability to put arbitrary metadata
* in through name/value pairs. Do we want this?
*/
@@ -223,6 +227,12 @@
}
URI = URI.substring(atchar + 1);
+ // strip 'file extensions' from CHKs
+ // added by aum (david at rebirthing.co.nz)
+ if ("CHK".equals(keyType)) {
+ URI = URI.split("[.]")[0];
+ }
+
// decode metaString
int slash2;
Vector sv = new Vector();