org.tinygroup.vfs.VFS.closeInputStream()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(102)

本文整理了Java中org.tinygroup.vfs.VFS.closeInputStream()方法的一些代码示例,展示了VFS.closeInputStream()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。VFS.closeInputStream()方法的具体详情如下:
包路径:org.tinygroup.vfs.VFS
类名称:VFS
方法名:closeInputStream

VFS.closeInputStream介绍

暂无

代码示例

代码示例来源: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.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.tinydb

.fromXML(is);
  configuration.addDialectFunctions(functions);
  VFS.closeInputStream(is);
} else if (url == null && resource != null) {
  InputStream inputStream = getClass().getClassLoader()

代码示例来源:origin: org.tinygroup/org.tinygroup.tinydb

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.tinydb

.fromXML(is);
  configuration.addBeanQueryConfigs(queryConfigs);
  VFS.closeInputStream(is);
} else if (url == null && resource != null) {
  InputStream inputStream = getClass().getClassLoader()

相关文章