Make sure we close our stream.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2722 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -26,6 +26,8 @@ import java.security.AccessControlException;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.samskivert.io.StreamUtil;
|
||||||
|
|
||||||
import static com.samskivert.Log.log;
|
import static com.samskivert.Log.log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -425,28 +427,29 @@ public class ConfigUtil
|
|||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
InputStream input = sourceURL.openStream();
|
InputStream input = sourceURL.openStream();
|
||||||
BufferedReader bin = new BufferedReader(new InputStreamReader(input));
|
try {
|
||||||
PropRecord record = new PropRecord(path, sourceURL);
|
BufferedReader bin = new BufferedReader(new InputStreamReader(input));
|
||||||
boolean started = false;
|
PropRecord record = new PropRecord(path, sourceURL);
|
||||||
String line;
|
boolean started = false;
|
||||||
|
String line;
|
||||||
while ((line = bin.readLine()) != null) {
|
while ((line = bin.readLine()) != null) {
|
||||||
if (line.startsWith(PACKAGE_KEY)) {
|
if (line.startsWith(PACKAGE_KEY)) {
|
||||||
record._package = parseValue(line);
|
record._package = parseValue(line);
|
||||||
started = true;
|
started = true;
|
||||||
} else if (line.startsWith(EXTENDS_KEY)) {
|
} else if (line.startsWith(EXTENDS_KEY)) {
|
||||||
record._extends = parseValue(line);
|
record._extends = parseValue(line);
|
||||||
started = true;
|
started = true;
|
||||||
} else if (line.startsWith(OVERRIDES_KEY)) {
|
} else if (line.startsWith(OVERRIDES_KEY)) {
|
||||||
record._overrides = parseValues(line);
|
record._overrides = parseValues(line);
|
||||||
started = true;
|
started = true;
|
||||||
} else if (started) {
|
} else if (started) {
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return record;
|
||||||
|
} finally {
|
||||||
|
StreamUtil.close(input);
|
||||||
}
|
}
|
||||||
input.close();
|
|
||||||
|
|
||||||
return record;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@link #parseMetaData} helper function. */
|
/** {@link #parseMetaData} helper function. */
|
||||||
|
|||||||
Reference in New Issue
Block a user