@Test public void testEmpty() throws Exception { GlobFileFinder gff = new GlobFileFinder(); List<Path> l1 = gff.find(tempDir.resolve("*.txt").toString()); assertEquals(0, l1.size()); List<Path> l2 = gff.find(tempDir.resolve("..").toString()); assertEquals(0, l2.size()); }
public List<Path> find(String pattern) { result = new ArrayList<Path>(); ioCount = 0; Path patternPath = FileSystems.getDefault().getPath(pattern); List<Path> plist = new ArrayList<Path>(); patternPath.forEach(plist::add); ListIterator<Path> pitr = plist.listIterator(); if (pitr.hasNext()) { Path current = patternPath.isAbsolute() ? patternPath.getRoot() : FileSystems.getDefault().getPath(""); findMatchingFiles(current, pitr); } return result; }
GlobFileFinder { public List<Path> find(String pattern) { result = new ArrayList<Path>(); ioCount = 0; Path patternPath = FileSystems.getDefault().getPath(pattern); List<Path> plist = new ArrayList<Path>(); patternPath.forEach(plist::add); ListIterator<Path> pitr = plist.listIterator(); if (pitr.hasNext()) { Path current = patternPath.isAbsolute() ? patternPath.getRoot() : FileSystems.getDefault().getPath(""); findMatchingFiles(current, pitr); } return result; } }
GlobFileFinder { public List<Path> find(String pattern) { result = new ArrayList<Path>(); ioCount = 0; Path patternPath = FileSystems.getDefault().getPath(pattern); List<Path> plist = new ArrayList<Path>(); patternPath.forEach(plist::add); ListIterator<Path> pitr = plist.listIterator(); if (pitr.hasNext()) { Path current = patternPath.isAbsolute() ? patternPath.getRoot() : FileSystems.getDefault().getPath(""); findMatchingFiles(current, pitr); } return result; }  }
GlobFileFinder { public List<Path> find(String pattern) { result = new ArrayList<Path>(); ioCount = 0; Path patternPath = FileSystems.getDefault().getPath(pattern); List<Path> plist = new ArrayList<Path>(); patternPath.forEach(plist::add); ListIterator<Path> pitr = plist.listIterator(); if (pitr.hasNext()) { Path current = patternPath.isAbsolute() ? patternPath.getRoot() : FileSystems.getDefault().getPath(""); findMatchingFiles(current, pitr); } return result; }  List<Path> find(String pattern); void setIoLimit(int ioLimit); }
GlobFileFinder { public List<Path> find(String pattern) { result = new ArrayList<Path>(); ioCount = 0; Path patternPath = FileSystems.getDefault().getPath(pattern); List<Path> plist = new ArrayList<Path>(); patternPath.forEach(plist::add); ListIterator<Path> pitr = plist.listIterator(); if (pitr.hasNext()) { Path current = patternPath.isAbsolute() ? patternPath.getRoot() : FileSystems.getDefault().getPath(""); findMatchingFiles(current, pitr); } return result; }  List<Path> find(String pattern); void setIoLimit(int ioLimit);  }