+++ /dev/null
-/**
- *
- */
-package org.vamsas.client;
-
-import java.net.URI;
-import java.util.Hashtable;
-import java.util.Vector;
-
-/**
- * @author jimp
- * base class for vamsas session/document types
- * uses java.net.URI internally for construction of URN
- */
-public abstract class SessionUrn {
- protected URI urn;
- /**
- * The types of URI protocols we understand
- */
- protected static final Hashtable TYPES=new Hashtable();
-
- /**
- * construct urn for a locally stored session file
- * @param type
- * @param url
- */
- protected SessionUrn(String type, java.net.URL url) {
- if (!TYPES.containsKey(type.toLowerCase()))
- throw new Error("Unknown "+this.getClass().getName()+" type '"+type+"' for URL '"+url+"'");
- try {
- urn = URI.create(type+"://"+url.getPath());
- } catch (Exception e) {
- // TODO: something better than throwing an error should be done here.
- throw new Error(e);
- }
- }
- public String getSessionUrn() {
- return urn.toString();
- }
-}