Class FileAttributeViewMetadata


  • public final class FileAttributeViewMetadata
    extends Object
    A class that represents metadata of a FileAttributeView interface. Instances of this class are immutable.
    Author:
    Rob Spoor
    Since:
    2.2
    • Method Detail

      • viewType

        public Class<? extends FileAttributeView> viewType()
        Returns the type of the view this metadata object applies to.
        Returns:
        The type of the view this metadata object applies to.
      • viewName

        public String viewName()
        Returns the name of the view this metadata object applies to.
        Returns:
        The name of the view this metadata object applies to.
        See Also:
        AttributeView.name()
      • attributeNames

        public Set<String> attributeNames()
        Returns the names of the attributes that are supported in the view this metadata object applies to. These names are attributes that are readable, writable, or both.
        Returns:
        An unmodifiable set containing the name of the attributes that are supported in the view this metadata object applies to.
      • attributeNames

        public 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.
        Parameters:
        operation - The operation to perform - read or write.
        Returns:
        An unmodifiable set containing the name of the attributes that are supported in the view this metadata object applies to for the given operation.
        Throws:
        NullPointerException - If the given operation is null.
      • attributeType

        public Type attributeType​(String attributeName)
        Returns the type for a specific attribute.
        Parameters:
        attributeName - The name of the attribute to return the type for.
        Returns:
        The type for the given attribute.
        Throws:
        IllegalArgumentException - If the given attribute is not supported by the view this metadata object applies to.
      • supportsAttribute

        public boolean supportsAttribute​(String attributeName)
        Checks whether or not an attribute is supported by the view this metadata object applies to. This method does not make a distinction between readable or writable attributes.
        Parameters:
        attributeName - The name of the attribute to check.
        Returns:
        true if the given attribute is supported by the view this metadata object applies to, or false otherwise.
      • supportsAttribute

        public 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.
        Parameters:
        attributeName - The name of the attribute to check.
        operation - The operation to check for - read or write.
        Returns:
        true if the given attribute is supported by the view this metadata object applies to for the given operation, or false otherwise.
        Throws:
        NullPointerException - If the given operation is null.