Dela via


ISecureDirectoryStream Interface

Definition

A DirectoryStream that defines operations on files that are located relative to an open directory.

[Android.Runtime.Register("java/nio/file/SecureDirectoryStream", "", "Java.Nio.FileNio.ISecureDirectoryStreamInvoker", ApiSince=26)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public interface ISecureDirectoryStream : IDisposable, Java.Interop.IJavaPeerable, Java.Nio.FileNio.IDirectoryStream
[<Android.Runtime.Register("java/nio/file/SecureDirectoryStream", "", "Java.Nio.FileNio.ISecureDirectoryStreamInvoker", ApiSince=26)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
type ISecureDirectoryStream = interface
    interface IDirectoryStream
    interface ICloseable
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
    interface IIterable
Attributes
Implements

Remarks

A DirectoryStream that defines operations on files that are located relative to an open directory. A SecureDirectoryStream is intended for use by sophisticated or security sensitive applications requiring to traverse file trees or otherwise operate on directories in a race-free manner. Race conditions can arise when a sequence of file operations cannot be carried out in isolation. Each of the file operations defined by this interface specify a relative path. All access to the file is relative to the open directory irrespective of if the directory is moved or replaced by an attacker while the directory is open. A SecureDirectoryStream may also be used as a virtual <em>working directory</em>.

A SecureDirectoryStream requires corresponding support from the underlying operating system. Where an implementation supports this features then the DirectoryStream returned by the Files#newDirectoryStream newDirectoryStream method will be a SecureDirectoryStream and must be cast to that type in order to invoke the methods defined by this interface.

In the case of the default java.nio.file.spi.FileSystemProvider provider, and a security manager is set, then the permission checks are performed using the path obtained by resolving the given relative path against the original path of the directory (irrespective of if the directory is moved since it was opened).

Added in 1.7.

Java documentation for java.nio.file.SecureDirectoryStream.

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

Close()

Closes this stream and releases any system resources associated with it.

(Inherited from ICloseable)
DeleteDirectory(Object)

Deletes a directory.

DeleteFile(Object)

Deletes a file.

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)
ForEach(IConsumer)

Performs the given action for each element of the Iterable until all elements have been processed or the action throws an exception.

(Inherited from IIterable)
GetFileAttributeView(Class)

Returns a new file attribute view to access the file attributes of this directory.

GetFileAttributeView(Object, Class, LinkOption[])

Returns a new file attribute view to access the file attributes of this directory.

Iterator()

Returns the iterator associated with this DirectoryStream.

(Inherited from IDirectoryStream)
Move(Object, ISecureDirectoryStream, Object)

Move a file from this directory to another directory.

NewByteChannel(Object, ICollection<IOpenOption>, IFileAttribute[])

Opens or creates a file in this directory, returning a seekable byte channel to access the file.

NewDirectoryStream(Object, LinkOption[])

Opens the directory identified by the given path, returning a SecureDirectoryStream to iterate over the entries in the directory.

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)
Spliterator()

Creates a Spliterator over the elements described by this Iterable.

(Inherited from IIterable)
UnregisterFromRuntime()

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

(Inherited from IJavaPeerable)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)
ToEnumerable(IIterable)
ToEnumerable<T>(IIterable)

Applies to