protected static void create(List list, File dir, Filter filter) throws Exception { File[] files = dir.listFiles(); for (int i = 0; i < files.length; i++) { if (files[i].isDirectory()) { create(list, files[i], filter); } else { if (filter == null || filter.accepts(files[i].getAbsolutePath())) { list.add(files[i]); } } } }
protected static void create(List list, File dir, Filter filter, String prefix) throws Exception { File[] files = dir.listFiles(); for (int i = 0; i < files.length; i++) { if (files[i].isDirectory()) { create(list, files[i], filter, prefix); } else { String path = files[i].getCanonicalPath(); String relativePath = path.substring(prefix.length() + 1); if (File.separatorChar == '\\') relativePath = relativePath.replace('\\', '/'); if (filter == null || filter.accepts(relativePath)) { list.add(files[i]); } } } }
private void setNext() { initial = true; try { if (next != null) jar.closeEntry(); next = null; do { next = jar.getNextJarEntry(); } while (next != null && (next.isDirectory() || (filter == null || !filter.accepts(next.getName())))); if (next == null) { close(); } } catch (IOException e) { throw new RuntimeException("failed to browse jar", e); } }
private void setNext() { initial = true; try { if (next != null) jar.closeEntry(); next = null; do { next = jar.getNextJarEntry(); } while (next != null && (next.isDirectory() || (filter == null || !filter.accepts(next.getName())))); if (next == null) { close(); } } catch (IOException e) { throw new RuntimeException("failed to browse jar", e); } }