4 import java.io.FilenameFilter;
5 import java.io.IOException;
7 public class BackupFilenameFilter implements FilenameFilter
12 public String template;
16 public BackupFilenameFilter(String base, String template, int digits)
19 this.template = template;
24 public boolean accept(File dir, String filename)
29 dir.getCanonicalPath() + File.separatorChar + filename);
30 if (file.isDirectory())
32 // backup files aren't dirs!
35 } catch (IOException e)
37 System.out.println("IOException when checking file '" + filename
38 + "' is a backupfile");
41 BackupFilenameParts bffp = new BackupFilenameParts(filename, base,
43 return bffp.isBackupFile();