1 8 9 package com.sleepycat.je.util; 10 11 import java.io.File ; 12 import java.io.FilenameFilter ; 13 import java.util.StringTokenizer ; 14 15 public class InfoFileFilter implements FilenameFilter { 16 17 21 public boolean accept(File dir, String name) { 22 boolean ok = false; 23 StringTokenizer tokenizer = new StringTokenizer (name, "."); 24 if (tokenizer.countTokens() == 3) { 26 String filePrefix = tokenizer.nextToken(); 27 String fileSuffix = tokenizer.nextToken(); 28 String repeat = tokenizer.nextToken(); 29 30 if (filePrefix.equals("je") && fileSuffix.equals("info")) { 32 try { 34 Integer.parseInt(repeat); 35 ok = true; 36 } catch (NumberFormatException e) { 37 ok = false; 38 } 39 } 40 } 41 42 return ok; 43 } 44 } 45 46 | Popular Tags |