File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 33public class BackupConfig implements ConfigurationContainer {
44 private int backupInterval = 7 ;
55 private int backupRetentionCount = 0 ;
6- private PathSetting backupLocation = new PathSetting ("$HOME$" );
6+ private PathSetting backupLocation = new PathSetting ("$HOME$/.stt/backups " );
77 private PathSetting itemLogFile = new PathSetting ("$HOME$/.stt/itemlog" );
88
99 public int getBackupInterval () {
Original file line number Diff line number Diff line change @@ -68,6 +68,13 @@ public void start() throws IOException {
6868
6969 File backupLocation = backupConfig .getBackupLocation ().file (homePath );
7070
71+ if (!backupLocation .exists ()) {
72+ boolean mkdirs = backupLocation .mkdirs ();
73+ if (!mkdirs ) {
74+ throw new IOException ("Couldn't create backup folder: " + backupLocation .getAbsolutePath ());
75+ }
76+ }
77+
7178 if (!backupLocation .canWrite ()) {
7279 throw new IOException ("cannot persist to "
7380 + backupLocation .getAbsolutePath ());
You can’t perform that action at this time.
0 commit comments