-
Notifications
You must be signed in to change notification settings - Fork 1.1k
When deleteSourceFiles is true, the setPermissions method of FileWritingMessageHandler should be called. #9294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The logic is like this:
That As you see that Do you mean the |
When I call the private File handleFileMessage(File sourceFile, File tempFile, File resultFile, Message<?> requestMessage)
throws IOException {
if (!FileExistsMode.APPEND.equals(this.fileExistsMode) && this.deleteSourceFiles) {
rename(sourceFile, resultFile);
return resultFile;
}
else {
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(sourceFile));
return handleInputStreamMessage(bis, sourceFile, tempFile, resultFile, requestMessage);
}
} |
Yeah... That use-case is missed. I can fix it quickly, but wonder if you are willing to contribute: https://github.com/spring-projects/spring-integration/blob/main/CONTRIBUTING.adoc. Looks like that |
Fixes: spring-projects#9294 When the `deleteSourceFiles` property of `FileWritingMessageHandler` is `true`, the `chmod` is not set on the target file. * Fix `FileWritingMessageHandler.handleFileMessage()` logic to `setPermissions(resultFile)` after `move` operation **Auto-cherry-pick to `6.3.x` & `6.2.x`**
* GH-9294: Set permissions to target file on rename Fixes: #9294 When the `deleteSourceFiles` property of `FileWritingMessageHandler` is `true`, the `chmod` is not set on the target file. * Fix `FileWritingMessageHandler.handleFileMessage()` logic to `setPermissions(resultFile)` after `move` operation * * Set only `OWNER_READ` permission for file in unit test (cherry picked from commit 3e71ea5)
* GH-9294: Set permissions to target file on rename Fixes: #9294 When the `deleteSourceFiles` property of `FileWritingMessageHandler` is `true`, the `chmod` is not set on the target file. * Fix `FileWritingMessageHandler.handleFileMessage()` logic to `setPermissions(resultFile)` after `move` operation * * Set only `OWNER_READ` permission for file in unit test (cherry picked from commit 3e71ea5)
Expected Behavior
chmod should need to work when the FileWritingMessageHandler's deleteSourceFiles property is true.
Current Behavior
When the deleteSourceFiles property of FileWritingMessageHandler is true, chmod does not work.
Context
My code is as follows:
When deleteSourceFiles is true, the setPermissions(resultFile) method is not called in the handleFileMessage method of FileWritingMessageHandler.
The text was updated successfully, but these errors were encountered: