Hi,
Hmm, It certainly looks like a bug. I would raise a JIRA issue and submit a
patch. Also, your recommended fix is pretty solid.
I am sure the committers will be happy to pick up on this one :)
Cheers,
Ashwin...
sjmcduf wrote:
>
> I tried to do something very simple:
> from("file://" + inputDirectory +
> "?recursive=true&readLock=none&delete=true").to("activemq:queue:QUEUE);
>
> I received many error message saying that the file cannot be deleted.
>
> After some investigation, it seems the file is still open...
>
> I found out the following in IOConverter:(used by the JMS when sending to
> the queue)
>
> @Converter
> 175 public static byte[] toByteArray(File file) throws IOException {
>
> 176 return toBytes(toInputStream(file));
>
> 177 }
>
>
> If I do the following, it works as expected:
> @Converter
> public static byte[] toByteArray(File file) throws IOException
> {
> InputStream inputStream = toInputStream(file);
> try
> {
> return toBytes(inputStream);
> }
> finally
> {
> inputStream.close();
> }
> }
>
>
> Is this a bug ?
>
> Thank you
> (CAMEL 2.1.0)
>
-----
---
Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence
Progress Software Corporation
14 Oak Park Drive
Bedford, MA 01730
---
+1-972-304-9084 (Office)
+1-972-971-1700 (Mobile)
----
Blog: http://opensourceknowledge.blogspot.com/
--
View this message in context:
http://old.nabble.com/Problem-with-JMS-and-file-tp26857645p26860747.html
Sent from the Camel - Users mailing list archive at Nabble.com.