Package com.google.common.jimfs
Class BasicAttributeProvider
- java.lang.Object
-
- com.google.common.jimfs.AttributeProvider
-
- com.google.common.jimfs.BasicAttributeProvider
-
final class BasicAttributeProvider extends AttributeProvider
Attribute provider that provides attributes common to all file systems, theBasicFileAttributeView
("basic" or no view prefix), and allows the reading ofBasicFileAttributes
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
BasicAttributeProvider.Attributes
Implementation ofBasicFileAttributes
.private static class
BasicAttributeProvider.View
Implementation ofBasicFileAttributeView
.
-
Field Summary
Fields Modifier and Type Field Description private static com.google.common.collect.ImmutableSet<java.lang.String>
ATTRIBUTES
-
Constructor Summary
Constructors Constructor Description BasicAttributeProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<java.nio.file.attribute.BasicFileAttributes>
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.ImmutableSet<java.lang.String>
fixedAttributes()
Returns the set of attributes that are always available from this provider.@Nullable java.lang.Object
get(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.java.lang.String
name()
Returns the view name that's used to get attributes from this provider.java.nio.file.attribute.BasicFileAttributes
readAttributes(File file)
Reads this provider's attributes from the given file as an attributes object.void
set(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.BasicFileAttributeView
view(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.BasicFileAttributeView>
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
-
-
-
-
Method Detail
-
name
public java.lang.String 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
public com.google.common.collect.ImmutableSet<java.lang.String> fixedAttributes()
Description copied from class:AttributeProvider
Returns the set of attributes that are always available from this provider.- Specified by:
fixedAttributes
in classAttributeProvider
-
get
public @Nullable java.lang.Object get(File file, java.lang.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 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: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
public java.lang.Class<java.nio.file.attribute.BasicFileAttributeView> viewType()
Description copied from class:AttributeProvider
Returns the type of the view interface that this provider supports.- Specified by:
viewType
in classAttributeProvider
-
view
public java.nio.file.attribute.BasicFileAttributeView view(FileLookup lookup, com.google.common.collect.ImmutableMap<java.lang.String,java.nio.file.attribute.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
public java.lang.Class<java.nio.file.attribute.BasicFileAttributes> 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
public java.nio.file.attribute.BasicFileAttributes readAttributes(File file)
Description copied from class:AttributeProvider
Reads this provider's attributes from the given file as an attributes object.- Overrides:
readAttributes
in classAttributeProvider
-
-