Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
3.1.1
-
None
-
Windows XP, JDK 5.0
Description
In the org.apache.servicemix.components.file.FilePoller#processFile(File) it is possible that allocated file would leak. Now, it goes like:
protected void processFile(File aFile) throws Exception
{ String name = aFile.getCanonicalPath(); InputStream in = new BufferedInputStream(new FileInputStream(aFile)); InOnly exchange = getExchangeFactory().createInOnlyExchange(); NormalizedMessage message = exchange.createMessage(); exchange.setInMessage(message); marshaler.readMessage(exchange, message, in, name); getDeliveryChannel().sendSync(exchange); in.close(); }But, we should properly clean-up in the case of exception thrown before in.close(). Thus, should be:
protected void processFile(File aFile) throws Exception {
InputStream in = null;
try
finally {
if (in != null)
}
}