// Preserve source file's permissions: preserve only the permissions bits that are supported by the source
// file and use default permissions for the rest of them.
if(destFile.isFileOperationSupported(FileOperation.CHANGE_PERMISSION)) {
try {
// use #importPermissions(AbstractFile, int) to avoid isDirectory test
destFile.importPermissions(sourceFile, FilePermissions.DEFAULT_FILE_PERMISSIONS);
}
catch (IOException e) {
LOGGER.debug("failed to import "+sourceFile+" permissions into "+destFile, e);
// Fail silently
}