Package com.google.common.jimfs
Class UnixAttributeProvider
- java.lang.Object
-
- com.google.common.jimfs.AttributeProvider
-
- com.google.common.jimfs.UnixAttributeProvider
-
final class UnixAttributeProvider extends AttributeProvider
Attribute provider that provides the "unix" attribute view.
-
-
Field Summary
Fields Modifier and Type Field Description private static com.google.common.collect.ImmutableSet<java.lang.String>ATTRIBUTESprivate java.util.concurrent.ConcurrentMap<java.lang.Object,java.lang.Integer>idCacheprivate static com.google.common.collect.ImmutableSet<java.lang.String>INHERITED_VIEWSprivate java.util.concurrent.atomic.AtomicIntegeruidGenerator
-
Constructor Summary
Constructors Constructor Description UnixAttributeProvider()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 java.lang.IntegergetUniqueId(java.lang.Object object)Returns an ID that is guaranteed to be the same for any invocation with equal objects.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.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.private static inttoMode(java.util.Set<java.nio.file.attribute.PosixFilePermission> permissions)UnixFileAttributeViewview(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<UnixFileAttributeView>viewType()Returns the type of the view interface that this provider supports.-
Methods inherited from class com.google.common.jimfs.AttributeProvider
attributes, attributesType, checkNotCreate, checkType, defaultValues, invalidType, readAttributes, supports, unsettable
-
-
-
-
Field Detail
-
ATTRIBUTES
private static final com.google.common.collect.ImmutableSet<java.lang.String> ATTRIBUTES
-
INHERITED_VIEWS
private static final com.google.common.collect.ImmutableSet<java.lang.String> INHERITED_VIEWS
-
uidGenerator
private final java.util.concurrent.atomic.AtomicInteger uidGenerator
-
idCache
private final java.util.concurrent.ConcurrentMap<java.lang.Object,java.lang.Integer> idCache
-
-
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
-
viewType
public java.lang.Class<UnixFileAttributeView> viewType()
Description copied from class:AttributeProviderReturns the type of the view interface that this provider supports.- Specified by:
viewTypein classAttributeProvider
-
view
public UnixFileAttributeView 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
-
getUniqueId
private java.lang.Integer getUniqueId(java.lang.Object object)
Returns an ID that is guaranteed to be the same for any invocation with equal objects.
-
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
-
toMode
private static int toMode(java.util.Set<java.nio.file.attribute.PosixFilePermission> permissions)
-
-