Note that the metadata pairs below are not presently supported. They are supported by the old (0.5) code however. FreenetURI handles parsing and creation of the Freenet URI format, defined as follows:
freenet:[KeyType@]RoutingKey,CryptoKey[,n1=v1,n2=v2,...][/docname][/metastring]
where KeyType is the TLA of the key (currently USK, SSK, KSK, or CHK). If omitted, KeyType defaults to KSK. BUT: CHKs don't support or require a docname. KSKs and SSKs do. Therefore CHKs go straight into metastrings.
For KSKs, the string keyword (docname) takes the RoutingKey position and the remainder of the fields are inapplicable (except metastring). Examples: freenet:KSK@foo/bar freenet:KSK@test.html freenet:test.html.
RoutingKey is the modified Base64 encoded key value. CryptoKey is the modified Base64 encoded decryption key.
Following the RoutingKey and CryptoKey there may be a series of name=value
pairs representing URI meta-information.
The docname is only meaningful for SSKs, and is hashed with the PK fingerprint to get the key value.
The metastring is meant to be passed to the metadata processing systems that act on the retrieved document.
When constructing a FreenetURI with a String argument, it is now legal for CHK keys to have a '.extension' tail, eg 'CHK@blahblahblah.html'. The constructor will simply chop off at the first dot.
REDFLAG: Old code has a FieldSet, and the ability to put arbitrary metadata in through name/value pairs. Do we want this? WARNING: Changing non-transient members on classes that are Serializable can result in restarting downloads or losing uploads.