import java.io.File;
import java.io.IOException;
import java.util.Arrays;
+import java.util.Map;
import java.util.HashMap;
import java.util.TreeMap;
// sort the backup files (based on integer found in the suffix) using a
// precomputed Hashmap for speed
- HashMap<Integer, File> bfHashMap = new HashMap<>();
+ Map<Integer, File> bfHashMap = new HashMap<>();
for (int i = 0; i < backupFiles.length; i++)
{
File f = backupFiles[i];
return rename;
}
- public static TreeMap<Integer, File> lsBackupFilesAsTreeMap(
+ public static TreeMap<Integer, File> getBackupFilesAsTreeMap(
String fileName,
String suffix, int digits)
{
// sort the backup files (based on integer found in the suffix) using a
// precomputed Hashmap for speed
- HashMap<Integer, File> bfHashMap = new HashMap<>();
+ Map<Integer, File> bfHashMap = new HashMap<>();
for (int i = 0; i < backupFiles.length; i++)
{
File f = backupFiles[i];
return bfTreeMap;
}
- public static File[] lsBackupFiles(String fileName, String suffix,
+ public static File[] getBackupFiles(String fileName, String suffix,
int digits)
{
- TreeMap<Integer, File> bfTreeMap = lsBackupFilesAsTreeMap(fileName,
+ TreeMap<Integer, File> bfTreeMap = getBackupFilesAsTreeMap(fileName,
suffix, digits);
File[] backupFiles = new File[bfTreeMap.size()];
bfTreeMap.values().toArray(backupFiles);