public <T extends File> T getFirstChild(Class<T> clazz) { FileIterator<T> iter = getFiles(clazz); if (iter != null && iter.hasNext()) { return iter.next(); } return null; }
public <T extends File> T getFile(String name, Class<T> clazz) { FileIterator<T> iter = getFiles(clazz); if (iter != null) { while (iter.hasNext()) { T next = iter.next(); if (next.getName().equals(name)) { return next; } } // return iter.next(); } return null; }
public File getFile(final String fname) { FileIterator<File> iterator = getFiles( new FileFilter() { public boolean accept(File pathname) { boolean res = fname.equals(pathname.getName()); return res; } }); if (iterator.hasNext()) { return iterator.next(); } return null; }