Class DosAttributeProvider

java.lang.Object
com.google.common.jimfs.AttributeProvider
com.google.common.jimfs.DosAttributeProvider

final class DosAttributeProvider extends AttributeProvider
Attribute provider that provides the DosFileAttributeView ("dos") and allows the reading of DosFileAttributes.
  • Field Details

    • ATTRIBUTES

      private static final com.google.common.collect.ImmutableSet<String> ATTRIBUTES
    • INHERITED_VIEWS

      private static final com.google.common.collect.ImmutableSet<String> INHERITED_VIEWS
  • Constructor Details

    • DosAttributeProvider

      DosAttributeProvider()
  • Method Details

    • name

      public String name()
      Description copied from class: AttributeProvider
      Returns the view name that's used to get attributes from this provider.
      Specified by:
      name in class AttributeProvider
    • inherits

      public com.google.common.collect.ImmutableSet<String> inherits()
      Description copied from class: AttributeProvider
      Returns the names of other providers that this provider inherits attributes from.
      Overrides:
      inherits in class AttributeProvider
    • fixedAttributes

      public com.google.common.collect.ImmutableSet<String> fixedAttributes()
      Description copied from class: AttributeProvider
      Returns the set of attributes that are always available from this provider.
      Specified by:
      fixedAttributes in class AttributeProvider
    • defaultValues

      public com.google.common.collect.ImmutableMap<String,?> defaultValues(Map<String,?> userProvidedDefaults)
      Description copied from class: AttributeProvider
      Returns a map containing the default attribute values for this provider. The keys of the map are attribute identifier strings (in "view:attribute" form) and the value for each is the default value that should be set for that attribute when creating a new file.

      The given map should be in the same format and contains user-provided default values. If the user provided any default values for attributes handled by this provider, those values should be checked to ensure they are of the correct type. Additionally, if any changes to a user-provided attribute are necessary (for example, creating an immutable defensive copy), that should be done. The resulting values should be included in the result map along with default values for any attributes the user did not provide a value for.

      Overrides:
      defaultValues in class AttributeProvider
    • getDefaultValue

      private static Boolean getDefaultValue(String attribute, Map<String,?> userProvidedDefaults)
    • get

      public @Nullable Object get(File file, String attribute)
      Description copied from class: AttributeProvider
      Returns the value of the given attribute in the given file or null if the attribute is not supported by this provider.
      Specified by:
      get in class AttributeProvider
    • set

      public void set(File file, String view, String attribute, Object value, boolean create)
      Description copied from class: AttributeProvider
      Sets the value of the given attribute in the given file object. The create parameter indicates whether or not the value is being set upon creation of a new file via a user-provided FileAttribute.
      Specified by:
      set in class AttributeProvider
    • viewType

      public Class<DosFileAttributeView> viewType()
      Description copied from class: AttributeProvider
      Returns the type of the view interface that this provider supports.
      Specified by:
      viewType in class AttributeProvider
    • view

      public DosFileAttributeView view(FileLookup lookup, com.google.common.collect.ImmutableMap<String,FileAttributeView> inheritedViews)
      Description copied from class: AttributeProvider
      Returns a view of the file located by the given lookup callback. The given map contains the views inherited by this view.
      Specified by:
      view in class AttributeProvider
    • attributesType

      public Class<DosFileAttributes> attributesType()
      Description copied from class: AttributeProvider
      Returns the type of file attributes object this provider supports, or null if it doesn't support reading its attributes as an object.
      Overrides:
      attributesType in class AttributeProvider
    • readAttributes

      public DosFileAttributes readAttributes(File file)
      Description copied from class: AttributeProvider
      Reads this provider's attributes from the given file as an attributes object.
      Overrides:
      readAttributes in class AttributeProvider