[JSch-users] Jsch sftp client with Maverick sftp server
Status: Alpha
Brought to you by:
ymnk
|
From: Nguyen T. Vu L. <vls...@ya...> - 2011-05-06 04:14:20
|
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 |