Subversion Repositories Integrator Subversion

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 espaco 1
package br.edu.cesmac.sic.core.domain.util;
2
 
3
import java.io.FileNotFoundException;
4
import java.io.IOException;
5
import java.io.InputStream;
6
import java.util.Properties;
7
 
8
public class PropertiesUtil {
9
 
10
        private Properties property;
11
 
12
        public PropertiesUtil (String arquivo) throws FileNotFoundException, IOException {
13
                criarProperty(arquivo);
14
        }
15
 
16
        public String retornarPropriedadeDoArquivo(String propriedade) throws IOException {
17
                return  property.getProperty(propriedade);
18
        }
19
 
20
        private void criarProperty(String arquivo) throws FileNotFoundException, IOException {
21
                property = new Properties();
22
                InputStream input = getClass().getResourceAsStream(arquivo);
23
                property.load(input);
24
        }
25
 
26
}