View Javadoc
1   package org.codehaus.plexus.components.io.attributes;
2   
3   /*
4    * Copyright 2007 The Codehaus Foundation.
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   *      http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  
19  import javax.annotation.Nonnull;
20  import javax.annotation.Nullable;
21  
22  public interface PlexusIoResourceAttributes
23  {
24      int UNKNOWN_OCTAL_MODE = -1;
25  
26      boolean isOwnerReadable();
27  
28      boolean isOwnerWritable();
29  
30      boolean isOwnerExecutable();
31  
32      boolean isGroupReadable();
33  
34      boolean isGroupWritable();
35  
36      boolean isGroupExecutable();
37  
38      boolean isWorldReadable();
39  
40      boolean isWorldWritable();
41  
42      boolean isWorldExecutable();
43  
44      /**
45       * Gets the unix user id.
46       * @return The unix user id, may be null ("not set"), even on unix
47       */
48      Integer getUserId();
49      
50      /**
51       * Gets the unix group id.
52       * @return The unix group id, may be null ("not set"), even on unix
53       */
54      @Nullable
55      Integer getGroupId();
56  
57      /**
58       * Returns the user name of the user owning the file. Probably not null :)
59       * @return The user name
60       */
61      @Nullable
62      String getUserName();
63  
64      /**
65       * The group name. May be null if groups are unsupported
66       * @return the group names
67       */
68      @Nullable
69      String getGroupName();
70  
71      /**
72       * Octal mode attributes.
73       * {@link #UNKNOWN_OCTAL_MODE} if unsupported on current file/file system
74       */
75      int getOctalMode();
76  
77      @Nonnull
78     //String getOctalModeString();
79  
80      /**
81       * Indicates if this is a symnbolic link element.
82       * For file-based resource attributes this value may be always "false" for versions prior to java7.
83       * @return True if the file is a symlink or false if not.
84       */
85      boolean isSymbolicLink();
86  }