mirror of
https://github.com/apache/nifi.git
synced 2025-02-09 11:35:05 +00:00
NIFI-7041 This closes #4000. Ensure that if the permissions arent set by the flowfile or processor property that we dont attempt to set perms on the remote host
Signed-off-by: Joe Witt <joewitt@apache.org>
This commit is contained in:
parent
3d99d02f93
commit
b205b99668
@ -709,7 +709,11 @@ public class SFTPTransfer implements FileTransfer {
|
||||
|
||||
int perms = 0;
|
||||
final String permissions = ctx.getProperty(PERMISSIONS).evaluateAttributeExpressions(flowFile).getValue();
|
||||
if (permissions != null && !permissions.trim().isEmpty()) {
|
||||
if (permissions == null || permissions.trim().isEmpty()) {
|
||||
sftpClient.getFileTransfer().setPreserveAttributes(false); //We will accept whatever the default permissions are of the destination
|
||||
perms = 0;
|
||||
} else {
|
||||
sftpClient.getFileTransfer().setPreserveAttributes(true); //We will use the permissions supplied by evaluating processor property expression
|
||||
perms = numberPermissions(permissions);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user