Hi,
I have also faced this kind of issue. Some systems allow existence of a
directory and a file name with the same name, but JSch does check if there is a
directory with the same name before putting a file to an SFTP server.
I think it's better that JSch doesn't do that checking. If the SFTP server
detects any violation, it would return an error.
Regards,Viet
--- On Fri, 5/6/11, Nguyen Tran Vu Linh <vlsuperman2...@yahoo.com> wrote:
From: Nguyen Tran Vu Linh <vlsuperman2...@yahoo.com>
Subject: [JSch-users] Jsch sftp client with Maverick sftp server
To: "Atsuhiko Yamanaka" <y...@jcraft.com>
Cc: "jsch-users@lists.sourceforge.net" <jsch-users@lists.sourceforge.net>
Date: Friday, May 6, 2011, 11:14 AM
Hi,
In recent days, I got an issue when using Jsch Sftp client to put file to a
Virtual directory managed by Maverick Sftp server. The problem is Maverick Sftp
server only accepts 24-characters-long file name. All file names with length
shorter than 24 characters are rejected with an exception shows that the target
file is a directory (although, the file is not existing on the server of
course). Running "stat" command with shorter-or-longer-than-24-characters file
names returns "drw-------" as
result. Below are some test cases I did using Jsch sftp client and other
clients (winscp, maverick j2ssh client...):
Input file name
Result/<Virtual Directory path>/123456789012345678901234 -rw------
/<Virtual Directory path>/12345678901234567890123 drw------/<Virtual
Directory path>/1234567890123456789012345 drw------
Easily, we can see that this is a bug or just a configuration in Virtual
Directory feature of Maverick sftp server.
However, using other clients (winscp), I got no exception when putting the file
with shorter-or-longer-than-24-characters file name to Maverick sftp server. I
think that Winscp doesn't do directory checking, it just puts the file and gets
back the exception (if any) when error occurs (file with given name is
existing, given file name is a directory....). Now,
to bypass the execption, I need to remove directory checking code in Jsch sftp
client code. IMHO, we can skip the directory checking on given file name like
Winscp because the is-directory or is-existing exception can be thrown later.
Please review this and let me know your opinion.
------
Linh Vu Tran Nguyen
-----Inline Attachment Follows-----
------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network
management toolset available today. Delivers lowest initial
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
-----Inline Attachment Follows-----
_______________________________________________
JSch-users mailing list
JSch-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jsch-users
------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network
management toolset available today. Delivers lowest initial
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
JSch-users mailing list
JSch-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jsch-users