Udostępnij za pośrednictwem


IUserDefinedFileAttributeView Interface

Definition

A file attribute view that provides a view of a file's user-defined attributes, sometimes known as <em>extended attributes</em>.

[Android.Runtime.Register("java/nio/file/attribute/UserDefinedFileAttributeView", "", "Java.Nio.FileNio.Attributes.IUserDefinedFileAttributeViewInvoker", ApiSince=26)]
public interface IUserDefinedFileAttributeView : IDisposable, Java.Interop.IJavaPeerable, Java.Nio.FileNio.Attributes.IFileAttributeView
[<Android.Runtime.Register("java/nio/file/attribute/UserDefinedFileAttributeView", "", "Java.Nio.FileNio.Attributes.IUserDefinedFileAttributeViewInvoker", ApiSince=26)>]
type IUserDefinedFileAttributeView = interface
    interface IFileAttributeView
    interface IAttributeView
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Attributes
Implements

Remarks

A file attribute view that provides a view of a file's user-defined attributes, sometimes known as <em>extended attributes</em>. User-defined file attributes are used to store metadata with a file that is not meaningful to the file system. It is primarily intended for file system implementations that support such a capability directly but may be emulated. The details of such emulation are highly implementation specific and therefore not specified.

This FileAttributeView provides a view of a file's user-defined attributes as a set of name/value pairs, where the attribute name is represented by a String. An implementation may require to encode and decode from the platform or file system representation when accessing the attribute. The value has opaque content. This attribute view defines the #read read and #write write methods to read the value into or write from a ByteBuffer. This FileAttributeView is not intended for use where the size of an attribute value is larger than Integer#MAX_VALUE.

User-defined attributes may be used in some implementations to store security related attributes so consequently, in the case of the default provider at least, all methods that access user-defined attributes require the RuntimePermission("accessUserDefinedAttributes") permission when a security manager is installed.

The java.nio.file.FileStore#supportsFileAttributeView supportsFileAttributeView method may be used to test if a specific java.nio.file.FileStore FileStore supports the storage of user-defined attributes.

Where dynamic access to file attributes is required, the java.nio.file.Files#getAttribute getAttribute method may be used to read the attribute value. The attribute value is returned as a byte array (byte[]). The java.nio.file.Files#setAttribute setAttribute method may be used to write the value of a user-defined attribute from a buffer (as if by invoking the #write write method), or byte array (byte[]).

Added in 1.7.

Java documentation for java.nio.file.attribute.UserDefinedFileAttributeView.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Properties

Handle

Gets the JNI value of the underlying Android object.

(Inherited from IJavaObject)
JniIdentityHashCode

Returns the value of java.lang.System.identityHashCode() for the wrapped instance.

(Inherited from IJavaPeerable)
JniManagedPeerState

State of the managed peer.

(Inherited from IJavaPeerable)
JniPeerMembers

Member access and invocation support.

(Inherited from IJavaPeerable)
PeerReference

Returns a JniObjectReference of the wrapped Java object instance.

(Inherited from IJavaPeerable)

Methods

Delete(String)

Deletes a user-defined attribute.

Disposed()

Called when the instance has been disposed.

(Inherited from IJavaPeerable)
DisposeUnlessReferenced()

If there are no outstanding references to this instance, then calls Dispose(); otherwise, does nothing.

(Inherited from IJavaPeerable)
Finalized()

Called when the instance has been finalized.

(Inherited from IJavaPeerable)
List()

Returns a list containing the names of the user-defined attributes.

Name()

Returns the name of this attribute view.

Read(String, ByteBuffer)

Read the value of a user-defined attribute into a buffer.

SetJniIdentityHashCode(Int32)

Set the value returned by JniIdentityHashCode.

(Inherited from IJavaPeerable)
SetJniManagedPeerState(JniManagedPeerStates) (Inherited from IJavaPeerable)
SetPeerReference(JniObjectReference)

Set the value returned by PeerReference.

(Inherited from IJavaPeerable)
Size(String)

Returns the size of the value of a user-defined attribute.

UnregisterFromRuntime()

Unregister this instance so that the runtime will not return it from future Java.Interop.JniRuntime+JniValueManager.PeekValue invocations.

(Inherited from IJavaPeerable)
Write(String, ByteBuffer)

Writes the value of a user-defined attribute from a buffer.

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to