com.mhavila.cookbook.properties
Class RecipeProperties
java.lang.Object
com.mhavila.cookbook.properties.RecipeProperties
public class RecipeProperties
- extends Object
Receita:
Localizar e ler um arquivo de propriedades e obter uma propriedade.
- Exemplo de código:
String arquivo = "arquivo.properties";
InputStream in = EstaClasse.getClassResource(EstaClasse.class, arquivo);
Properties props = new Properties();
props.load(in);
in.close();
String nome = "nome.da.propriedade";
String valor = props.getProperty(nome);
Referências:
- Author:
- Márcio d'Ávila (www.mhavila.com)
- See Also:
Properties,
Properties.load(java.io.InputStream)
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RecipeProperties
public RecipeProperties()
loadProperties
public static Properties loadProperties(InputStream in)
main
public static void main(String[] args)