IT-KIMI_SHI\SINOIT.KIMI
2018-06-01 521993214708c66a5498bd669c94a661c11484b2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package frame.data.reader;
 
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;
 
import frame.data.Variant;
 
public class PropertyReader {
 
    private File file;
    private Properties properties;
    
    public PropertyReader(File file) throws IOException {
        this.file = file;
        load();
    }
 
    public Variant get(String name) {
        String value = properties.getProperty(name);
        return new Variant(value);
    }
    
    private void load() throws IOException {
        properties = new Properties();
        
        FileInputStream inputStream = new FileInputStream(file);
        try {
            properties.load(inputStream);
        }
        finally {
            inputStream.close();
        }
    }
}