public enum FileType extends Enum<FileType>
NONEXISTENT, FILE, DIR (folder), and
UNKNOWN (the file may or may not exist, and, if it does,
its type cannot be determined). On Linux, LINK_FILE and
LINK_DIR also apply to symbolic links that point to
symbolic links (and so on) that eventually point to a file or
directory, respectively.| Enum Constant and Description |
|---|
DIR |
FILE |
LINK_DIR |
LINK_FILE |
LINK_UNKNOWN |
NONEXISTENT |
UNKNOWN |
| Modifier and Type | Method and Description |
|---|---|
static FileType |
get(File file)
Returns the enumerated constant representing the type of the
given file.
|
static FileType |
get(String name)
Returns the enumerated constant representing the type of the
file with the given name.
|
boolean |
isDirectory()
Returns true if the receiver represents a directory (possibly
via a symbolic link).
|
boolean |
isFile()
Returns true if the receiver represents a plain file (possibly
via a symbolic link).
|
boolean |
isSymbolicLink()
Returns true if the receiver represents a symbolic link.
|
static FileType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static FileType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final FileType NONEXISTENT
public static final FileType LINK_FILE
public static final FileType FILE
public static final FileType LINK_DIR
public static final FileType DIR
public static final FileType LINK_UNKNOWN
public static final FileType UNKNOWN
public static FileType[] values()
for (FileType c : FileType.values()) System.out.println(c);
public static FileType valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant
with the specified nameNullPointerException - if the argument is nullpublic static final FileType get(File file)
file - The file. It may be null, in which case
UNKNOWN is returned.public static final FileType get(String name)
name - The file name. It may be null, in which case UNKNOWN is returned.public boolean isSymbolicLink()
public boolean isDirectory()
public boolean isFile()
Copyright © 2015. All Rights Reserved.