Class UserDefinedAttributeProvider
java.lang.Object
com.google.common.jimfs.AttributeProvider
com.google.common.jimfs.UserDefinedAttributeProvider
Attribute provider that provides the
UserDefinedFileAttributeView ("user"). Unlike most
other attribute providers, this one has no pre-defined set of attributes. Rather, it allows
arbitrary user defined attributes to be set (as ByteBuffer or byte[]) and read
(as byte[]).-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classImplementation ofUserDefinedFileAttributeView. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.collect.ImmutableSet<String> attributes(File file) Returns the set of attributes supported by this view that are present in the given file.com.google.common.collect.ImmutableSet<String> Returns the set of attributes that are always available from this provider.@Nullable ObjectReturns the value of the given attribute in the given file or null if the attribute is not supported by this provider.name()Returns the view name that's used to get attributes from this provider.voidSets the value of the given attribute in the given file object.booleanReturns whether or not this provider supports the given attribute directly.private static com.google.common.collect.ImmutableSet<String> userDefinedAttributes(File file) view(FileLookup lookup, com.google.common.collect.ImmutableMap<String, FileAttributeView> inheritedViews) Returns a view of the file located by the given lookup callback.viewType()Returns the type of the view interface that this provider supports.Methods inherited from class AttributeProvider
attributesType, checkNotCreate, checkType, defaultValues, inherits, invalidType, readAttributes, unsettable
-
Constructor Details
-
UserDefinedAttributeProvider
UserDefinedAttributeProvider()
-
-
Method Details
-
name
Description copied from class:AttributeProviderReturns the view name that's used to get attributes from this provider.- Specified by:
namein classAttributeProvider
-
fixedAttributes
Description copied from class:AttributeProviderReturns the set of attributes that are always available from this provider.- Specified by:
fixedAttributesin classAttributeProvider
-
supports
Description copied from class:AttributeProviderReturns whether or not this provider supports the given attribute directly.- Overrides:
supportsin classAttributeProvider
-
attributes
Description copied from class:AttributeProviderReturns the set of attributes supported by this view that are present in the given file. For most providers, this will be a fixed set of attributes.- Overrides:
attributesin classAttributeProvider
-
userDefinedAttributes
-
get
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
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
Description copied from class:AttributeProviderReturns the type of the view interface that this provider supports.- Specified by:
viewTypein classAttributeProvider
-
view
public UserDefinedFileAttributeView view(FileLookup lookup, com.google.common.collect.ImmutableMap<String, 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
-