1 /* 2 * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package java.nio.file.attribute; 27 28 /** 29 * Defines the permissions for use with the permissions component of an ACL 30 * {@link AclEntry entry}. 31 * 32 * @since 1.7 33 */ 34 35 public enum AclEntryPermission { 36 37 /** 38 * Permission to read the data of the file. 39 */ 40 READ_DATA, 41 42 /** 43 * Permission to modify the file's data. 44 */ 45 WRITE_DATA, 46 47 /** 48 * Permission to append data to a file. 49 */ 50 APPEND_DATA, 51 52 /** 53 * Permission to read the named attributes of a file. 54 * 55 * <p> <a href="http://www.ietf.org/rfc/rfc3530.txt">RFC 3530: Network 56 * File System (NFS) version 4 Protocol</a> defines <em>named attributes</em> 57 * as opaque files associated with a file in the file system. 58 */ 59 READ_NAMED_ATTRS, 60 61 /** 62 * Permission to write the named attributes of a file. 63 * 64 * <p> <a href="http://www.ietf.org/rfc/rfc3530.txt">RFC 3530: Network 65 * File System (NFS) version 4 Protocol</a> defines <em>named attributes</em> 66 * as opaque files associated with a file in the file system. 67 */ 68 WRITE_NAMED_ATTRS, 69 70 /** 71 * Permission to execute a file. 72 */ 73 EXECUTE, 74 75 /** 76 * Permission to delete a file or directory within a directory. 77 */ 78 DELETE_CHILD, 79 80 /** 81 * The ability to read (non-acl) file attributes. 82 */ 83 READ_ATTRIBUTES, 84 85 /** 86 * The ability to write (non-acl) file attributes. 87 */ 88 WRITE_ATTRIBUTES, 89 90 /** 91 * Permission to delete the file. 92 */ 93 DELETE, 94 95 /** 96 * Permission to read the ACL attribute. 97 */ 98 READ_ACL, 99 100 /** 101 * Permission to write the ACL attribute. 102 */ 103 WRITE_ACL, 104 105 /** 106 * Permission to change the owner. 107 */ 108 WRITE_OWNER, 109 110 /** 111 * Permission to access file locally at the server with synchronous reads 112 * and writes. 113 */ 114 SYNCHRONIZE; 115 116 /** 117 * Permission to list the entries of a directory (equal to {@link #READ_DATA}) 118 */ 119 public static final AclEntryPermission LIST_DIRECTORY = READ_DATA; 120 121 /** 122 * Permission to add a new file to a directory (equal to {@link #WRITE_DATA}) 123 */ 124 public static final AclEntryPermission ADD_FILE = WRITE_DATA; 125 126 /** 127 * Permission to create a subdirectory to a directory (equal to {@link #APPEND_DATA}) 128 */ 129 public static final AclEntryPermission ADD_SUBDIRECTORY = APPEND_DATA; 130 } 131