@Override public String toString() { return getPath(); } }
public Dir createDir(URL url) throws Exception { return new UrlTypeVFS().createDir(url); } },
/** tries to create a Dir from the given url, using the defaultUrlTypes */ public static Dir fromURL(final URL url) { return fromURL(url, defaultUrlTypes); }
public Dir createDir(final URL url) throws Exception { return new JarInputDir(url); } }
/** return an iterable of all {@link org.reflections.vfs.Vfs.File} in given urls, starting with given packagePrefix and matching nameFilter */ public static Iterable<File> findFiles(final Collection<URL> inUrls, final String packagePrefix, final Predicate<String> nameFilter) { Predicate<File> fileNamePredicate = new Predicate<File>() { public boolean apply(File file) { String path = file.getRelativePath(); if (path.startsWith(packagePrefix)) { String filename = path.substring(path.indexOf(packagePrefix) + packagePrefix.length()); return !Utils.isEmpty(filename) && nameFilter.apply(filename.substring(1)); } else { return false; } } }; return findFiles(inUrls, fileNamePredicate); }
@Override public String toString() { return root.getPath() + "!" + java.io.File.separatorChar + entry.toString(); } }
public Dir createDir(URL url) throws Exception { return new UrlTypeVFS().createDir(url); } },
/** tries to create a Dir from the given url, using the defaultUrlTypes */ public static Dir fromURL(final URL url) { return fromURL(url, defaultUrlTypes); }
@Override public String toString() { return getPath(); } }
public Dir createDir(final URL url) throws Exception { return new JarInputDir(url); } }
/** return an iterable of all {@link org.reflections.vfs.Vfs.File} in given urls, starting with given packagePrefix and matching nameFilter */ public static Iterable<File> findFiles(final Collection<URL> inUrls, final String packagePrefix, final Predicate<String> nameFilter) { Predicate<File> fileNamePredicate = new Predicate<File>() { public boolean apply(File file) { String path = file.getRelativePath(); if (path.startsWith(packagePrefix)) { String filename = path.substring(path.indexOf(packagePrefix) + packagePrefix.length()); return !Utils.isEmpty(filename) && nameFilter.apply(filename.substring(1)); } else { return false; } } }; return findFiles(inUrls, fileNamePredicate); }
@Override public String toString() { return root.getPath() + "!" + java.io.File.separatorChar + entry.toString(); } }
/** tries to create a Dir from the given url, using the given urlTypes*/ public static Dir fromURL(final URL url, final UrlType... urlTypes) { return fromURL(url, Lists.<UrlType>newArrayList(urlTypes)); }
/** tries to create a Dir from the given url, using the given urlTypes*/ public static Dir fromURL(final URL url, final UrlType... urlTypes) { return fromURL(url, Lists.<UrlType>newArrayList(urlTypes)); }