Example #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);
    }
  }
Example #2
0
  /**
   * Método que carrega o atributo Properties com as constantes do arquivo de propriedades.
   *
   * @return As propriedades do arquivo de propriedades do sistema.
   */
  private static Properties carregar() {

    Properties properties = null;

    try {
      properties = PropertiesUtil.getProperties(PATH_PROPERTIES);
    } catch (Throwable e) {
      UnimedLogger.error(e.getMessage(), e);
    }

    return properties;
  }