Class OwnerAttributeProvider
java.lang.Object
com.google.common.jimfs.AttributeProvider
com.google.common.jimfs.OwnerAttributeProvider
Attribute provider that provides the
FileOwnerAttributeView ("owner").-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classImplementation ofFileOwnerAttributeView. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final com.google.common.collect.ImmutableSet<String> private static final UserPrincipal -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.collect.ImmutableMap<String, ?> defaultValues(Map<String, ?> userProvidedDefaults) Returns a map containing the default attribute values for this provider.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.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
attributes, attributesType, checkNotCreate, checkType, inherits, invalidType, readAttributes, supports, unsettable
-
Field Details
-
ATTRIBUTES
-
DEFAULT_OWNER
-
-
Constructor Details
-
OwnerAttributeProvider
OwnerAttributeProvider()
-
-
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
-
defaultValues
public com.google.common.collect.ImmutableMap<String,?> defaultValues(Map<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
-
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 FileOwnerAttributeView 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
-