Skip to content

Instantly share code, notes, and snippets.

@eliasnogueira
Last active May 31, 2016 02:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eliasnogueira/379e760361bcda14a1aadb45b338fc1f to your computer and use it in GitHub Desktop.
Save eliasnogueira/379e760361bcda14a1aadb45b338fc1f to your computer and use it in GitHub Desktop.
Método para ler um nome de propriedade e retornar o seu valor
public static String lerPropriedade(String nomePropriedade) {
String valorPropriedade = null;
try {
Properties properties = new Properties();
properties.load(new FileInputStream("src/test/resources/config.properties"));
valorPropriedade = properties.getProperty(nomePropriedade);
} catch (Exception e) {
e.printStackTrace();
}
return valorPropriedade;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment