Dolda2000 GitWeb
/
kaka
/
cakelight.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Always return a configuration
[kaka/cakelight.git]
/
src
/
kaka
/
cakelight
/
Configuration.java
diff --git
a/src/kaka/cakelight/Configuration.java
b/src/kaka/cakelight/Configuration.java
index
4a6a6a6
..
4f1525c
100644
(file)
--- a/
src/kaka/cakelight/Configuration.java
+++ b/
src/kaka/cakelight/Configuration.java
@@
-21,24
+21,13
@@
public class Configuration {
}
public static Configuration from(String propertiesFile) {
}
public static Configuration from(String propertiesFile) {
- InputStream input = null;
- try {
- input = new FileInputStream(propertiesFile);
- Properties prop = new Properties();
+ Properties prop = new Properties();
+ try (InputStream input = new FileInputStream(propertiesFile)) {
prop.load(input);
prop.load(input);
- return new Configuration(prop);
} catch (IOException ex) {
ex.printStackTrace();
} catch (IOException ex) {
ex.printStackTrace();
- } finally {
- if (input != null) {
- try {
- input.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
}
}
- return n
ull
;
+ return n
ew Configuration(prop)
;
}
private String get(Properties prop, String name) {
}
private String get(Properties prop, String name) {