Skip to content

Commit

Permalink
CAMEL-19615 chmodDirectory option try for each junk to change the dir…
Browse files Browse the repository at this point in the history
…ectory permission and fails (#10730)

Co-authored-by: at00191173 <[email protected]>
  • Loading branch information
2 people authored and davsclaus committed Jul 19, 2023
1 parent 0881227 commit e8b5b37
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,10 @@ public synchronized boolean buildDirectory(String directory, boolean absolute) t
success = buildDirectoryChunks(directory);
}

// after creating directory, we may set chmod on the file
chmodOfDirectory(directory);
// only after successfully creating directory, we may set chmod on the file
if (success) {
chmodOfDirectory(directory);
}
}
} catch (SftpException e) {
throw new GenericFileOperationFailedException("Cannot build directory: " + directory, e);
Expand Down Expand Up @@ -614,8 +616,10 @@ private boolean buildDirectoryChunks(String dirName) throws SftpException {
// ignore keep trying to create the rest of the path
}

// after creating directory, we may set chmod on the file
chmodOfDirectory(directory);
// only after successfully creating directory, we may set chmod on the file
if (success) {
chmodOfDirectory(directory);
}
}
}

Expand Down

0 comments on commit e8b5b37

Please sign in to comment.