4 package org.vamsas.client;
7 import java.util.Hashtable;
8 import java.util.Vector;
12 * base class for vamsas session/document types
13 * uses java.net.URI internally for construction of URN
15 public abstract class SessionUrn {
18 * The types of URI protocols we understand
20 protected static final Hashtable TYPES=new Hashtable();
23 * construct urn for a locally stored session file
27 protected SessionUrn(String type, java.net.URL url) {
28 if (!TYPES.containsKey(type.toLowerCase()))
29 throw new Error("Unknown "+this.getClass().getName()+" type '"+type+"' for URL '"+url+"'");
31 urn = URI.create(type+"://"+url.getPath());
32 } catch (Exception e) {
33 // TODO: something better than throwing an error should be done here.
37 public String getSessionUrn() {
38 return urn.toString();