本文整理了Java中org.tinygroup.vfs.VFS
类的一些代码示例,展示了VFS
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。VFS
类的具体详情如下:
包路径:org.tinygroup.vfs.VFS
类名称:VFS
暂无
代码示例来源:origin: org.tinygroup/fileresolver
/**
* 把额外定义的路径,转化为FileObject
*
* @return
*/
private List<FileObject> resolveManualClassPath() {
List<FileObject> classPathFileObjects = new ArrayList<FileObject>();
for (String manualClassPath : manualClassPaths) {
FileObject fileObject = VFS.resolveFile(manualClassPath);
classPathFileObjects.add(fileObject);
allScanningPath.add(manualClassPath);
}
return classPathFileObjects;
}
代码示例来源:origin: org.tinygroup/org.tinygroup.base
private FileObject[] getCurrentFileObjects() {
URL[] urLs = getURLs();
if (fileObjects == null) {
fileObjects = new FileObject[urLs.length];
for (int i = 0; i < urLs.length; i++) {
fileObjects[i] = VFS.resolveURL(urLs[i]);
}
}
return fileObjects;
}
代码示例来源:origin: org.tinygroup/org.tinygroup.trans.xstream
public static void initXStream(String filePath) {
XStream stream = new XStream();
stream.autodetectAnnotations(true);
stream.processAnnotations(new Class[]{XStreamConfiguration.class});
FileObject fileObject = VFS.resolveFile(filePath);
if (!fileObject.isExist() || fileObject == null) {
LOGGER.logMessage(LogLevel.ERROR, "文件:{0}不存在", filePath);
throw new RuntimeException("文件:" + filePath + "不存在");
}
InputStream is = fileObject.getInputStream();
XStreamConfiguration xStreamConfiguration = (XStreamConfiguration) stream
.fromXML(is);
try {
XStreamFactory.parse(xStreamConfiguration);
} catch (Exception e) {
LOGGER.logMessage(LogLevel.ERROR,
"xstream配置文件初始化失败,文件路径:{0},错误信息:{1}", filePath, e);
throw new RuntimeException("xstream配置文件:" + filePath + "初始化失败", e);
} finally {
VFS.closeInputStream(is);
}
}
代码示例来源:origin: org.tinygroup/org.tinygroup.weblayerbase
TinyConfigParamUtil.setReadClient(null);
logger.logMessage(LogLevel.INFO, "WEB 远程配置停止完成。");
VFS.clearCache();
LoggerFactory.clearAllLoggers();
LoaderManager.clear();
代码示例来源:origin: org.tinygroup/org.tinygroup.trans.xstream.base
public static void initXStreamSceneMapping(String filePath) {
XStream stream = new XStream();
stream.autodetectAnnotations(true);
stream.processAnnotations(new Class[]{XStreamSceneMappings.class});
stream.setClassLoader(XStreamTransManager.class.getClassLoader());
FileObject fileObject = VFS.resolveFile(filePath);
if (!fileObject.isExist() || fileObject == null) {
LOGGER.logMessage(LogLevel.ERROR, "文件:{0}不存在", filePath);
throw new RuntimeException("文件:" + filePath + "不存在");
}
InputStream is = fileObject.getInputStream();
XStreamSceneMappings mappings = (XStreamSceneMappings) stream
.fromXML(is);
VFS.closeInputStream(is);
List<XStreamSceneMapping> sceneMappings = mappings.getSceneMappings();
for (XStreamSceneMapping mapping : sceneMappings) {
putSceneName(mapping.getScene(), mapping.getXstreamPackageName());
}
}
}
代码示例来源:origin: org.tinygroup/org.tinygroup.flowbasiccomponent
public static boolean existsFile(String filePath) {
FileObject fileObject = VFS.resolveFile(filePath);
if (fileObject.isExist()) {
return true;
}
return false;
}
代码示例来源:origin: org.tinygroup/org.tinygroup.tinydb
stream.processAnnotations(DialectFunctions.class);
if (url != null && resource == null) {
FileObject fileObject = VFS.resolveFile(url);
InputStream is = fileObject.getInputStream();
DialectFunctions functions = (DialectFunctions) stream
.fromXML(is);
configuration.addDialectFunctions(functions);
VFS.closeInputStream(is);
} else if (url == null && resource != null) {
InputStream inputStream = getClass().getClassLoader()
代码示例来源:origin: org.tinygroup/org.tinygroup.bundle
/**
* 返回当前TinyClassLoader中包含Jar包对应的FileObject数组
*
* @return
*/
public FileObject[] getFileObjects() {
URL[] urLs = getURLs();
if (fileObjects == null) {
fileObjects = new FileObject[urLs.length];
for (int i = 0; i < urLs.length; i++) {
fileObjects[i] = VFS.resolveURL(urLs[i]);
}
}
return fileObjects;
}
代码示例来源:origin: org.tinygroup/org.tinygroup.docgen
public void generate(String path, Context context, OutputStream writer) {
try {
FileObject fileObject = VFS.resolveFile(path);
generate(fileObject, context, writer);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
代码示例来源:origin: org.tinygroup/org.tinygroup.tinydb
stream.processAnnotations(BeanQueryConfigs.class);
if (url != null && resource == null) {
FileObject fileObject = VFS.resolveFile(url);
InputStream is = fileObject.getInputStream();
BeanQueryConfigs queryConfigs = (BeanQueryConfigs) stream
.fromXML(is);
configuration.addBeanQueryConfigs(queryConfigs);
VFS.closeInputStream(is);
} else if (url == null && resource != null) {
InputStream inputStream = getClass().getClassLoader()
代码示例来源:origin: org.tinygroup/fileresolver
public void addSearchPath(String searchPath) {
searchPathList.add(searchPath);
FileObject fileObject = VFS.resolveFile(searchPath);
addFileObject(fileObject);
}
代码示例来源:origin: org.tinygroup/org.tinygroup.tinydb
stream.processAnnotations(Relations.class);
if (url != null && resource == null) {
FileObject fileObject = VFS.resolveFile(url);
InputStream is = fileObject.getInputStream();
Relations relations = (Relations) stream.fromXML(is);
configuration.addRelationConfigs(relations);
VFS.closeInputStream(is);
} else if (url == null && resource != null) {
InputStream inputStream = getClass().getClassLoader()
代码示例来源:origin: org.tinygroup/org.tinygroup.fileindexsource
public List<Document> getDocument(final String type, final File file,
final Object... arguments) {
final FileObject data = VFS.resolveFile(file.getAbsolutePath());
return super.getDocument(type, data, arguments);
}
代码示例来源:origin: org.tinygroup/org.tinygroup.fileresolver
public void addSearchPath(String searchPath) {
FileObject fileObject = VFS.resolveFile(searchPath);
searchPathMap.put(searchPath, fileObject);
addFileObject(fileObject);
}
代码示例来源:origin: org.tinygroup/org.tinygroup.fileresolver
public void addResolvePath(List<String> paths) {
for (String path : paths) {
addResolveFileObject(VFS.resolveFile(path));
}
}
代码示例来源:origin: org.tinygroup/mdatool
/**
* 为指定路径的模型文件或指定目录下的模型文件进行处理 为其中需要快速生成默认操作和视图的模型进行处理
*
* @param path
*/
public void find(String findPath, String findModelName) {
this.modelName = findModelName;
FileObject file = VFS.resolveFile(findPath);
resolve(file);
}
代码示例来源:origin: org.tinygroup/org.tinygroup.fileresolver
public void addResolvePath(String path) {
addResolveFileObject(VFS.resolveFile(path));
}
代码示例来源:origin: org.tinygroup/fileresolver
public FileObject getClassesPath() {
return VFS.resolveFile(ClassPathUtil.getClassRootPath());
}
代码示例来源:origin: org.tinygroup/fileresolver
/**
* 把系统变量中定义的classpath路径,转化为FileObject对象,并返回FileObject列表
*
* @return
*/
private List<FileObject> getClassPath() {
List<FileObject> classPathFileObjects = new ArrayList<FileObject>();
String classPathProperty = System.getProperties().get("java.class.path").toString();
String[] classPaths = classPathProperty.split(";");
for (String classPath : classPaths) {
if (classPath.length() > 0) {
FileObject fileObject = VFS.resolveFile(classPath);
classPathFileObjects.add(fileObject);
allScanningPath.add(classPath);
}
}
return classPathFileObjects;
}
代码示例来源:origin: org.tinygroup/org.tinygroup.fileresolver
public FileObject getRootFileObject(String path) {
String fullPath = getFileObject(path).getAbsolutePath();
return VFS.resolveFile(fullPath.substring(0,
fullPath.length() - path.length() + 1));
}
内容来源于网络,如有侵权,请联系作者删除!