hierynomus / sshj

ssh, scp and sftp for java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SFTPs attempt to check whether a target file is a directory throws Permission Denied Exception when the target file does not exist

RPCMoritz opened this issue · comments

This could be due to the server side configuration, but ultimately a standard PUT via commandline works - once the files then exist, they can be checked, and the Exception goes away.

I would suggest to handle the Exception during the check, and defaulting to "If I can't tell whether it's a directory, it isn't one", with a warning log message, (SFTPFileTransfer:L292) or adding an explicit handler for Permission Denied.