示例#1
0
  /**
   * Recupera o InputStream de um arquivo.
   *
   * @param path uma String contendo o caminho para o arquivo
   * @return um InputStream contendo o InputStream do arquivo
   * @throws FileNotFoundException
   */
  private static InputStream getInputStream(String path) throws FileNotFoundException {

    PropertiesUtil util = new PropertiesUtil();

    if (util.getClass().getResourceAsStream(path) != null) {
      return util.getClass().getResourceAsStream(path);
    } else {
      return new FileInputStream(path);
    }
  }