(S)FTP component:fileExists=FAIL does not always work on Windows based FTP server/filesystem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

(S)FTP component:fileExists=FAIL does not always work on Windows based FTP server/filesystem

mailinglists
Hi,
I have a problem with the (S)FTP component in combination with a Windows
based FTP server, which means the file names are case insensitive.

Camel 2.24.0.

My route:
   from("file:xxx?include=(?i)test.txt")
    .to("sftp://myhost?fileExist=Fail")

On the target server there ist already a file named TEST.TXT (upper
case!)

With a Linux based filessystem on the FTP server this works, it would
not fail and afterwards there are two files named text.txt and TEST.TXT
on the server.

But on a Windows server, the case sensitive filename matching
(SftpOperations.java#existsFile) does not recognize the already existent
file with the different case, therefore it does not fail
and the file would be overwritten! In this use case the "fileExist=Fail"
does not work at all.

I am aware of that we are on the client side and do not know anything
about the underlying file system of the FTP server, and it would be
difficult to detect such
an environment, but in my opinion this is a bug. Perhaps there has to be
another endpoint option how to exactly match the file names.

But for a quick solution: Anyone an idea of a workaround (preferably
without having to write a custom component/endpoint)?


Thanks in advance
   Volker
Reply | Threaded
Open this post in threaded view
|

Re: (S)FTP component:fileExists=FAIL does not always work on Windows based FTP server/filesystem

Claus Ibsen-2
Hi

Ah yeah maybe we can add an option to tell it to ignore cases on
files. I think its not good practice to have files named test.txt,
Test.txt and TEST.TXT etc.
You are welcome to log a JIRA

On Mon, Aug 5, 2019 at 1:48 PM mailinglists
<[hidden email]> wrote:

>
> Hi,
> I have a problem with the (S)FTP component in combination with a Windows
> based FTP server, which means the file names are case insensitive.
>
> Camel 2.24.0.
>
> My route:
>    from("file:xxx?include=(?i)test.txt")
>     .to("sftp://myhost?fileExist=Fail")
>
> On the target server there ist already a file named TEST.TXT (upper
> case!)
>
> With a Linux based filessystem on the FTP server this works, it would
> not fail and afterwards there are two files named text.txt and TEST.TXT
> on the server.
>
> But on a Windows server, the case sensitive filename matching
> (SftpOperations.java#existsFile) does not recognize the already existent
> file with the different case, therefore it does not fail
> and the file would be overwritten! In this use case the "fileExist=Fail"
> does not work at all.
>
> I am aware of that we are on the client side and do not know anything
> about the underlying file system of the FTP server, and it would be
> difficult to detect such
> an environment, but in my opinion this is a bug. Perhaps there has to be
> another endpoint option how to exactly match the file names.
>
> But for a quick solution: Anyone an idea of a workaround (preferably
> without having to write a custom component/endpoint)?
>
>
> Thanks in advance
>    Volker



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Reply | Threaded
Open this post in threaded view
|

Re: (S)FTP component:fileExists=FAIL does not always work on Windows based FTP server/filesystem

Pasquale Congiusti
Hey there,
Windows filesystems are likely to be case insensitive, but I think there
may be some possibility to change it to be case sensitive. If you have
access to the server may you recur to this option as a last resort
workaround?

Cheers,
Pasquale.

On Mon, Aug 5, 2019 at 2:18 PM Claus Ibsen <[hidden email]> wrote:

> Hi
>
> Ah yeah maybe we can add an option to tell it to ignore cases on
> files. I think its not good practice to have files named test.txt,
> Test.txt and TEST.TXT etc.
> You are welcome to log a JIRA
>
> On Mon, Aug 5, 2019 at 1:48 PM mailinglists
> <[hidden email]> wrote:
> >
> > Hi,
> > I have a problem with the (S)FTP component in combination with a Windows
> > based FTP server, which means the file names are case insensitive.
> >
> > Camel 2.24.0.
> >
> > My route:
> >    from("file:xxx?include=(?i)test.txt")
> >     .to("sftp://myhost?fileExist=Fail")
> >
> > On the target server there ist already a file named TEST.TXT (upper
> > case!)
> >
> > With a Linux based filessystem on the FTP server this works, it would
> > not fail and afterwards there are two files named text.txt and TEST.TXT
> > on the server.
> >
> > But on a Windows server, the case sensitive filename matching
> > (SftpOperations.java#existsFile) does not recognize the already existent
> > file with the different case, therefore it does not fail
> > and the file would be overwritten! In this use case the "fileExist=Fail"
> > does not work at all.
> >
> > I am aware of that we are on the client side and do not know anything
> > about the underlying file system of the FTP server, and it would be
> > difficult to detect such
> > an environment, but in my opinion this is a bug. Perhaps there has to be
> > another endpoint option how to exactly match the file names.
> >
> > But for a quick solution: Anyone an idea of a workaround (preferably
> > without having to write a custom component/endpoint)?
> >
> >
> > Thanks in advance
> >    Volker
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>
Reply | Threaded
Open this post in threaded view
|

Re: (S)FTP component:fileExists=FAIL does not always work on Windows based FTP server/filesystem

mailinglists
Am 2019-08-06 09:11, schrieb Pasquale Congiusti:
> Hey there,
> Windows filesystems are likely to be case insensitive, but I think
> there
> may be some possibility to change it to be case sensitive. If you have
> access to the server may you recur to this option as a last resort
> workaround?

Unfortunately it's a customers server and I don't have any influence on
the setup.

I think I would write a custom Sftp component with a customized
existsFile method as a "quick" solution.

I will also file a Jira for a new endpoint option.


Thanks & regards
   Volker


> Cheers,
> Pasquale.
>
> On Mon, Aug 5, 2019 at 2:18 PM Claus Ibsen <[hidden email]>
> wrote:
>
>> Hi
>>
>> Ah yeah maybe we can add an option to tell it to ignore cases on
>> files. I think its not good practice to have files named test.txt,
>> Test.txt and TEST.TXT etc.
>> You are welcome to log a JIRA
>>
>> On Mon, Aug 5, 2019 at 1:48 PM mailinglists
>> <[hidden email]> wrote:
>> >
>> > Hi,
>> > I have a problem with the (S)FTP component in combination with a Windows
>> > based FTP server, which means the file names are case insensitive.
>> >
>> > Camel 2.24.0.
>> >
>> > My route:
>> >    from("file:xxx?include=(?i)test.txt")
>> >     .to("sftp://myhost?fileExist=Fail")
>> >
>> > On the target server there ist already a file named TEST.TXT (upper
>> > case!)
>> >
>> > With a Linux based filessystem on the FTP server this works, it would
>> > not fail and afterwards there are two files named text.txt and TEST.TXT
>> > on the server.
>> >
>> > But on a Windows server, the case sensitive filename matching
>> > (SftpOperations.java#existsFile) does not recognize the already existent
>> > file with the different case, therefore it does not fail
>> > and the file would be overwritten! In this use case the "fileExist=Fail"
>> > does not work at all.
>> >
>> > I am aware of that we are on the client side and do not know anything
>> > about the underlying file system of the FTP server, and it would be
>> > difficult to detect such
>> > an environment, but in my opinion this is a bug. Perhaps there has to be
>> > another endpoint option how to exactly match the file names.
>> >
>> > But for a quick solution: Anyone an idea of a workaround (preferably
>> > without having to write a custom component/endpoint)?
>> >
>> >
>> > Thanks in advance
>> >    Volker
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> http://davsclaus.com @davsclaus
>> Camel in Action 2: https://www.manning.com/ibsen2
>>