【问题标题】:Spring integration sftp adapter update remote file permissionSpring集成sftp适配器更新远程文件权限
【发布时间】:2023-03-19 10:53:01
【问题描述】:

我们正在使用 spring 集成 sftp 出站适配器将文件 sftp 到远程服务器。接收方提到我们ftp的文件需要有读写权限(chmod 777)。有没有办法通过出站适配器进行设置,以便创建具有正确权限的文件?

【问题讨论】:

    标签: spring-integration sftp


    【解决方案1】:

    目前不支持;请打开JIRA Issue,我们会考虑添加它。

    同时,上传文件后,您可以使用SftpRemoteFileTemplate更改模式。

        template.executeWithClient(new ClientCallbackWithoutResult<ChannelSftp>() {
    
            @Override
            public void doWithClientWithoutResult(ChannelSftp client) {
                try {
                    client.chmod(...);
                }
                catch (SftpException e) {
                    throw new RuntimeException(e);
                }
            }
        });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-15
      • 2020-10-28
      相关资源
      最近更新 更多