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.Nullable;
20
21 public interface PlexusIoResourceAttributes {
22 int UNKNOWN_OCTAL_MODE = -1;
23
24 boolean isOwnerReadable();
25
26 boolean isOwnerWritable();
27
28 boolean isOwnerExecutable();
29
30 boolean isGroupReadable();
31
32 boolean isGroupWritable();
33
34 boolean isGroupExecutable();
35
36 boolean isWorldReadable();
37
38 boolean isWorldWritable();
39
40 boolean isWorldExecutable();
41
42 /**
43 * Gets the unix user id.
44 * @return The unix user id, may be null ("not set"), even on unix
45 */
46 Integer getUserId();
47
48 /**
49 * Gets the unix group id.
50 * @return The unix group id, may be null ("not set"), even on unix
51 */
52 @Nullable
53 Integer getGroupId();
54
55 /**
56 * Returns the user name of the user owning the file. Probably not null :)
57 * @return The user name
58 */
59 @Nullable
60 String getUserName();
61
62 /**
63 * The group name. May be null if groups are unsupported
64 * @return the group names
65 */
66 @Nullable
67 String getGroupName();
68
69 /**
70 * Octal mode attributes.
71 * {@link #UNKNOWN_OCTAL_MODE} if unsupported on current file/file system
72 */
73 int getOctalMode();
74
75 /**
76 * Indicates if this is a symbolic link element.
77 * For file-based resource attributes this value may be always "false" for versions prior to java7.
78 * @return True if the file is a symlink or false if not.
79 */
80 boolean isSymbolicLink();
81 }