Details
Description
When using the fileUrl header to detect a file on localdisk the java process does not release the file handle.
When the detected file is deleted, the disk space is not released because of the open file handle.
Test
curl -X PUT -H "fileUrl: file:///root/test.pdf" http://localhost:9998/detect/stream
rm /root/test.pdf
lsof of (pid of java tika-server)--
file handle open to /root/test.pdf (deleted)
As a test fix tika-server/src/main/java/org/apache/tika/server/resource/DetectorResource.java was modified to add
try
{ tis.close(); }catch (Exception e) {}
to the finally blcok in public detect and the problem seemed to be resolved.