use file File.seperator instead of "/"

This commit is contained in:
Manfred Karrer 2014-07-09 15:07:37 +02:00
parent 6395c4f92f
commit 6ca922ba2c
2 changed files with 2 additions and 3 deletions

View file

@ -11,7 +11,6 @@ public class FileUtil
{
private static final Logger log = LoggerFactory.getLogger(FileUtil.class);
public static File getFile(String name, String suffix)
{
return new File(StorageDirectory.getStorageDirectory(), name + "." + suffix);

View file

@ -50,9 +50,9 @@ public class StorageDirectory
// check if it is packed into a mac app (e.g.: "/Users/mk/Desktop/bitsquare.app/Contents/Java/bitsquare.jar")
if (executionRoot.getCanonicalPath().endsWith(".app/Contents/Java/bitsquare.jar") && System.getProperty("os.name").startsWith("Mac"))
return executionRoot.getParentFile().getParentFile().getParentFile().getParentFile();
else if (executionRoot.getCanonicalPath().endsWith("/target/classes"))
else if (executionRoot.getCanonicalPath().endsWith(File.separator + "target" + File.separator + "classes"))
return executionRoot.getParentFile(); // dev e.g.: /Users/mk/Documents/_intellij/bitsquare/target/classes -> use target as root
else if (executionRoot.getCanonicalPath().endsWith("/bitsquare.jar"))
else if (executionRoot.getCanonicalPath().endsWith(File.separator + "bitsquare.jar"))
return executionRoot.getParentFile(); // dev with jar e.g.: Users/mk/Documents/_intellij/bitsquare/out/artifacts/bitsquare2/bitsquare.jar -> use target as root
else
return executionRoot;