e6184eb83c6a281a5745b0dacc6da96e2903fd1f
[vamsas.git] / src / uk / ac / vamsas / client / simpleclient / ArchiveUrn.java
1 package uk.ac.vamsas.client.simpleclient;
2
3 import java.io.File;
4 import java.net.MalformedURLException;
5
6 /**
7  * Vamsas Document URN for files understood by ArchiveReader and 
8  * written by VamsasArchive.
9  * vdoc://{Absolute path to file}
10  * @author jimp
11  *
12  */
13 public class ArchiveUrn extends uk.ac.vamsas.client.SessionUrn {
14   /**
15    * a simple vamsas document urn prefix
16    */
17   public static String VAMSASDOCUMENT="vdoc";
18   static {
19     TYPES.put(ArchiveUrn.VAMSASDOCUMENT, ArchiveUrn.class);
20   }
21
22   public ArchiveUrn(File docLocation) throws MalformedURLException {
23     super(VAMSASDOCUMENT, docLocation.getAbsoluteFile().toURL());
24   }
25
26   /**
27    * TODO: LATER: think about this again.
28    * @return File(urn.getPath())
29    */
30   public File asFile() {
31     return new File(urn.getPath());
32   }
33   // TODO: add abstract 'handler' methods for resolving the URN to a particular class
34 }