diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/TempFileGenerator.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/TempFileGenerator.java index 4056576150fb..8dab7e71cf69 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/TempFileGenerator.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/TempFileGenerator.java @@ -39,6 +39,7 @@ import static java.nio.file.attribute.AclEntryPermission.WRITE_ATTRIBUTES; import static java.nio.file.attribute.AclEntryPermission.WRITE_DATA; import static java.nio.file.attribute.AclEntryPermission.WRITE_NAMED_ATTRS; +import java.nio.file.attribute.AclEntryType; import java.nio.file.attribute.AclFileAttributeView; import java.nio.file.attribute.DosFileAttributeView; import java.nio.file.attribute.FileAttribute; @@ -164,12 +165,16 @@ private void writeToFile(WriterConsumer c, Path filePath) throws IOException { private void setFileOwnerAcl(Path filePath, Set permissions) throws IOException { AclFileAttributeView acl = Files.getFileAttributeView(filePath, AclFileAttributeView.class); AclEntry ownerEntry = findFileOwner(acl); + AclEntry.Builder aclBuilder; if (ownerEntry == null) { - throw new IOException("Owner missing, file:" + filePath.toString()); // NOI18N - } + LOG.info("Owner missing, file:" + filePath.toString()); // NOI18N + aclBuilder = AclEntry.newBuilder().setPrincipal(acl.getOwner()).setType(AclEntryType.ALLOW); + } else { + aclBuilder = AclEntry.newBuilder(ownerEntry); + } - AclEntry ownerAcl = AclEntry.newBuilder(ownerEntry).setPermissions(permissions).build(); + AclEntry ownerAcl = aclBuilder.setPermissions(permissions).build(); acl.setAcl(Collections.singletonList(ownerAcl)); }