debugging the org.vamsas.client.SessionUrn selection mechanism (also partial bits...
[vamsas.git] / src / org / vamsas / client / simpleclient / ArchiveUrn.java
index 93e889c..304e1f2 100644 (file)
@@ -1,6 +1,7 @@
 package org.vamsas.client.simpleclient;
 
 import java.io.File;
+import java.net.MalformedURLException;
 
 /**
  * Vamsas Document URN for files understood by ArchiveReader and 
@@ -18,7 +19,16 @@ public class ArchiveUrn extends org.vamsas.client.SessionUrn {
     TYPES.put(ArchiveUrn.VAMSASDOCUMENT, ArchiveUrn.class);
   }
 
-  public ArchiveUrn(File docLocation) {
-    super(VAMSASDOCUMENT, docLocation);
+  public ArchiveUrn(File docLocation) throws MalformedURLException {
+    super(VAMSASDOCUMENT, docLocation.getAbsoluteFile().toURL());
   }
+
+  /**
+   * TODO: LATER: think about this again.
+   * @return File(urn.getPath())
+   */
+  public File asFile() {
+    return new File(urn.getPath());
+  }
+  // TODO: add abstract 'handler' methods for resolving the URN to a particular class
 }