I think I found the issue:

org.apache.camel.component.file.GenericFileConverter:

88   Reader reader = genericFileToReader(file, exchange);
89   // we dont want a reader back, so use the type converter registry to
find a suitable converter
90   TypeConverter readerTc = registry.lookup(type, Reader.class);
91   if (readerTc != null) {
92       // use the reader based type converter
93       return readerTc.convertTo(type, exchange, reader);
94   }

If you have a look into the "genericFileToReader()" method you can see that
it returns null, if the file doesn't exist. In this case, in line 93 the
type converter (IOConverter in this case) is called which will fail

IOConverter:
259    @Converter
260    public static byte[] toByteArray(Reader reader, Exchange exchange)
throws IOException {
261        return toByteArray(IOHelper.buffered(reader), exchange);
262    }

IOHelper
116    public static BufferedReader buffered(Reader reader) {
117        ObjectHelper.notNull(reader, "reader");
118        return (reader instanceof BufferedReader) ?
(BufferedReader)reader : new BufferedReader(reader);
119    }

Is it possible the file doesn't exist anymore if Camel tries to read it?

Best,
Christian

On Wed, Nov 7, 2012 at 11:15 AM, Leandro Franchi
<leandro.fran...@gmail.com>wrote:

> switchFileFrontendCounterProce**ssor
>

Reply via email to