// Most of the rest is dependent upon this:
config = new ConfigBundle();
- String configDir = System.getenv("CONFIG_DIR");
+ String configDir = System.getProperty("CONFIG_DIR");
+ if (configDir == null) {
+ configDir = System.getenv("CONFIG_DIR");
+ }
if (configDir == null) {
configDir = new File(System.getProperty("user.home"), ".fanfix")
.getPath();
}
+
if (configDir != null) {
if (!new File(configDir).exists()) {
new File(configDir).mkdirs();
debug = true;
}
- if (tmp == null || readerTmp == null) {
- String tmpDir = System.getProperty("java.io.tmpdir");
- if (tmpDir != null) {
- if (tmp == null) {
- tmp = new File(tmpDir, "fanfic-tmp");
- }
- if (readerTmp == null) {
- readerTmp = new File(tmpDir, "fanfic-reader");
- }
- } else {
- syserr(new IOException(
- "The system does not have a default temporary directory"));
- }
+ // Could have used: System.getProperty("java.io.tmpdir")
+ if (tmp == null) {
+ tmp = new File(configDir, "tmp");
+ }
+ if (readerTmp == null) {
+ readerTmp = new File(configDir, "tmp-reader");
}
+ //
if (coverDir != null && !coverDir.exists()) {
syserr(new IOException(