applied LGPLv3 and source code formatting.
[vamsas.git] / src / uk / ac / vamsas / client / simpleclient / ArchiveUrn.java
1 /*\r
2  * This file is part of the Vamsas Client version 0.1. \r
3  * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite, \r
4  *  Andrew Waterhouse and Dominik Lindner.\r
5  * \r
6  * Earlier versions have also been incorporated into Jalview version 2.4 \r
7  * since 2008, and TOPALi version 2 since 2007.\r
8  * \r
9  * The Vamsas Client is free software: you can redistribute it and/or modify\r
10  * it under the terms of the GNU Lesser General Public License as published by\r
11  * the Free Software Foundation, either version 3 of the License, or\r
12  * (at your option) any later version.\r
13  *  \r
14  * The Vamsas Client is distributed in the hope that it will be useful,\r
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
17  * GNU Lesser General Public License for more details.\r
18  * \r
19  * You should have received a copy of the GNU Lesser General Public License\r
20  * along with the Vamsas Client.  If not, see <http://www.gnu.org/licenses/>.\r
21  */\r
22 package uk.ac.vamsas.client.simpleclient;\r
23 \r
24 import java.io.File;\r
25 import java.net.MalformedURLException;\r
26 \r
27 /**\r
28  * Vamsas Document URN for files understood by ArchiveReader and written by\r
29  * VamsasArchive. vdoc://{Absolute path to file}\r
30  * \r
31  * @author jimp\r
32  * \r
33  */\r
34 public class ArchiveUrn extends uk.ac.vamsas.client.SessionUrn {\r
35   /**\r
36    * a simple vamsas document urn prefix\r
37    */\r
38   public static String VAMSASDOCUMENT = "vdoc";\r
39   static {\r
40     TYPES.put(ArchiveUrn.VAMSASDOCUMENT, ArchiveUrn.class);\r
41   }\r
42 \r
43   public ArchiveUrn(File docLocation) throws MalformedURLException {\r
44     super(VAMSASDOCUMENT, docLocation.getAbsoluteFile().toURL());\r
45   }\r
46 \r
47   /**\r
48    * TODO: LATER: think about this again.\r
49    * \r
50    * @return File(urn.getPath())\r
51    */\r
52   public File asFile() {\r
53     return new File(urn.getPath());\r
54   }\r
55   // TODO: add abstract 'handler' methods for resolving the URN to a particular\r
56   // class\r
57 }\r