Den*_*tta 7 java ftp upload sftp
我jscape sftp用来传输文件
com.jscape.inet.sftp.Sftp
Sftp sftpSession = null;
// after the required step to connect
// through SshParameters
sftpSession.setDir(remotedirectory);
sftpSession.upload(localFile, remoteFile);
Run Code Online (Sandbox Code Playgroud)
现在,这段代码正在传输文件,那部分OK.但是文件权限在远程机器中被更改(它变为644).
in local machine:
-rw-rw-r-- 1 oracle dba 356 Jun 30 03:33 file1.test
-rwxrw-r-x 1 oracle dba 462 Jun 30 03:35 file2.test
in remote machine:
-rw-r--r-- 1 oracle dba 356 Jun 30 03:49 file1.test
-rw-r--r-- 1 oracle dba 462 Jun 30 03:49 file2.test
Run Code Online (Sandbox Code Playgroud)
我看到以下方法来更改远程文件的权限,
com.jscape.inet.sftp.Sftp.setFilePermissions(java.lang.String remoteFile, int permissions)
我的问题是,
com.jscape.inet.sftp.Sftp.upload方法只能这样,上传的文件不保留的权限?setFilePermissions明确使用方法?| 归档时间: |
|
| 查看次数: |
446 次 |
| 最近记录: |