org.apache.cxf.jaxrs.utils.ResourceUtils.getClasspathResourceStream()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(126)

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

ResourceUtils.getClasspathResourceStream介绍

暂无

代码示例

代码示例来源:origin: apache/cxf

protected Properties getSwaggerProperties(Bus bus) {
  InputStream is = ResourceUtils.getClasspathResourceStream(propertiesLocation,
                       AbstractSwaggerFeature.class,
                       bus);
  Properties props = null;
  if (is != null) {
    props = new Properties();
    try {
      props.load(is);
    } catch (IOException ex) {
      props = null;
    } finally {
      try {
        is.close();
      } catch (IOException ignore) {
        // ignore
      }
    }
  }
  return props;
}
protected void initBeanConfig(BeanConfig beanConfig, Properties props) {

代码示例来源:origin: apache/cxf

/**
   * Read the Swagger-specific properties from the property file (to seamlessly
   * support the migration from older Swagger features).
   * @param location property file location
   * @param bus bus instance
   * @return the properties if available 
   */
  default Properties getSwaggerProperties(String location, Bus bus) {
    InputStream is = ResourceUtils.getClasspathResourceStream(location, SwaggerProperties.class, bus);
    Properties props = null;
    
    if (is != null) {
      props = new Properties();
      try {
        props.load(is);
      } catch (IOException ex) {
        props = null;
      } finally {
        try {
          is.close();
        } catch (IOException ignore) {
          // ignore
        }
      }
    }

    return props;
  }
}

代码示例来源:origin: org.apache.cxf/cxf-rt-rs-service-description-openapi-v3

/**
   * Read the Swagger-specific properties from the property file (to seamlessly
   * support the migration from older Swagger features).
   * @param location property file location
   * @param bus bus instance
   * @return the properties if available 
   */
  default Properties getSwaggerProperties(String location, Bus bus) {
    InputStream is = ResourceUtils.getClasspathResourceStream(location, SwaggerProperties.class, bus);
    Properties props = null;
    
    if (is != null) {
      props = new Properties();
      try {
        props.load(is);
      } catch (IOException ex) {
        props = null;
      } finally {
        try {
          is.close();
        } catch (IOException ignore) {
          // ignore
        }
      }
    }

    return props;
  }
}

代码示例来源:origin: apache/cxf

if (d.docuri().startsWith(CLASSPATH_PREFIX)) {
  String path = d.docuri().substring(CLASSPATH_PREFIX.length());
  is = ResourceUtils.getClasspathResourceStream(path, SchemaHandler.class,
    bus == null ? BusFactory.getDefaultBus() : bus);
  if (is != null) {

代码示例来源:origin: org.apache.cxf/cxf-rt-rs-service-description

if (d.docuri().startsWith(CLASSPATH_PREFIX)) {
  String path = d.docuri().substring(CLASSPATH_PREFIX.length());
  is = ResourceUtils.getClasspathResourceStream(path, SchemaHandler.class,
    bus == null ? BusFactory.getDefaultBus() : bus);
  if (is != null) {

代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs

if (d.docuri().startsWith(CLASSPATH_PREFIX)) {
  String path = d.docuri().substring(CLASSPATH_PREFIX.length());
  is = ResourceUtils.getClasspathResourceStream(path, SchemaHandler.class,
    bus == null ? BusFactory.getDefaultBus() : bus);
  if (is != null) {

代码示例来源:origin: com.tomitribe.tribestream/tribestream-container

if (d.docuri().startsWith(CLASSPATH_PREFIX)) {
  final String path = d.docuri().substring(CLASSPATH_PREFIX.length());
  is = ResourceUtils.getClasspathResourceStream(path, SchemaHandler.class,
      BusFactory.getDefaultBus());
  if (is != null) {

相关文章

微信公众号

最新文章

更多