首页 文章

如何使用Spring Integration上传到SFTP用户的主目录

提问于
浏览
0

我正在尝试使用Spring Integration(版本4.1.2)通过SFTP上传文件 . 有谁知道如何配置 sftp:outbound-channel-adapter 以便文件自动上传到用户's home directory without indicating the full directory path in the remote-directory'属性(例如:remote-directory = "/home/sftp_user")?

1 回答

  • 0

    解决方案是必须将remote-directory设置为空字符串 . 请注意,以下内容无效,因为它未通过XML模型验证:

    <sftp:outbound-channel-adapter
            ...
            remote-directory=""
            ...
        />
    

    我最终从配置属性读取远程目录,我将其设置为空字符串 .

相关问题