Compartir a través de


File.IsFile Property

Definition

Tests whether the file denoted by this abstract pathname is a normal file.

public virtual bool IsFile { [Android.Runtime.Register("isFile", "()Z", "GetIsFileHandler")] get; }
[<get: Android.Runtime.Register("isFile", "()Z", "GetIsFileHandler")>]
member this.IsFile : bool

Property Value

true if and only if the file denoted by this abstract pathname exists <em>and</em> is a normal file; false otherwise

Attributes

Remarks

Tests whether the file denoted by this abstract pathname is a normal file. A file is <em>normal</em> if it is not a directory and, in addition, satisfies other system-dependent criteria. Any non-directory file created by a Java application is guaranteed to be a normal file.

Where it is required to distinguish an I/O exception from the case that the file is not a normal file, or where several attributes of the same file are required at the same time, then the java.nio.file.Files#readAttributes(Path,Class,LinkOption[]) Files.readAttributes method may be used.

Java documentation for java.io.File.isFile().

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.

Applies to