X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fuk%2Fac%2Fvamsas%2Fclient%2Fsimpleclient%2FSessionUrn.java;h=36ca50a2d13070bdca68efb1cc80774b2003e870;hb=86fda51136738b4cf1bd32b0d6a0a65767d7ad8c;hp=21726024f3a5b74cbf9b900278526e718d2ef2b2;hpb=233da7bd1cde9fd8b2818ff575f7746f1956064e;p=vamsas.git diff --git a/src/uk/ac/vamsas/client/simpleclient/SessionUrn.java b/src/uk/ac/vamsas/client/simpleclient/SessionUrn.java index 2172602..36ca50a 100644 --- a/src/uk/ac/vamsas/client/simpleclient/SessionUrn.java +++ b/src/uk/ac/vamsas/client/simpleclient/SessionUrn.java @@ -61,16 +61,18 @@ public class SessionUrn extends uk.ac.vamsas.client.SessionUrn { } /** - * Generates a sessionURN bases on a session directory location + * Generates a sessionURN from a file with a type of SIMPLECLIENT if it is a directory or VAMSASDOCUMENT if it is a file. + * + * Note: No validation is performed, either for uniqueness of resultant URI or validity of the location. * * @param sessionLocation - * the file object to the session directory + * the file object to create the sessionURN from. + * */ - public SessionUrn(File sessionLocation) {// throws MalformedURLException { - // TODO: LATER: implement switch to have vamsas document or simpleclient - // sessions for same constructor - // use URI instead of URL - super(SIMPLECLIENT, sessionLocation.getAbsoluteFile().toURI()); + public SessionUrn(File sessionLocation) { + // TODO: refactor this and use a Urn factory - this inline switch is pretty ugly! + super((sessionLocation.isFile() ? VAMSASDOCUMENT : SIMPLECLIENT) + ,sessionLocation.getAbsoluteFile().toURI()); } /**