2

We are creating a folder structure and writing files to this newly created folder structure using data in the channel. The problem we have is that the folder is to be updated/deleted by another user. Is there a way we can set folder/file permission explicitly using SI file outbound adapter?

<int-file:outbound-channel-adapter id="fileLoggingAdapter" auto-create-directory="true" directory-expression="headers['FileDetails'].directory" 
            filename-generator-expression="headers['FileDetails'].fileName+'.csv'"    />
Sushant
  • 21
  • 3

2 Answers2

1

There is no standard ability to do this in SI.

However, you can create your own message processing step and put it BEFORE your file:outbound-channel-adapter. It may be e.g. some transformer which takes your directory name from message header, creates the directory with needed permissions and resend message further intact.

Community
  • 1
  • 1
Andriy Kryvtsun
  • 3,220
  • 3
  • 27
  • 41
0

It's not currently possible to set permissions when creating the directory.

You could, however, create it during application start up and set the permissions.

See the answers to this question.

I opened a JIRA Issue.

Community
  • 1
  • 1
Gary Russell
  • 166,535
  • 14
  • 146
  • 179
  • There is an other trick with the `ExpressionEvaluatingRequestHandlerAdvice`, when you are able to set permissions after file process. – Artem Bilan Sep 20 '16 at 22:02
  • Hi Gary, the folders to be created is dynamic based on the payload in channel. So its not possible for me to do it during context initialization. – Sushant Sep 21 '16 at 03:22
  • Artem, Can you please detail me on how to use ExpressionEvaluatingRequestHandlerAdvice? – Sushant Sep 21 '16 at 03:23