From 2419dc98de731cb3b54ff6943556aba055452d81 Mon Sep 17 00:00:00 2001 From: Andrew Sun <0xandrewsun@gmail.com> Date: Wed, 28 Feb 2018 13:52:11 -0600 Subject: [PATCH] Only open .nsbak extensions --- src/com/crossbowffs/nekosms/backup/BackupLoader.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/com/crossbowffs/nekosms/backup/BackupLoader.java b/src/com/crossbowffs/nekosms/backup/BackupLoader.java index 4524d37..c3aa99e 100644 --- a/src/com/crossbowffs/nekosms/backup/BackupLoader.java +++ b/src/com/crossbowffs/nekosms/backup/BackupLoader.java @@ -9,6 +9,7 @@ import com.crossbowffs.nekosms.utils.Xlog; import java.io.File; +import java.io.FilenameFilter; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Arrays; @@ -48,15 +49,12 @@ public static String getDefaultBackupFileName() { public static File[] enumerateBackupFiles() { File backupDir = getBackupDirectory(); - - // In the future we will only accept backup files with the - // correct extension. - File[] fileList = backupDir.listFiles(/* new FilenameFilter() { + File[] fileList = backupDir.listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.endsWith(BACKUP_FILE_EXTENSION); } - } */); + }); if (fileList != null) { // Currently file names are sorted purely lexicographically,