Skip to content

Commit

Permalink
Properties loading
Browse files Browse the repository at this point in the history
  • Loading branch information
witek committed Apr 8, 2015
1 parent ac22c9c commit e2b0a98
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/java/ilarkesto/io/IO.java
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,14 @@ public static byte[] loadResource(String name) {
*/
public static Properties loadPropertiesFromClasspath(String filename) {
Properties p = new Properties();
InputStream in = IO.class.getResourceAsStream("/" + filename);
InputStream is = IO.class.getResourceAsStream("/" + filename);
if (is == null) return null;
InputStreamReader in;
try {
in = new InputStreamReader(is, IO.UTF_8);
} catch (UnsupportedEncodingException ex1) {
throw new RuntimeException(ex1);
}
try {
p.load(in);
} catch (IOException ex) {
Expand Down

0 comments on commit e2b0a98

Please sign in to comment.