1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-08-13 17:03:45 -04:00
This commit is contained in:
Reinhard Pointner 2014-08-30 12:07:47 +00:00
parent d829e6a561
commit bad512829a

View File

@ -85,8 +85,7 @@ public final class Settings {
} }
public static FileChooser getPreferredFileChooser() { public static FileChooser getPreferredFileChooser() {
String prop = System.getProperty("net.filebot.UserFiles.fileChooser"); return FileChooser.valueOf(System.getProperty("net.filebot.UserFiles.fileChooser", "Swing"));
return prop == null ? FileChooser.Swing : FileChooser.valueOf(prop);
} }
public static int getPreferredThreadPoolSize() { public static int getPreferredThreadPoolSize() {
@ -102,12 +101,12 @@ public final class Settings {
} }
public static File getApplicationFolder() { public static File getApplicationFolder() {
String applicationDirPath = System.getProperty("application.dir"); String applicationFolderPath = System.getProperty("application.dir");
File applicationFolder = null; File applicationFolder = null;
if (applicationDirPath != null && applicationDirPath.length() > 0) { if (applicationFolderPath != null && !applicationFolderPath.isEmpty()) {
// use given path // use given path
applicationFolder = new File(applicationDirPath); applicationFolder = new File(applicationFolderPath);
} else { } else {
// create folder in user home (can't use working directory for web start applications) // create folder in user home (can't use working directory for web start applications)
applicationFolder = new File(System.getProperty("user.home"), ".filebot"); applicationFolder = new File(System.getProperty("user.home"), ".filebot");
@ -121,20 +120,20 @@ public final class Settings {
} }
public static File getApplicationCache() { public static File getApplicationCache() {
String cacheDefaultPath = System.getProperty("application.cache"); String cacheFolderPath = System.getProperty("application.cache");
File cacheFolder = null;
File cacheDir = null; if (cacheFolderPath != null && !cacheFolderPath.isEmpty()) {
if (cacheDefaultPath != null) { cacheFolder = new File(cacheFolderPath);
cacheDir = new File(cacheDefaultPath);
} else { } else {
cacheDir = new File(getApplicationFolder(), "cache"); cacheFolder = new File(getApplicationFolder(), "cache");
} }
// create folder if necessary // create folder if necessary
if (!cacheDir.exists()) { if (!cacheFolder.exists()) {
cacheDir.mkdirs(); cacheFolder.mkdirs();
} }
return cacheDir; return cacheFolder;
} }
public static Settings forPackage(Class<?> type) { public static Settings forPackage(Class<?> type) {