jdk/test/java/io/File/SetAccess.java
author ohair
Wed, 06 Apr 2011 22:06:11 -0700
changeset 9035 1255eb81cc2f
parent 8158 77d9c0f1c19f
child 13568 ce5ab758aeb5
permissions -rw-r--r--
7033660: Update copyright year to 2011 on any files changed in 2011 Reviewed-by: dholmes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
9035
1255eb81cc2f 7033660: Update copyright year to 2011 on any files changed in 2011
ohair
parents: 8158
diff changeset
     2
 * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
/* @test
6884
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
    25
   @bug 4167472 5097703 6216563 6284003 6728842 6464744
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
   @summary Basic test for setWritable/Readable/Executable methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.io.*;
8158
77d9c0f1c19f 7006126: (fs) Updates to file system API (1/2011)
alanb
parents: 7668
diff changeset
    30
import java.nio.file.*;
6884
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
    31
import java.nio.file.attribute.*;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
public class SetAccess {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
    public static void main(String[] args) throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
        File d = new File(System.getProperty("test.dir", "."));
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
        File f = new File(d, "x.SetAccessPermission");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
        if (f.exists() && !f.delete())
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
            throw new Exception("Can't delete test file: " + f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
        OutputStream o = new FileOutputStream(f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
        o.write('x');
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
        o.close();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
        doTest(f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
        f = new File(d, "x.SetAccessPermission.dir");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
        if (f.exists() && !f.delete())
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
            throw new Exception("Can't delete test dir: " + f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
        if (!f.mkdir())
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
            throw new Exception(f + ": Cannot create directory");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
        doTest(f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
    public static void doTest(File f) throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
        if (!System.getProperty("os.name").startsWith("Windows")) {
6884
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
    55
            if (!f.setReadOnly())
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
    56
                 throw new Exception(f + ": setReadOnly Failed");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
            if (!f.setWritable(true, true) ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
                !f.canWrite() ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
                permission(f).charAt(2) != 'w')
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
                throw new Exception(f + ": setWritable(true, ture) Failed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
            if (!f.setWritable(false, true) ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
                f.canWrite() ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
                permission(f).charAt(2) != '-')
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
                throw new Exception(f + ": setWritable(false, true) Failed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
            if (!f.setWritable(true, false) ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
                !f.canWrite() ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
                !permission(f).matches(".(.w.){3}"))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
                throw new Exception(f + ": setWritable(true, false) Failed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
            if (!f.setWritable(false, false) ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
                f.canWrite() ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
                !permission(f).matches(".(.-.){3}"))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
                throw new Exception(f + ": setWritable(false, true) Failed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
            if (!f.setWritable(true) || !f.canWrite() ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
                permission(f).charAt(2) != 'w')
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
                throw new Exception(f + ": setWritable(true, ture) Failed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
            if (!f.setWritable(false) || f.canWrite() ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
                permission(f).charAt(2) != '-')
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
                throw new Exception(f + ": setWritable(false, true) Failed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
            if (!f.setExecutable(true, true) ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
                !f.canExecute() ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
                permission(f).charAt(3) != 'x')
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
                throw new Exception(f + ": setExecutable(true, true) Failed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
            if (!f.setExecutable(false, true) ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
                f.canExecute() ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
                permission(f).charAt(3) != '-')
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
                throw new Exception(f + ": setExecutable(false, true) Failed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
            if (!f.setExecutable(true, false) ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
                !f.canExecute() ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
                !permission(f).matches(".(..x){3}"))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
                throw new Exception(f + ": setExecutable(true, false) Failed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
            if (!f.setExecutable(false, false) ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
                f.canExecute() ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
                !permission(f).matches(".(..-){3}"))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
                throw new Exception(f + ": setExecutable(false, false) Failed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
            if (!f.setExecutable(true) || !f.canExecute() ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
                permission(f).charAt(3) != 'x')
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
                throw new Exception(f + ": setExecutable(true, true) Failed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
            if (!f.setExecutable(false) || f.canExecute() ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
                permission(f).charAt(3) != '-')
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
                throw new Exception(f + ": setExecutable(false, true) Failed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
            if (!f.setReadable(true, true) ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
                !f.canRead() ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
                permission(f).charAt(1) != 'r')
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
                throw new Exception(f + ": setReadable(true, true) Failed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
            if (!f.setReadable(false, true) ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
                f.canRead() ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
                permission(f).charAt(1) != '-')
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
                throw new Exception(f + ": setReadable(false, true) Failed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
            if (!f.setReadable(true, false) ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
                !f.canRead() ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
                !permission(f).matches(".(r..){3}"))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
                throw new Exception(f + ": setReadable(true, false) Failed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
            if (!f.setReadable(false, false) ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
                f.canRead() ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
                !permission(f).matches(".(-..){3}"))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
                throw new Exception(f + ": setReadable(false, false) Failed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
            if (!f.setReadable(true) || !f.canRead() ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
                permission(f).charAt(1) != 'r')
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
                throw new Exception(f + ": setReadable(true, true) Failed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
            if (!f.setReadable(false) || f.canRead() ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
                permission(f).charAt(1) != '-')
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
                throw new Exception(f + ": setReadable(false, true) Failed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
            //Windows platform
6884
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   125
            if (f.isFile()) {
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   126
                if (!f.setReadOnly())
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   127
                    throw new Exception(f + ": setReadOnly Failed");
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   128
                if (!f.setWritable(true, true) || !f.canWrite())
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   129
                    throw new Exception(f + ": setWritable(true, ture) Failed");
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   130
                if (!f.setWritable(true, false) || !f.canWrite())
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   131
                    throw new Exception(f + ": setWritable(true, false) Failed");
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   132
                if (!f.setWritable(true) || !f.canWrite())
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   133
                    throw new Exception(f + ": setWritable(true, ture) Failed");
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   134
                if (!f.setExecutable(true, true) || !f.canExecute())
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   135
                    throw new Exception(f + ": setExecutable(true, true) Failed");
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   136
                if (!f.setExecutable(true, false) || !f.canExecute())
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   137
                    throw new Exception(f + ": setExecutable(true, false) Failed");
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   138
                if (!f.setExecutable(true) || !f.canExecute())
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   139
                    throw new Exception(f + ": setExecutable(true, true) Failed");
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   140
                if (!f.setReadable(true, true) || !f.canRead())
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   141
                    throw new Exception(f + ": setReadable(true, true) Failed");
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   142
                if (!f.setReadable(true, false) || !f.canRead())
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   143
                    throw new Exception(f + ": setReadable(true, false) Failed");
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   144
                if (!f.setReadable(true) || !f.canRead())
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   145
                    throw new Exception(f + ": setReadable(true, true) Failed");
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   146
            }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
            if (f.isDirectory()) {
6884
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   148
                // setWritable should fail on directories because the DOS readonly
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   149
                // attribute prevents a directory from being deleted.
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   150
                if (f.setWritable(false, true))
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   151
                    throw new Exception(f + ": setWritable(false, true) Succeeded");
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   152
                if (f.setWritable(false, false))
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   153
                    throw new Exception(f + ": setWritable(false, false) Succeeded");
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   154
                if (f.setWritable(false))
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   155
                    throw new Exception(f + ": setWritable(false) Succeeded");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
            } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
                if (!f.setWritable(false, true) || f.canWrite())
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
                    throw new Exception(f + ": setWritable(false, true) Failed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
                if (!f.setWritable(false, false) || f.canWrite())
6884
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   160
                    throw new Exception(f + ": setWritable(false, false) Failed");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
                if (!f.setWritable(false) || f.canWrite())
6884
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   162
                    throw new Exception(f + ": setWritable(false) Failed");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
            if (f.setExecutable(false, true))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
                throw new Exception(f + ": setExecutable(false, true) Failed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
            if (f.setExecutable(false, false))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
                throw new Exception(f + ": setExecutable(false, false) Failed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
            if (f.setExecutable(false))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
                throw new Exception(f + ": setExecutable(false, true) Failed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
            if (f.setReadable(false, true))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
                throw new Exception(f + ": setReadable(false, true) Failed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
            if (f.setReadable(false, false))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
                throw new Exception(f + ": setReadable(false, false) Failed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
            if (f.setReadable(false))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
                throw new Exception(f + ": setReadable(false, true) Failed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
        if (f.exists() && !f.delete())
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
            throw new Exception("Can't delete test dir: " + f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
    private static String permission(File f) throws Exception {
8158
77d9c0f1c19f 7006126: (fs) Updates to file system API (1/2011)
alanb
parents: 7668
diff changeset
   182
        PosixFileAttributes attrs = Files.readAttributes(f.toPath(), PosixFileAttributes.class);
6884
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   183
        String type = attrs.isDirectory() ? "d" : " ";
65b1fa0a0fae 6728842: File.setReadOnly does not make a directory read-only (win)
alanb
parents: 5506
diff changeset
   184
        return type + PosixFilePermissions.toString(attrs.permissions());
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
}