Java 类org.reflections.vfs.SystemDir 实例源码
项目:reflections
文件:VfsTest.java
@Test
public void vfsFromDirWithJarInName() throws MalformedURLException {
String tmpFolder = System.getProperty("java.io.tmpdir");
tmpFolder = tmpFolder.endsWith(File.separator) ? tmpFolder : tmpFolder + File.separator;
String dirWithJarInName = tmpFolder + "tony.jarvis";
File newDir = new File(dirWithJarInName);
newDir.mkdir();
try {
Vfs.Dir dir = Vfs.fromURL(new URL(format("file:{0}", dirWithJarInName)));
assertEquals(dirWithJarInName, dir.getPath());
assertEquals(SystemDir.class, dir.getClass());
} finally {
newDir.delete();
}
}
项目:FinanceAnalytics
文件:OpenGammaFudgeContext.java
@Override
public Dir createDir(URL url) throws Exception {
File file = Vfs.getFile(url);
if (file == null || file.exists() == false) {
s_logger.warn("URL could not be resolved to a file: " + url);
return new EmptyDir(file);
} else {
return new SystemDir(file);
}
}
项目:motech
文件:DoubleEncodedDirUrlType.java
@Override
public Vfs.Dir createDir(URL url) {
return new SystemDir(FileUtils.toFile(fixURL(url)));
}