Fix issue with URI decoding.

git-svn-id: file:///home/svn/framework3/trunk@13717 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Matt Weeks 2011-09-11 03:47:01 +00:00
parent b7ed699abf
commit adcc9fcbbb
2 changed files with 9 additions and 5 deletions

Binary file not shown.

View File

@ -260,11 +260,15 @@ public class MsfguiApp extends SingleFrameApplication {
* @throws MsfException if this jar file has been moved or the containing directory structure has been moved. * @throws MsfException if this jar file has been moved or the containing directory structure has been moved.
*/ */
public static File getMsfRoot() throws MsfException{ public static File getMsfRoot() throws MsfException{
File f = new File(MsfguiApp.class.getProtectionDomain().getCodeSource().getLocation().getPath()); try{
File parent = f.getParentFile(); File f = new File(MsfguiApp.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath());
File grandparent = parent.getParentFile(); File parent = f.getParentFile();
if(f.getName().equals("msfgui.jar") && parent.getName().equals("gui") && grandparent.getName().equals("data")) File grandparent = parent.getParentFile();
return grandparent.getParentFile(); if(f.getName().equals("msfgui.jar") && parent.getName().equals("gui") && grandparent.getName().equals("data"))
return grandparent.getParentFile();
}catch(java.net.URISyntaxException urisex){
urisex.printStackTrace();
}
throw new MsfException("Cannot find path."); throw new MsfException("Cannot find path.");
} }