Skip to content

Commit

Permalink
Add prefix to backup dir
Browse files Browse the repository at this point in the history
  • Loading branch information
ManfredKarrer committed Apr 5, 2016
1 parent bc734fe commit 8d8318a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion common/src/main/java/io/bitsquare/storage/FileUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ public static void rollingBackup(File dir, String fileName) {

File origFile = new File(Paths.get(dir.getAbsolutePath(), fileName).toString());
if (origFile.exists()) {
File backupFileDir = new File(Paths.get(backupDir.getAbsolutePath(), fileName.replace(".", "_")).toString());
String dirName = "backups_" + fileName;
if (dirName.contains("."))
dirName = dirName.replace(".", "_");
File backupFileDir = new File(Paths.get(backupDir.getAbsolutePath(), dirName).toString());
if (!backupFileDir.exists())
if (!backupFileDir.mkdir())
log.warn("make backupFileDir failed");
Expand Down

0 comments on commit 8d8318a

Please sign in to comment.