private static InputStream getResourceAsStream(String path) throws IOException {
    if (StringUtils.isEmpty(path)) {
      return null;
    }

    // first try to load as file
    File file = new File(path);
    if (file.exists() && file.isFile()) {
      return new FileInputStream(file);
    }

    // if not a file fallback to classloader resource
    return CertificateLoader.class.getResourceAsStream(path);
  }
private static InputStream getResourceAsStream ( String path ) throws IOException { if ( StringUtils . isEmpty ( path ) ) { return null ; } File file = new File ( path ) ; if ( file . exists ( ) && file . isFile ( ) ) { return new FileInputStream ( file ) ; } return CertificateLoader . class . getResourceAsStream ( path ) ; }
Tries to load the given resource as file, or if no file exists as classpath resource.
@param path Filesystem or classpath path
@return InputStream or null if neither file nor classpath resource is found
@throws IOException