(String path, int musthave, int canthave)
| 54 | |
| 55 | //ok! |
| 56 | public static File[] FindAll(String path, int musthave, int canthave) { |
| 57 | |
| 58 | int index = path.lastIndexOf('/'); |
| 59 | |
| 60 | if (index != -1) { |
| 61 | findbase = path.substring(0, index); |
| 62 | findpattern = path.substring(index + 1, path.length()); |
| 63 | } else { |
| 64 | findbase = path; |
| 65 | findpattern = "*"; |
| 66 | } |
| 67 | |
| 68 | if (findpattern.equals("*.*")) { |
| 69 | findpattern = "*"; |
| 70 | } |
| 71 | |
| 72 | File fdir = new File(findbase); |
| 73 | |
| 74 | if (!fdir.exists()) |
| 75 | return null; |
| 76 | |
| 77 | FilenameFilter filter = new FileFilter(findpattern, musthave, canthave); |
| 78 | |
| 79 | return fdir.listFiles(filter); |
| 80 | } |
| 81 | |
| 82 | /** |
| 83 | * Match the pattern findpattern against the filename. |
no test coverage detected