Class FileAttributes
java.lang.Object
org.codehaus.plexus.components.io.attributes.FileAttributes
- All Implemented Interfaces:
PlexusIoResourceAttributes
- Direct Known Subclasses:
UserGroupModeFileAttributes
-
Field Summary
Fields inherited from interface org.codehaus.plexus.components.io.attributes.PlexusIoResourceAttributes
UNKNOWN_OCTAL_MODE
-
Constructor Summary
ConstructorDescriptionFileAttributes
(File file) FileAttributes
(File file, boolean followLinks) Deprecated.FileAttributes
(Integer userId, String userName, Integer groupId, String groupName, int octalMode, boolean symbolicLink, boolean regularFile, boolean directory, boolean other, Set<PosixFilePermission> permissions, long size, FileTime lastModifiedTime) FileAttributes
(Path path, boolean followLinks) -
Method Summary
Modifier and TypeMethodDescriptionint
Gets the unix group id.The group name.int
Octal mode attributes.protected Set
<PosixFilePermission> long
getSize()
Gets the unix user id.Returns the user name of the user owning the file.boolean
boolean
boolean
boolean
boolean
boolean
boolean
isOther()
boolean
boolean
boolean
boolean
boolean
Indicates if this is a symbolic link element.boolean
boolean
boolean
toString()
static PlexusIoResourceAttributes
-
Field Details
-
FOLLOW_LINK_OPTIONS
-
NOFOLLOW_LINK_OPTIONS
-
-
Constructor Details
-
FileAttributes
@Deprecated public FileAttributes(@Nonnull File file, @Nonnull Map<Integer, String> userCache, @Nonnull Map<Integer, throws IOExceptionString> groupCache) Deprecated.useFileAttributes(File)
and remove the unused userCache and groupCache parameters- Throws:
IOException
-
FileAttributes
- Throws:
IOException
-
FileAttributes
- Throws:
IOException
-
FileAttributes
- Throws:
IOException
-
FileAttributes
-
-
Method Details
-
uncached
- Throws:
IOException
-
getGroupId
Description copied from interface:PlexusIoResourceAttributes
Gets the unix group id.- Specified by:
getGroupId
in interfacePlexusIoResourceAttributes
- Returns:
- The unix group id, may be null ("not set"), even on unix
-
hasGroupId
public boolean hasGroupId() -
hasUserId
public boolean hasUserId() -
getGroupName
Description copied from interface:PlexusIoResourceAttributes
The group name. May be null if groups are unsupported- Specified by:
getGroupName
in interfacePlexusIoResourceAttributes
- Returns:
- the group names
-
getUserId
Description copied from interface:PlexusIoResourceAttributes
Gets the unix user id.- Specified by:
getUserId
in interfacePlexusIoResourceAttributes
- Returns:
- The unix user id, may be null ("not set"), even on unix
-
getUserName
Description copied from interface:PlexusIoResourceAttributes
Returns the user name of the user owning the file. Probably not null :)- Specified by:
getUserName
in interfacePlexusIoResourceAttributes
- Returns:
- The user name
-
isGroupExecutable
public boolean isGroupExecutable()- Specified by:
isGroupExecutable
in interfacePlexusIoResourceAttributes
-
isGroupReadable
public boolean isGroupReadable()- Specified by:
isGroupReadable
in interfacePlexusIoResourceAttributes
-
isGroupWritable
public boolean isGroupWritable()- Specified by:
isGroupWritable
in interfacePlexusIoResourceAttributes
-
isOwnerExecutable
public boolean isOwnerExecutable()- Specified by:
isOwnerExecutable
in interfacePlexusIoResourceAttributes
-
isOwnerReadable
public boolean isOwnerReadable()- Specified by:
isOwnerReadable
in interfacePlexusIoResourceAttributes
-
isOwnerWritable
public boolean isOwnerWritable()- Specified by:
isOwnerWritable
in interfacePlexusIoResourceAttributes
-
isWorldExecutable
public boolean isWorldExecutable()- Specified by:
isWorldExecutable
in interfacePlexusIoResourceAttributes
-
isWorldReadable
public boolean isWorldReadable()- Specified by:
isWorldReadable
in interfacePlexusIoResourceAttributes
-
isWorldWritable
public boolean isWorldWritable()- Specified by:
isWorldWritable
in interfacePlexusIoResourceAttributes
-
toString
-
getOctalMode
public int getOctalMode()Description copied from interface:PlexusIoResourceAttributes
Octal mode attributes.PlexusIoResourceAttributes.UNKNOWN_OCTAL_MODE
if unsupported on current file/file system- Specified by:
getOctalMode
in interfacePlexusIoResourceAttributes
-
calculatePosixOctalMode
public int calculatePosixOctalMode() -
getOctalModeString
-
isSymbolicLink
public boolean isSymbolicLink()Description copied from interface:PlexusIoResourceAttributes
Indicates if this is a symbolic link element. For file-based resource attributes this value may be always "false" for versions prior to java7.- Specified by:
isSymbolicLink
in interfacePlexusIoResourceAttributes
- Returns:
- True if the file is a symlink or false if not.
-
isRegularFile
public boolean isRegularFile() -
isDirectory
public boolean isDirectory() -
isOther
public boolean isOther() -
getSize
public long getSize() -
getLastModifiedTime
-
getPermissions
-
FileAttributes(File)
and remove the unused userCache and groupCache parameters