4 package org.vamsas.client;
8 import java.util.Hashtable;
9 import java.util.Vector;
13 * base class for vamsas session/document types
14 * uses java.net.URI internally for construction of URN
16 public abstract class SessionUrn {
19 * The types of URI protocols we understand
21 protected static final Hashtable TYPES=new Hashtable();
24 * construct urn for a locally stored session file
28 protected SessionUrn(String type, File file) {
29 if (!TYPES.containsKey(type.toLowerCase()))
30 throw new Error("Unknown "+this.getClass().getName()+" type '"+type+"' for file '"+file.getAbsolutePath()+"'");
31 urn = URI.create(type+"://"+file.getAbsolutePath());
33 public String getSessionUrn() {
34 return urn.toString();
37 // TODO: add abstract 'handler' methods for resolving the URN to a particular class