Polishing
This commit is contained in:
parent
31fa1569c5
commit
5721c747b2
|
|
@ -130,8 +130,7 @@ public abstract class PropertiesLoaderUtils {
|
||||||
* @throws IOException if loading failed
|
* @throws IOException if loading failed
|
||||||
*/
|
*/
|
||||||
public static void fillProperties(Properties props, Resource resource) throws IOException {
|
public static void fillProperties(Properties props, Resource resource) throws IOException {
|
||||||
InputStream is = resource.getInputStream();
|
try (InputStream is = resource.getInputStream()) {
|
||||||
try {
|
|
||||||
String filename = resource.getFilename();
|
String filename = resource.getFilename();
|
||||||
if (filename != null && filename.endsWith(XML_FILE_EXTENSION)) {
|
if (filename != null && filename.endsWith(XML_FILE_EXTENSION)) {
|
||||||
props.loadFromXML(is);
|
props.loadFromXML(is);
|
||||||
|
|
@ -140,9 +139,6 @@ public abstract class PropertiesLoaderUtils {
|
||||||
props.load(is);
|
props.load(is);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally {
|
|
||||||
is.close();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue