public final class FileAttributeViewMetadata extends Object
FileAttributeView
interface. Instances of this class are immutable.Modifier and Type | Class and Description |
---|---|
static class |
FileAttributeViewMetadata.Builder
A builder for
FileAttributeViewMetadata objects. |
static class |
FileAttributeViewMetadata.Operation
The possible file attribute operations.
|
Modifier and Type | Field and Description |
---|---|
static FileAttributeViewMetadata |
ACL
Metadata for
AclFileAttributeView . |
static FileAttributeViewMetadata |
BASIC
Metadata for
BasicFileAttributeView . |
static FileAttributeViewMetadata |
DOS
Metadata for
DosFileAttributeView . |
static FileAttributeViewMetadata |
FILE_OWNER
Metadata for
FileOwnerAttributeView . |
static FileAttributeViewMetadata |
POSIX
Metadata for
PosixFileAttributeView . |
Modifier and Type | Method and Description |
---|---|
Set<String> |
attributeNames()
Returns the names of the attributes that are supported in the view this metadata object applies to.
|
Set<String> |
attributeNames(FileAttributeViewMetadata.Operation operation)
Returns the names of the attributes that are supported in the view this metadata object applies to for a specific operation.
|
Type |
attributeType(String attributeName)
Returns the type for a specific attribute.
|
static FileAttributeViewMetadata.Builder |
forView(Class<? extends FileAttributeView> viewType)
Creates a builder for
FileAttributeViewMetadata objects. |
boolean |
supportsAttribute(String attributeName)
Checks whether or not an attribute is supported by the view this metadata object applies to.
|
boolean |
supportsAttribute(String attributeName,
FileAttributeViewMetadata.Operation operation)
Checks whether or not an attribute is supported by the view this metadata object applies to for a specific operation.
|
String |
toString() |
String |
viewName()
Returns the name of the view this metadata object applies to.
|
Class<? extends FileAttributeView> |
viewType()
Returns the type of the view this metadata object applies to.
|
public static final FileAttributeViewMetadata BASIC
BasicFileAttributeView
.public static final FileAttributeViewMetadata FILE_OWNER
FileOwnerAttributeView
.public static final FileAttributeViewMetadata DOS
DosFileAttributeView
.public static final FileAttributeViewMetadata POSIX
PosixFileAttributeView
.public static final FileAttributeViewMetadata ACL
AclFileAttributeView
.public Class<? extends FileAttributeView> viewType()
public String viewName()
AttributeView.name()
public Set<String> attributeNames()
public Set<String> attributeNames(FileAttributeViewMetadata.Operation operation)
operation
- The operation to perform - read or write.NullPointerException
- If the given operation is null
.public Type attributeType(String attributeName)
attributeName
- The name of the attribute to return the type for.IllegalArgumentException
- If the given attribute is not supported by the view this metadata object applies to.public boolean supportsAttribute(String attributeName)
attributeName
- The name of the attribute to check.true
if the given attribute is supported by the view this metadata object applies to, or false
otherwise.public boolean supportsAttribute(String attributeName, FileAttributeViewMetadata.Operation operation)
attributeName
- The name of the attribute to check.operation
- The operation to check for - read or write.true
if the given attribute is supported by the view this metadata object applies to for the given operation,
or false
otherwise.NullPointerException
- If the given operation is null
.public static FileAttributeViewMetadata.Builder forView(Class<? extends FileAttributeView> viewType)
FileAttributeViewMetadata
objects.viewType
- The type of the view created metadata objects apply to.NullPointerException
- If the given view type is null
.Copyright © 2016–2023. All rights reserved.