Skip to content

Commit

Permalink
#31030 Making backup directory configurable.
Browse files Browse the repository at this point in the history
  • Loading branch information
dcolina committed Jan 10, 2025
1 parent 83e3277 commit 615b984
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
11 changes: 10 additions & 1 deletion dotCMS/src/main/java/com/dotmarketing/util/ConfigUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,19 @@ public static String getLucenePath() {
return getDynamicContentPath() + File.separator + "dotlucene";
}

/**
* Retrieves the configurable path for the backup directory.
* Defaults to DYNAMIC_CONTENT_PATH/dotsecure/backup if not overridden.
*
* @return the backup directory path
*/
public static String getBackupPath() {
return getDynamicContentPath() + File.separator + "backup";
String dynamicContentPath = getDynamicContentPath();
return Config.getStringProperty("backup.directory",
Paths.get(dynamicContentPath, "dotsecure", "backup").toString());
}


public static String getBundlePath() {
final Path path = Paths.get(String.format("%s%sbundles",getAbsoluteAssetsRootPath(),File.separator)).normalize();
File pathDir = path.toFile();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,10 @@
public class ImportStarterUtil {

/**
* The path where tmp files are stored. This gets wiped alot
* Fully configurable path for the backup directory.
*/
private String backupTempFilePath = ConfigUtils.getBackupPath() + File.separator + "temp";
private static final String BACKUP_DIRECTORY = ConfigUtils.getBackupPath();
private String backupTempFilePath = BACKUP_DIRECTORY + File.separator + "temp";
private ArrayList<String> classesWithIdentity = new ArrayList<>();
private Map<String, String> sequences;
private Map<String, String> tableIDColumns;
Expand Down

0 comments on commit 615b984

Please sign in to comment.