You could get that behaviour if the file doesn't exist.
Also I've had issues on UNC paths when the file server is heavily loaded:
file.list() may return null when normally is only returns null if the directory
doesn't exist.
Also if you have two threads accessing doing the following with a UNC path:
if(!folder.exists()) {
created = folder.mkdir()
if(!created) throw new Exception();
}
then you have a race condition an often one thread with see the folder does not
exist, and will then fail to create it because the other thread created it
first.
So in summary:
1) is the file server under heavy load
2) do you have multiple file watchers working on the same folder?
David
On 9 Mar 2010, at 09:48, Claus Ibsen wrote:
Well
the JDK do not think the java.io.File is either a directory or a file
:) Hence what is the file really?
for (File file : files) {
// creates a generic file
GenericFile<File> gf = asGenericFile(endpointPath, file);
if (file.isDirectory()) {
if (endpoint.isRecursive() && isValidFile(gf, true)) {
// recursive scan and add the sub files and folders
String subDirectory = fileName + File.separator +
file.getName();
pollDirectory(subDirectory, fileList);
}
} else if (file.isFile()) {
if (isValidFile(gf, false)) {
if (isInProgress(gf)) {
if (log.isTraceEnabled()) {
log.trace("Skipping as file is already in
progress: " + gf.getFileName());
}
} else {
// matched file so add
fileList.add(gf);
}
}
} else {
log.debug("Ignoring unsupported file type for file: " + file);
}
On Tue, Mar 9, 2010 at 10:43 AM, titexe <[email protected]> wrote:
>
> Hello,
>
> I have a problem with file component : I receive this message in the log for
> each file :
>
> Ignoring for unsupported file type file: \\Laptop\testing\OUT\bvbvb.xml
>
> below my route :
>
> <route streamCache="true" errorHandlerRef="myDeadLetterChannel">
> <from
> uri="file:///\\Laptop\testing\OUT?recursive=true&readLock=changed&autoCreate=true&move=\\Laptop\testing\OUT\Process\&moveFailed=\\Laptop\testing\OUT\Fail\&maxMessagesPerPoll=5&filter=#myAntFilter"/>
>
> <convertBodyTo type="java.lang.String"/>
> <process ref="RemoveBomProcessor"/>
> <to uri="activemq:queue:IN"/>
> </route>
>
> <bean id="myAntFilter"
> class="org.apache.camel.component.file.AntPathMatcherGenericFileFilter">
> <property name="includes" value="**"/>
> <property name="excludes" value="**/Process/**, **/Fail/**"/>
> </bean>
>
> someone has an idea for this problem ? Thanks in advance,
>
> Version of Camel : 2.1
>
> Best regards,
>
> titexe
> --
> View this message in context:
> http://old.nabble.com/File-Consumer-%3A-Ignoring-file-tp27833411p27833411.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