From: pmarguerite Date: Fri, 15 Dec 2006 15:58:04 +0000 (+0000) Subject: SessionURN fix asFile method now create the File object from the URI X-Git-Tag: Release_0.2~194 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=5ac503d283a5e030ae9ad6a0ef8bc0022e33b063;p=vamsas.git SessionURN fix asFile method now create the File object from the URI git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@326 be28352e-c001-0410-b1a7-c7978e42abec --- diff --git a/src/uk/ac/vamsas/client/simpleclient/SessionUrn.java b/src/uk/ac/vamsas/client/simpleclient/SessionUrn.java index 4098e17..bdb4296 100644 --- a/src/uk/ac/vamsas/client/simpleclient/SessionUrn.java +++ b/src/uk/ac/vamsas/client/simpleclient/SessionUrn.java @@ -65,22 +65,26 @@ public class SessionUrn extends uk.ac.vamsas.client.SessionUrn { public File asFile() { String path = this.urn.getRawPath(); - if ("\\".equals(File.separator)) - { + /*if ("\\".equals(File.separator)) + {//windows stuff //remove last separator at last position if found /* not needed anymore if (path.charAt(path.length() - 1) == '/')path = path.substring(0, path.length() - 1); path = path.replaceAll("/", "\\\\"); */ - int index = path.indexOf(File.separator); + + /* int index = path.indexOf(File.separator); if (index >-1) {//separator found, keep last part of the urn - filename path = path.substring(index+1, path.length()); } + //remove encoded space character + // path = path.replaceAll("%20", " "); } /*shall we use URI or String to create the object*/ /* from URI : URI.create("file://path") , but first / */ - return new File(path); + /* return new File(path);*/ + return new File ( URI.create("file://"+path)); } // TODO: add abstract 'handler' methods for resolving the URN to a particular class }