-
Notifications
You must be signed in to change notification settings - Fork 572
Expand file tree
/
Copy pathReadProperty.java
More file actions
32 lines (27 loc) · 908 Bytes
/
ReadProperty.java
File metadata and controls
32 lines (27 loc) · 908 Bytes
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
package utils;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
public class ReadProperty {
private Properties propertyLoad;
public Properties readPropertyFile(final String pFileName) {
InputStream fileSource = null;
try {
fileSource = this.getClass().getResourceAsStream("/resources/"+pFileName);
propertyLoad = new Properties();
propertyLoad.load(fileSource);
} catch (IOException e) {
e.printStackTrace();
}
finally {
if(fileSource!=null) {
try {
fileSource.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return propertyLoad;
}
}