X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fuk%2Fac%2Fvamsas%2Fclient%2Fsimpleclient%2FSessionUrn.java;h=0dfe65af7a6bf6733f6dce1259c1d501a8416374;hb=1eea4b639911330e7cd65e17c5421cc584f0d22e;hp=21726024f3a5b74cbf9b900278526e718d2ef2b2;hpb=844ccad5a3fcbedec17b2af66d460f31abc7cff1;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..0dfe65a 100644 --- a/src/uk/ac/vamsas/client/simpleclient/SessionUrn.java +++ b/src/uk/ac/vamsas/client/simpleclient/SessionUrn.java @@ -1,6 +1,6 @@ /* - * This file is part of the Vamsas Client version 0.1. - * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite, + * This file is part of the Vamsas Client version 0.2. + * Copyright 2010 by Jim Procter, Iain Milne, Pierre Marguerite, * Andrew Waterhouse and Dominik Lindner. * * Earlier versions have also been incorporated into Jalview version 2.4 @@ -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()); } /**