Browse Source

Default temp path moved to a subfolder of the data path

This allows users to set only their data path, and for the temp folder to automatically follow it. The temp folder can be moved to a custom location by setting the "tempDataPath" setting.
qdn
CalDescent 3 years ago
parent
commit
b761674b2c
  1. 9
      src/main/java/org/qortal/settings/Settings.java

9
src/main/java/org/qortal/settings/Settings.java

@ -5,6 +5,7 @@ import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
import java.nio.file.Paths;
import java.util.*;
import javax.xml.bind.JAXBContext;
@ -264,7 +265,7 @@ public class Settings {
/** Data storage path. */
private String dataPath = "data";
/** Data storage path (for temporary data). */
private String tempDataPath = "data/_temp";
private String tempDataPath = null;
/** Storage policy to indicate which data should be hosted */
private String storagePolicy = "FOLLOWED_AND_VIEWED";
@ -783,7 +784,11 @@ public class Settings {
}
public String getTempDataPath() {
return this.tempDataPath;
if (this.tempDataPath != null) {
return this.tempDataPath;
}
// Default the temp path to a "_temp" folder inside the data directory
return Paths.get(this.getDataPath(), "_temp").toString();
}
public StoragePolicy getStoragePolicy() {

Loading…
Cancel
Save