Changed the config backups to have the date appended to the name opposed to .bak
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
package src.main;
|
package src.main;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
import java.util.AbstractMap;
|
import java.util.AbstractMap;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -109,7 +111,7 @@ public class ConfigManager {
|
|||||||
|
|
||||||
// Copy the file to the backup directory, replacing existing ones
|
// Copy the file to the backup directory, replacing existing ones
|
||||||
for(Path filePath : fileList) {
|
for(Path filePath : fileList) {
|
||||||
String newFileName = filePath.getFileName().toString() + ".bak";
|
String newFileName = filePath.getFileName().toString() + LocalDate.now();
|
||||||
System.out.println(newFileName);
|
System.out.println(newFileName);
|
||||||
System.out.println(Path.of(destination.toString(), newFileName).toString());
|
System.out.println(Path.of(destination.toString(), newFileName).toString());
|
||||||
Files.copy(filePath, Path.of(destination.toString(), newFileName), StandardCopyOption.REPLACE_EXISTING);
|
Files.copy(filePath, Path.of(destination.toString(), newFileName), StandardCopyOption.REPLACE_EXISTING);
|
||||||
|
|||||||
Reference in New Issue
Block a user