Last active
May 31, 2016 02:42
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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