mirror of https://github.com/apache/nifi.git
NIFI-3677 - ExtractMediaMetadata should close TikaInputStream
* Added finally block to close TikaInputStream. Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com> This closes #1993.
This commit is contained in:
parent
58fc5f24b8
commit
325fe53fa1
|
@ -210,7 +210,11 @@ public class ExtractMediaMetadata extends AbstractProcessor {
|
|||
Integer maxAttribLen) throws IOException, TikaException, SAXException {
|
||||
final Metadata metadata = new Metadata();
|
||||
final TikaInputStream tikaInputStream = TikaInputStream.get(sourceStream);
|
||||
try {
|
||||
autoDetectParser.parse(tikaInputStream, new DefaultHandler(), metadata);
|
||||
} finally {
|
||||
tikaInputStream.close();
|
||||
}
|
||||
|
||||
final Map<String, String> results = new HashMap<>();
|
||||
final Pattern metadataKeyFilter = metadataKeyFilterRef.get();
|
||||
|
|
Loading…
Reference in New Issue