Package com.google.common.jimfs
Class BasicAttributeProvider
java.lang.Object
com.google.common.jimfs.AttributeProvider
com.google.common.jimfs.BasicAttributeProvider
Attribute provider that provides attributes common to all file systems, the
BasicFileAttributeView
("basic" or no view prefix), and allows the reading of BasicFileAttributes
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
Implementation ofBasicFileAttributes
.private static final class
Implementation ofBasicFileAttributeView
. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final com.google.common.collect.ImmutableSet
<String> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns 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.ImmutableSet
<String> Returns the set of attributes that are always available from this provider.@Nullable Object
Returns 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.readAttributes
(File file) Reads this provider's attributes from the given file as an attributes object.void
Sets 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 com.google.common.jimfs.AttributeProvider
attributes, checkNotCreate, checkType, defaultValues, inherits, invalidType, supports, unsettable
-
Field Details
-
ATTRIBUTES
-
-
Constructor Details
-
BasicAttributeProvider
BasicAttributeProvider()
-
-
Method Details
-
name
Description copied from class:AttributeProvider
Returns the view name that's used to get attributes from this provider.- Specified by:
name
in classAttributeProvider
-
fixedAttributes
Description copied from class:AttributeProvider
Returns the set of attributes that are always available from this provider.- Specified by:
fixedAttributes
in classAttributeProvider
-
get
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 classAttributeProvider
-
set
Description copied from class:AttributeProvider
Sets the value of the given attribute in the given file object. Thecreate
parameter indicates whether or not the value is being set upon creation of a new file via a user-providedFileAttribute
.- Specified by:
set
in classAttributeProvider
-
viewType
Description copied from class:AttributeProvider
Returns the type of the view interface that this provider supports.- Specified by:
viewType
in classAttributeProvider
-
view
public BasicFileAttributeView 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 classAttributeProvider
-
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 classAttributeProvider
-
readAttributes
Description copied from class:AttributeProvider
Reads this provider's attributes from the given file as an attributes object.- Overrides:
readAttributes
in classAttributeProvider
-