Github user aledsage commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/896#discussion_r39493349
--- Diff:
utils/common/src/main/java/org/apache/brooklyn/util/io/FileUtil.java ---
@@ -73,36 +77,11 @@ public static void setFilePermissionsTo700(File file)
throws IOException {
}
}
- // When we move to java 7, we can use Files.setPosixFilePermissions
+ private static final Set<PosixFilePermission> posixPermissions600 =
PosixFilePermissions.fromString("rw-------");
+
public static void setFilePermissionsTo600(File file) throws
IOException {
file.createNewFile();
- file.setExecutable(false, false);
- file.setReadable(false, false);
- file.setWritable(false, false);
- file.setReadable(true, true);
- file.setWritable(true, true);
-
- boolean setRead = file.setReadable(false, false) &
file.setReadable(true, true);
- boolean setWrite = file.setWritable(false, false) &
file.setWritable(true, true);
- boolean setExec = file.setExecutable(false, false);
-
- if (setRead && setWrite && setExec) {
- if (LOG.isTraceEnabled()) LOG.trace("Set permissions to 600
for file {}", file.getAbsolutePath());
--- End diff --
Would be good to preserve the `LOG.trace` when we change the file
permission.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---