@Test public void testRelative() throws Exception { GlobFileFinder gff = new GlobFileFinder(); StringBuilder sb = new StringBuilder(); Path cwd = path("").toAbsolutePath(); for (int i = 0; i < cwd.getNameCount(); i++) { sb.append("../"); } sb.append(tempDir.toString()).append("/*/a*"); List<Path> l1 = gff.find(sb.toString()); assertEquals(2, l1.size()); assertTrue(find(p_c_abc, l1)); assertTrue(find(p_d_abc, l1)); }
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);  }