Package com.google.common.jimfs
Class DosAttributeProvider
- java.lang.Object
-
- com.google.common.jimfs.AttributeProvider
-
- com.google.common.jimfs.DosAttributeProvider
-
final class DosAttributeProvider extends AttributeProvider
Attribute provider that provides theDosFileAttributeView("dos") and allows the reading ofDosFileAttributes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classDosAttributeProvider.AttributesImplementation ofDosFileAttributes.private static classDosAttributeProvider.ViewImplementation ofDosFileAttributeView.
-
Field Summary
Fields Modifier and Type Field Description private static com.google.common.collect.ImmutableSet<java.lang.String>ATTRIBUTESprivate static com.google.common.collect.ImmutableSet<java.lang.String>INHERITED_VIEWS
-
Constructor Summary
Constructors Constructor Description DosAttributeProvider()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<java.nio.file.attribute.DosFileAttributes>attributesType()Returns the type of file attributes object this provider supports, or null if it doesn't support reading its attributes as an object.com.google.common.collect.ImmutableMap<java.lang.String,?>defaultValues(java.util.Map<java.lang.String,?> userProvidedDefaults)Returns a map containing the default attribute values for this provider.com.google.common.collect.ImmutableSet<java.lang.String>fixedAttributes()Returns the set of attributes that are always available from this provider.@Nullable java.lang.Objectget(File file, java.lang.String attribute)Returns the value of the given attribute in the given file or null if the attribute is not supported by this provider.private static java.lang.BooleangetDefaultValue(java.lang.String attribute, java.util.Map<java.lang.String,?> userProvidedDefaults)com.google.common.collect.ImmutableSet<java.lang.String>inherits()Returns the names of other providers that this provider inherits attributes from.java.lang.Stringname()Returns the view name that's used to get attributes from this provider.java.nio.file.attribute.DosFileAttributesreadAttributes(File file)Reads this provider's attributes from the given file as an attributes object.voidset(File file, java.lang.String view, java.lang.String attribute, java.lang.Object value, boolean create)Sets the value of the given attribute in the given file object.java.nio.file.attribute.DosFileAttributeViewview(FileLookup lookup, com.google.common.collect.ImmutableMap<java.lang.String,java.nio.file.attribute.FileAttributeView> inheritedViews)Returns a view of the file located by the given lookup callback.java.lang.Class<java.nio.file.attribute.DosFileAttributeView>viewType()Returns the type of the view interface that this provider supports.-
Methods inherited from class com.google.common.jimfs.AttributeProvider
attributes, checkNotCreate, checkType, invalidType, supports, unsettable
-
-
-
-
Method Detail
-
name
public java.lang.String name()
Description copied from class:AttributeProviderReturns the view name that's used to get attributes from this provider.- Specified by:
namein classAttributeProvider
-
inherits
public com.google.common.collect.ImmutableSet<java.lang.String> inherits()
Description copied from class:AttributeProviderReturns the names of other providers that this provider inherits attributes from.- Overrides:
inheritsin classAttributeProvider
-
fixedAttributes
public com.google.common.collect.ImmutableSet<java.lang.String> fixedAttributes()
Description copied from class:AttributeProviderReturns the set of attributes that are always available from this provider.- Specified by:
fixedAttributesin classAttributeProvider
-
defaultValues
public com.google.common.collect.ImmutableMap<java.lang.String,?> defaultValues(java.util.Map<java.lang.String,?> userProvidedDefaults)
Description copied from class:AttributeProviderReturns 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:
defaultValuesin classAttributeProvider
-
getDefaultValue
private static java.lang.Boolean getDefaultValue(java.lang.String attribute, java.util.Map<java.lang.String,?> userProvidedDefaults)
-
get
public @Nullable java.lang.Object get(File file, java.lang.String attribute)
Description copied from class:AttributeProviderReturns the value of the given attribute in the given file or null if the attribute is not supported by this provider.- Specified by:
getin classAttributeProvider
-
set
public void set(File file, java.lang.String view, java.lang.String attribute, java.lang.Object value, boolean create)
Description copied from class:AttributeProviderSets the value of the given attribute in the given file object. Thecreateparameter indicates whether or not the value is being set upon creation of a new file via a user-providedFileAttribute.- Specified by:
setin classAttributeProvider
-
viewType
public java.lang.Class<java.nio.file.attribute.DosFileAttributeView> viewType()
Description copied from class:AttributeProviderReturns the type of the view interface that this provider supports.- Specified by:
viewTypein classAttributeProvider
-
view
public java.nio.file.attribute.DosFileAttributeView view(FileLookup lookup, com.google.common.collect.ImmutableMap<java.lang.String,java.nio.file.attribute.FileAttributeView> inheritedViews)
Description copied from class:AttributeProviderReturns a view of the file located by the given lookup callback. The given map contains the views inherited by this view.- Specified by:
viewin classAttributeProvider
-
attributesType
public java.lang.Class<java.nio.file.attribute.DosFileAttributes> attributesType()
Description copied from class:AttributeProviderReturns the type of file attributes object this provider supports, or null if it doesn't support reading its attributes as an object.- Overrides:
attributesTypein classAttributeProvider
-
readAttributes
public java.nio.file.attribute.DosFileAttributes readAttributes(File file)
Description copied from class:AttributeProviderReads this provider's attributes from the given file as an attributes object.- Overrides:
readAttributesin classAttributeProvider
-
-