【问题标题】:Spring Integration Aws: Create Remote Folders LocallySpring Integration Aws:在本地创建远程文件夹
【发布时间】:2016-09-05 15:24:27
【问题描述】:

我正在尝试查找允许 spring-integration-aws 在本地创建远程文件夹结构以便能够同步的配置。

示例: 给定一个很长的 s3 存储桶地址:

test.s3.bucket/folder1/floder2/folder3/etc/etc/etc/etc

目前得到错误信息:

Caused by: java.io.FileNotFoundException: test.s3.bucket/folder1/floder2/folder3/etc/etc/etc/etc/DD2419D7-104E-46FC-A513-9E587E58A949.ZIP.a.writing (No such file or directory)

好像是本地没有完整的文件夹结构造成的,是否可以设置S3InboundFileSynchronizingMessageSource来创建这个?

当前配置:

public S3InboundFileSynchronizingMessageSource s3InboundFileSynchronizingMessageSource() {
    S3InboundFileSynchronizingMessageSource messageSource =
            new S3InboundFileSynchronizingMessageSource(file);
    messageSource.setAutoCreateLocalDirectory(true);
    messageSource.setLocalDirectory(new File("onComputer"));
    messageSource.setLocalFilter(new AcceptOnceFileListFilter<>());
    return messageSource;

【问题讨论】:

    标签: spring spring-integration spring-cloud spring-cloud-aws


    【解决方案1】:

    在提出此类问题时,您需要显示更多配置,包括同步器以及异常的完整堆栈跟踪。

    但是,不,目前没有重建远程文件树的机制 - 它是远程目录叶节点和 localDirectory 之间的简单平面文件同步。

    autoCreateLocalDirectory 为真时,它会在初始化期间完成一次。

    【讨论】:

    • 感谢您的提示。因此,如果我通过了具有 x 级别深度的 zip(例如)的完整 quailed 名称,我将无法使用此库,因为我不会提前知道完整的限定路径?我真的很希望使用它。
    • 这是否意味着如果您在 s3 存储桶中有很多文件,它会尝试同步所有内容,我不能说我想要 x 文件?
    • 虽然它目前不提供outbound gateway like FTP/SFTP,但该模块建立在相同的抽象之上——因此您可以使用S3RemoteFileTemplate 来列出、获取文件等。另请参阅this commit,它需要一些文档,但可用于下载和复制远程目录结构。 Doc JIRA here.
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-14
    • 2013-10-01
    • 2017-06-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多