brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Move to java7 setPosixFilePermiss...
Date Tue, 15 Sep 2015 10:01:23 GMT
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message