filebot/source/net/filebot/ApplicationFolder.java

33 lines
753 B
Java
Raw Normal View History

2016-08-04 03:05:54 -04:00
package net.filebot;
import static net.filebot.Settings.*;
import java.io.File;
public enum ApplicationFolder {
// real user home (the user.home will point to the application-specific container in sandbox environments)
2016-11-25 10:59:26 -05:00
UserHome(isMacSandbox() ? System.getProperty("UserHome") : System.getProperty("user.home")),
2016-08-04 03:05:54 -04:00
2016-11-25 10:59:26 -05:00
AppData(System.getProperty("application.dir", UserHome.resolve(".filebot").getPath())),
2016-08-04 03:05:54 -04:00
Temp(System.getProperty("java.io.tmpdir")),
2016-11-25 10:59:26 -05:00
Cache(System.getProperty("application.cache", AppData.resolve("cache").getPath()));
2016-08-04 03:05:54 -04:00
private final File path;
ApplicationFolder(String path) {
this.path = new File(path);
}
2016-11-25 10:59:26 -05:00
public File getFile() {
2016-08-04 03:05:54 -04:00
return path;
}
public File resolve(String name) {
2016-11-25 10:59:26 -05:00
return new File(path, name);
2016-08-04 03:05:54 -04:00
}
}