Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
JSCH APIを使用して、sftp経由でリモートサーバーに接続しています。リモートサーバーにあるディレクトリを場所Aから場所Bに移動する必要があります。channelsftp.put(src、dest)メソッドではファイルのみを移動でき、ディレクトリは移動できないようです。
誰かがこれを行う方法を教えてもらえますか?
名前変更コマンドを使用すると、ファイルまたはディレクトリが移動され、元の場所から削除されます。
sftpChannel.rename(oldFile、newFile);
元のディレクトリ/ファイルを保持する場合は、この方法を使用しないでください。
お役に立てれば。