本文整理了Java中org.reflections.vfs.Vfs.fromURL()
方法的一些代码示例,展示了Vfs.fromURL()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Vfs.fromURL()
方法的具体详情如下:
包路径:org.reflections.vfs.Vfs
类名称:Vfs
方法名:fromURL
[英]tries to create a Dir from the given url, using the defaultUrlTypes
[中]尝试使用defaultUrlTypes从给定url创建目录
代码示例来源:origin: ronmamo/reflections
/** tries to create a Dir from the given url, using the defaultUrlTypes */
public static Dir fromURL(final URL url) {
return fromURL(url, defaultUrlTypes);
}
代码示例来源:origin: org.reflections/reflections
/** tries to create a Dir from the given url, using the defaultUrlTypes */
public static Dir fromURL(final URL url) {
return fromURL(url, defaultUrlTypes);
}
代码示例来源:origin: ronmamo/reflections
/** 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));
}
代码示例来源:origin: org.reflections/reflections
/** 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));
}
代码示例来源:origin: ronmamo/reflections
public Dir createDir(URL url) throws Exception {
return fromURL((URL) ClasspathHelper.contextClassLoader().
loadClass("org.eclipse.core.runtime.FileLocator").getMethod("resolve", URL.class).invoke(null, url));
}
},
代码示例来源:origin: org.reflections/reflections
public Dir createDir(URL url) throws Exception {
return fromURL((URL) ClasspathHelper.contextClassLoader().
loadClass("org.eclipse.core.runtime.FileLocator").getMethod("resolve", URL.class).invoke(null, url));
}
},
代码示例来源:origin: ronmamo/reflections
public Iterator<File> iterator() {
return fromURL(url).getFiles().iterator();
}
}, filePredicate));
代码示例来源:origin: org.reflections/reflections
public Iterator<File> iterator() {
return fromURL(url).getFiles().iterator();
}
}, filePredicate));
代码示例来源:origin: org.reflections/reflections
protected void scan(URL url) {
Vfs.Dir dir = Vfs.fromURL(url);
try {
for (final Vfs.File file : dir.getFiles()) {
// scan if inputs filter accepts file relative path or fqn
Predicate<String> inputsFilter = configuration.getInputsFilter();
String path = file.getRelativePath();
String fqn = path.replace('/', '.');
if (inputsFilter == null || inputsFilter.apply(path) || inputsFilter.apply(fqn)) {
Object classObject = null;
for (Scanner scanner : configuration.getScanners()) {
try {
if (scanner.acceptsInput(path) || scanner.acceptResult(fqn)) {
classObject = scanner.scan(file, classObject);
}
} catch (Exception e) {
if (log != null && log.isDebugEnabled())
log.debug("could not scan file " + file.getRelativePath() + " in url " + url.toExternalForm() + " with scanner " + scanner.getClass().getSimpleName(), e);
}
}
}
}
} finally {
dir.close();
}
}
代码示例来源:origin: ronmamo/reflections
protected void scan(URL url) {
Vfs.Dir dir = Vfs.fromURL(url);
try {
for (final Vfs.File file : dir.getFiles()) {
// scan if inputs filter accepts file relative path or fqn
Predicate<String> inputsFilter = configuration.getInputsFilter();
String path = file.getRelativePath();
String fqn = path.replace('/', '.');
if (inputsFilter == null || inputsFilter.apply(path) || inputsFilter.apply(fqn)) {
Object classObject = null;
for (Scanner scanner : configuration.getScanners()) {
try {
if (scanner.acceptsInput(path) || scanner.acceptsInput(fqn)) {
classObject = scanner.scan(file, classObject);
}
} catch (Exception e) {
if (log != null) {
// SLF4J will filter out Throwables from the format string arguments.
log.debug("could not scan file {} in url {} with scanner {}", file.getRelativePath(), url.toExternalForm(), scanner.getClass().getSimpleName(), e);
}
}
}
}
}
} finally {
dir.close();
}
}
代码示例来源:origin: org.rapidpm/rapidpm-dependencies-core-reflections
public static Dir fromURL(final URL url) {
return fromURL(url , defaultUrlTypes);
}
代码示例来源:origin: ai.h2o/reflections
/** tries to create a Dir from the given url, using the defaultUrlTypes */
public static Dir fromURL(final URL url) {
return fromURL(url, defaultUrlTypes);
}
代码示例来源:origin: ai.h2o/reflections
/** 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));
}
代码示例来源:origin: org.rapidpm/rapidpm-dependencies-core-reflections
public static Dir fromURL(final URL url , final UrlType... urlTypes) {
return fromURL(url , Arrays.asList(urlTypes));
}
代码示例来源:origin: org.rapidpm/rapidpm-dependencies-core-reflections
public Dir createDir(URL url) throws Exception {
return fromURL((URL) ClasspathHelper.contextClassLoader().
loadClass("org.eclipse.core.runtime.FileLocator").getMethod("resolve" , URL.class).invoke(null , url));
}
},
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.reflections
public Dir createDir(URL url) throws Exception {
return fromURL((URL) ClasspathHelper.contextClassLoader().
loadClass("org.eclipse.core.runtime.FileLocator").getMethod("resolve", URL.class).invoke(null, url));
}
},
代码示例来源:origin: ai.h2o/reflections
public Dir createDir(URL url) throws Exception {
return fromURL((URL) ClasspathHelper.contextClassLoader().
loadClass("org.eclipse.core.runtime.FileLocator").getMethod("resolve", URL.class).invoke(null, url));
}
},
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.reflections
public Iterator<File> iterator() {
return fromURL(url).getFiles().iterator();
}
}, filePredicate));
代码示例来源:origin: ai.h2o/reflections
public Iterator<File> iterator() {
return fromURL(url).getFiles().iterator();
}
}, filePredicate));
代码示例来源:origin: org.rapidpm/rapidpm-dependencies-core-reflections
public static Iterable<File> findFiles(final Collection<URL> inUrls , final Predicate<File> filePredicate) {
Iterable<File> result = new ArrayList<>();
for (final URL url : inUrls) {
try {
result = Iterables
.concat(result ,
Iterables.filter(() -> fromURL(url).getFiles().iterator() , filePredicate)
);
} catch (Throwable e) {
final LoggingService log = Logger.getLogger(Reflections.class);
if (log != null) {
log.warning("could not findFiles for url. continuing. [" + url + "]" , e);
}
}
}
return result;
}
内容来源于网络,如有侵权,请联系作者删除!