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 <[email protected]> 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 <[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
>>>
>>>
>>
>> --
>> 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.