On Sat, Dec 19, 2009 at 7:59 PM, sjmcduf <[email protected]> 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 ?
>

Thanks for spotting. Yeah its a bug. Will get that fixed.

Do you use Windows by any chance?



> Thank you
> (CAMEL 2.1.0)
> --
> View this message in context: 
> http://old.nabble.com/Problem-with-JMS-and-file-tp26857645p26857645.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Reply via email to