*/
package uk.ac.vamsas.client;
+import java.io.File;
import java.net.URI;
import java.util.Hashtable;
import java.util.Vector;
*/
protected static final Hashtable TYPES=new Hashtable();
+
+ protected SessionUrn()
+ {
+ //
+ }
/**
* construct urn for a locally stored session file
* @param type
if (!TYPES.containsKey(type.toLowerCase()))
throw new Error("Unknown "+this.getClass().getName()+" type '"+type+"' for URL '"+url+"'");
try {
- urn = URI.create(type+"://"+url.getPath());
+ //urn = URI.create(type+"://"+urlString);
+ this.setURN(type+"://"+url.getPath());
+ // urn = URI.create(type+"://"+url.getPath());
} catch (Exception e) {
// TODO: something better than throwing an error should be done here.
+ e.printStackTrace(System.err);
throw new Error(e);
}
}
public String getSessionUrn() {
- return urn.toString();
+ return this.urn.toString();
}
+
+ /**
+ * Set arun attribute
+ * create a URI from the provided String
+ *
+ * @param urnString urn to convert to a URN
+ */
+ protected void setURN(String urnString) throws NullPointerException, IllegalArgumentException
+ {
+ this.urn = URI.create(urnString);
+ }
+
}