0

I am trying to find the configuration for allowing spring-integration-aws to create the remote folder structure locally so it is able to sync.

Example: Given a very long s3 bucket address:

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

Currently get the error message:

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)

It looks like it is being caused by not having the full folder structure locally,is it possible to set the S3InboundFileSynchronizingMessageSource to create this?

Current config:

public S3InboundFileSynchronizingMessageSource s3InboundFileSynchronizingMessageSource() {
    S3InboundFileSynchronizingMessageSource messageSource =
            new S3InboundFileSynchronizingMessageSource(file);
    messageSource.setAutoCreateLocalDirectory(true);
    messageSource.setLocalDirectory(new File("onComputer"));
    messageSource.setLocalFilter(new AcceptOnceFileListFilter<>());
    return messageSource;
user101010101
  • 1,609
  • 6
  • 31
  • 52

1 Answers1

2

When asking questions like this, you need to show more of your configuration, including the synchronizer as well as a full stack trace for the exception.

However, no, there is currently not a mechanism to rebuild the remote file tree - it's a simple flat file-only synchronization between the remote directory leaf node and the localDirectory.

When autoCreateLocalDirectory is true, it's done once, during initialization.

Gary Russell
  • 166,535
  • 14
  • 146
  • 179
  • Thanks for the tip. So if I am passed the full quailed name for a zip (for example) with x levels deep, I cannot use this library, as I will not know the full qualified path ahead of time? I was really hoping to use it. – user101010101 May 11 '16 at 00:04
  • Also does this mean if you have many files in an s3 bucket it will try and sync everything, I cannot say I want x file? – user101010101 May 11 '16 at 00:11
  • While it currently does not provide an [outbound gateway like FTP/SFTP](http://docs.spring.io/spring-integration/reference/html/ftp.html#ftp-outbound-gateway) the module is built on the same abstractions - so you can use a `S3RemoteFileTemplate` to list, fetch files etc. Also see [this commit](https://github.com/spring-projects/spring-integration-aws/commit/a0893cb88edb17a376f1ef874d80de98336129ad) which needs some documentation but can be used to download and copy remote directory structures. [Doc JIRA here](https://jira.spring.io/browse/INTEXT-221). – Gary Russell May 11 '16 at 00:57