git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@500
be28352e-c001-0410-b1a7-
c7978e42abec
- * Generates a sessionURN bases on a session directory location\r
+ * Generates a sessionURN from a file with a type of SIMPLECLIENT if it is a directory or VAMSASDOCUMENT if it is a file. \r
+ * \r
+ * Note: No validation is performed, either for uniqueness of resultant URI or validity of the location.\r
* \r
* @param sessionLocation\r
* \r
* @param sessionLocation\r
- * the file object to the session directory\r
+ * the file object to create the sessionURN from.\r
+ * \r
- public SessionUrn(File sessionLocation) {// throws MalformedURLException {\r
- // TODO: LATER: implement switch to have vamsas document or simpleclient\r
- // sessions for same constructor\r
- // use URI instead of URL\r
- super(SIMPLECLIENT, sessionLocation.getAbsoluteFile().toURI());\r
+ public SessionUrn(File sessionLocation) {\r
+ // TODO: refactor this and use a Urn factory - this inline switch is pretty ugly!\r
+ super((sessionLocation.isFile() ? VAMSASDOCUMENT : SIMPLECLIENT)\r
+ ,sessionLocation.getAbsoluteFile().toURI());\r