You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by titexe <ti...@yahoo.Fr> on 2010/03/09 10:43:19 UTC
File Consumer : Ignoring file
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.
Re: File Consumer : Ignoring file
Posted by David Roussel <na...@diroussel.xsmail.com>.
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 <ti...@yahoo.fr> 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
Re: File Consumer : Ignoring file
Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Mar 9, 2010 at 11:41 AM, titexe <ti...@yahoo.fr> wrote:
>
> I have tested this method : and it's OK :
>
> below the class :
>
> public class File {
>
> public static void main(String[] args)
> {
> java.io.File file = new java.io.File("\\\\dcfr\\fabb\\test");
>
> System.out.println(file.getName());
>
> System.out.println(file.isDirectory());
> System.out.println(file.isFile());
> }
> }
>
> and below the result :
>
> test
> true
> false
>
Okay so it can see that this is a directory which I also assume it is.
Now try with a file, eg like that brb.xml file.
>
>
>
>
> Claus Ibsen-2 wrote:
>>
>> On Tue, Mar 9, 2010 at 11:11 AM, titexe <ti...@yahoo.fr> wrote:
>>>
>>> Thank you for your reply
>>>
>>> I only used a UNC network instead of a local path like (c: \ eg)
>>>
>>> it is this the source of the problème?
>>>
>>
>> Yeah I think so. I recon Windows cannot detect properly if its a file
>> on UNC share?
>>
>> Can you try a test by creating a java.io.File with that UNC file and
>> then do a system out for the various methods the file has?
>>
>> File file = new File(" the UNC file");
>> System.out.println(file.getName());
>>
>> System.out.println(file.isDirectory());
>> System.out.println(file.isFile());
>> // and all the others
>>
>> Then do the same with a file on your local hard disk.
>> Then we can use that to compare and see if its something we can work
>> around in Camel.
>>
>>
>>
>>
>>> best regards,
>>>
>>> titexe
>>>
>>>
>>> Claus Ibsen-2 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 <ti...@yahoo.fr> 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
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://old.nabble.com/File-Consumer-%3A-Ignoring-file-tp27833411p27833695.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
>>
>>
>
> --
> View this message in context: http://old.nabble.com/File-Consumer-%3A-Ignoring-file-tp27833411p27833975.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
Re: File Consumer : Ignoring file
Posted by titexe <ti...@yahoo.Fr>.
I have tested this method : and it's OK :
below the class :
public class File {
public static void main(String[] args)
{
java.io.File file = new java.io.File("\\\\dcfr\\fabb\\test");
System.out.println(file.getName());
System.out.println(file.isDirectory());
System.out.println(file.isFile());
}
}
and below the result :
test
true
false
Claus Ibsen-2 wrote:
>
> On Tue, Mar 9, 2010 at 11:11 AM, titexe <ti...@yahoo.fr> wrote:
>>
>> Thank you for your reply
>>
>> I only used a UNC network instead of a local path like (c: \ eg)
>>
>> it is this the source of the problème?
>>
>
> Yeah I think so. I recon Windows cannot detect properly if its a file
> on UNC share?
>
> Can you try a test by creating a java.io.File with that UNC file and
> then do a system out for the various methods the file has?
>
> File file = new File(" the UNC file");
> System.out.println(file.getName());
>
> System.out.println(file.isDirectory());
> System.out.println(file.isFile());
> // and all the others
>
> Then do the same with a file on your local hard disk.
> Then we can use that to compare and see if its something we can work
> around in Camel.
>
>
>
>
>> best regards,
>>
>> titexe
>>
>>
>> Claus Ibsen-2 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 <ti...@yahoo.fr> 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
>>>
>>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/File-Consumer-%3A-Ignoring-file-tp27833411p27833695.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
>
>
--
View this message in context: http://old.nabble.com/File-Consumer-%3A-Ignoring-file-tp27833411p27833975.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: File Consumer : Ignoring file
Posted by titexe <ti...@yahoo.Fr>.
I froget it :), below the result for file test :
Class Java :
public class File {
public static void main(String[] args)
{
java.io.File file = new
java.io.File("\\\\laptop\\testing\\OUT\\test.txt");
System.out.println(file.getName());
System.out.println(file.isDirectory());
System.out.println(file.isFile());
}
}
Result :
test.txt
false
true
thank you
Claus Ibsen-2 wrote:
>
> Hi
>
> You have to test with a file also!
>
>
> On Tue, Mar 9, 2010 at 11:44 AM, titexe <ti...@yahoo.fr> wrote:
>>
>> I have tested this method, and it's OK :
>>
>> below the class :
>>
>> public class File {
>>
>> public static void main(String[] args)
>> {
>> java.io.File file = new
>> java.io.File("\\\\laptop\\testing\\OUT");
>>
>> System.out.println("filename : " + file.getName());
>>
>> System.out.println(file.isDirectory());
>> System.out.println(file.isFile());
>> }
>> }
>>
>> Below the result :
>>
>> OUT
>> true
>> false
>>
>>
>>
>> Claus Ibsen-2 wrote:
>>>
>>> On Tue, Mar 9, 2010 at 11:11 AM, titexe <ti...@yahoo.fr> wrote:
>>>>
>>>> Thank you for your reply
>>>>
>>>> I only used a UNC network instead of a local path like (c: \ eg)
>>>>
>>>> it is this the source of the problème?
>>>>
>>>
>>> Yeah I think so. I recon Windows cannot detect properly if its a file
>>> on UNC share?
>>>
>>> Can you try a test by creating a java.io.File with that UNC file and
>>> then do a system out for the various methods the file has?
>>>
>>> File file = new File(" the UNC file");
>>> System.out.println(file.getName());
>>>
>>> System.out.println(file.isDirectory());
>>> System.out.println(file.isFile());
>>> // and all the others
>>>
>>> Then do the same with a file on your local hard disk.
>>> Then we can use that to compare and see if its something we can work
>>> around in Camel.
>>>
>>>
>>>
>>>
>>>> best regards,
>>>>
>>>> titexe
>>>>
>>>>
>>>> Claus Ibsen-2 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 <ti...@yahoo.fr> 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
>>>>>
>>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://old.nabble.com/File-Consumer-%3A-Ignoring-file-tp27833411p27833695.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
>>>
>>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/File-Consumer-%3A-Ignoring-file-tp27833411p27834007.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
>
>
--
View this message in context: http://old.nabble.com/File-Consumer-%3A-Ignoring-file-tp27833411p27835381.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: File Consumer : Ignoring file
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
You have to test with a file also!
On Tue, Mar 9, 2010 at 11:44 AM, titexe <ti...@yahoo.fr> wrote:
>
> I have tested this method, and it's OK :
>
> below the class :
>
> public class File {
>
> public static void main(String[] args)
> {
> java.io.File file = new java.io.File("\\\\laptop\\testing\\OUT");
>
> System.out.println("filename : " + file.getName());
>
> System.out.println(file.isDirectory());
> System.out.println(file.isFile());
> }
> }
>
> Below the result :
>
> OUT
> true
> false
>
>
>
> Claus Ibsen-2 wrote:
>>
>> On Tue, Mar 9, 2010 at 11:11 AM, titexe <ti...@yahoo.fr> wrote:
>>>
>>> Thank you for your reply
>>>
>>> I only used a UNC network instead of a local path like (c: \ eg)
>>>
>>> it is this the source of the problème?
>>>
>>
>> Yeah I think so. I recon Windows cannot detect properly if its a file
>> on UNC share?
>>
>> Can you try a test by creating a java.io.File with that UNC file and
>> then do a system out for the various methods the file has?
>>
>> File file = new File(" the UNC file");
>> System.out.println(file.getName());
>>
>> System.out.println(file.isDirectory());
>> System.out.println(file.isFile());
>> // and all the others
>>
>> Then do the same with a file on your local hard disk.
>> Then we can use that to compare and see if its something we can work
>> around in Camel.
>>
>>
>>
>>
>>> best regards,
>>>
>>> titexe
>>>
>>>
>>> Claus Ibsen-2 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 <ti...@yahoo.fr> 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
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://old.nabble.com/File-Consumer-%3A-Ignoring-file-tp27833411p27833695.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
>>
>>
>
> --
> View this message in context: http://old.nabble.com/File-Consumer-%3A-Ignoring-file-tp27833411p27834007.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
Re: File Consumer : Ignoring file
Posted by titexe <ti...@yahoo.Fr>.
I have tested this method, and it's OK :
below the class :
public class File {
public static void main(String[] args)
{
java.io.File file = new java.io.File("\\\\laptop\\testing\\OUT");
System.out.println("filename : " + file.getName());
System.out.println(file.isDirectory());
System.out.println(file.isFile());
}
}
Below the result :
OUT
true
false
Claus Ibsen-2 wrote:
>
> On Tue, Mar 9, 2010 at 11:11 AM, titexe <ti...@yahoo.fr> wrote:
>>
>> Thank you for your reply
>>
>> I only used a UNC network instead of a local path like (c: \ eg)
>>
>> it is this the source of the problème?
>>
>
> Yeah I think so. I recon Windows cannot detect properly if its a file
> on UNC share?
>
> Can you try a test by creating a java.io.File with that UNC file and
> then do a system out for the various methods the file has?
>
> File file = new File(" the UNC file");
> System.out.println(file.getName());
>
> System.out.println(file.isDirectory());
> System.out.println(file.isFile());
> // and all the others
>
> Then do the same with a file on your local hard disk.
> Then we can use that to compare and see if its something we can work
> around in Camel.
>
>
>
>
>> best regards,
>>
>> titexe
>>
>>
>> Claus Ibsen-2 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 <ti...@yahoo.fr> 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
>>>
>>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/File-Consumer-%3A-Ignoring-file-tp27833411p27833695.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
>
>
--
View this message in context: http://old.nabble.com/File-Consumer-%3A-Ignoring-file-tp27833411p27834007.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: File Consumer : Ignoring file
Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Mar 9, 2010 at 11:11 AM, titexe <ti...@yahoo.fr> wrote:
>
> Thank you for your reply
>
> I only used a UNC network instead of a local path like (c: \ eg)
>
> it is this the source of the problème?
>
Yeah I think so. I recon Windows cannot detect properly if its a file
on UNC share?
Can you try a test by creating a java.io.File with that UNC file and
then do a system out for the various methods the file has?
File file = new File(" the UNC file");
System.out.println(file.getName());
System.out.println(file.isDirectory());
System.out.println(file.isFile());
// and all the others
Then do the same with a file on your local hard disk.
Then we can use that to compare and see if its something we can work
around in Camel.
> best regards,
>
> titexe
>
>
> Claus Ibsen-2 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 <ti...@yahoo.fr> 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
>>
>>
>
> --
> View this message in context: http://old.nabble.com/File-Consumer-%3A-Ignoring-file-tp27833411p27833695.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
Re: File Consumer : Ignoring file
Posted by titexe <ti...@yahoo.Fr>.
Thank you for your reply
I only used a UNC network instead of a local path like (c: \ eg)
it is this the source of the problème?
best regards,
titexe
Claus Ibsen-2 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 <ti...@yahoo.fr> 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
>
>
--
View this message in context: http://old.nabble.com/File-Consumer-%3A-Ignoring-file-tp27833411p27833695.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: File Consumer : Ignoring file
Posted by Claus Ibsen <cl...@gmail.com>.
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 <ti...@yahoo.fr> 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