mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-19 00:01:41 +02:00
*) closing stream correctly
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@293 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
parent
aea355c03c
commit
db3ed75728
|
@ -93,10 +93,23 @@ public abstract class AbstractParser implements Parser{
|
|||
*
|
||||
* @see de.anomic.plasma.parser.Parser#parse(java.net.URL, java.lang.String, byte[])
|
||||
*/
|
||||
public plasmaParserDocument parse(URL location, String mimeType,
|
||||
byte[] source) throws ParserException {
|
||||
ByteArrayInputStream contentInputStream = new ByteArrayInputStream(source);
|
||||
return this.parse(location,mimeType,contentInputStream);
|
||||
public plasmaParserDocument parse(
|
||||
URL location,
|
||||
String mimeType,
|
||||
byte[] source
|
||||
) throws ParserException {
|
||||
ByteArrayInputStream contentInputStream = null;
|
||||
try {
|
||||
contentInputStream = new ByteArrayInputStream(source);
|
||||
return this.parse(location,mimeType,contentInputStream);
|
||||
} finally {
|
||||
if (contentInputStream != null) {
|
||||
try {
|
||||
contentInputStream.close();
|
||||
contentInputStream = null;
|
||||
} catch (Exception e){}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user