public class FileSpecs extends Object implements FilePermissions, FileConstants
Modifier and Type | Field and Description |
---|---|
boolean |
exists
Holds whether the file exists.
|
int |
flagsAndPermissions
Contains FilePermissions.FLAG_XXX or the Unix permission values ORed together.
|
boolean |
isDirectory
Holds if the file is a directory.
|
boolean |
isSymbolicLink
Holds if the file is a symbolic link.
|
long |
length
The length of the file if not a directory.
|
long |
modifiedTime
The modified time represented as a long.
|
String |
name
The name or possibly full path of the file.
|
File |
parent
The parent directory.
|
ALL_DOS_FLAGS, ALL_UNIX_PERMISSIONS, FLAG_ARCHIVE, FLAG_HIDDEN, FLAG_READONLY, FLAG_ROM, FLAG_ROMMODULE, FLAG_SYSTEM, FLAG_WINDOWS_ALL_USERS_ACCESS, GROUP_EXECUTE, GROUP_READ, GROUP_WRITE, OTHER_EXECUTE, OTHER_READ, OTHER_WRITE, OWNER_EXECUTE, OWNER_READ, OWNER_WRITE
ClosedFolderIcon, DOS_SYSTEM, DriveIcon, FileIcon, FLAG_CASE_SENSITIVE, FLAG_FILE_SYSTEM_IS_READ_ONLY, FLAG_IS_NETWORK_COMPUTER, FLAG_IS_NETWORK_ROOT, FLAG_IS_ON_NETWORK, FLAG_READ_ONLY, FLAG_SLOW_ACCESS, FLAG_SLOW_CHILD_COUNT, FLAG_SLOW_LIST, INFO_CREATE_TEMP, INFO_CURRENT_DIRECTORY, INFO_DETAIL_NAMES, INFO_DETAIL_WIDTHS, INFO_DETAILS, INFO_DEVICE_ICON, INFO_DEVICE_NAME, INFO_FILE_TIMES, INFO_FLAGS, INFO_FREE_DRIVE_SPACE, INFO_GROUP, INFO_ICON, INFO_LINK_DESTINATION, INFO_OPTION_ICON_LARGE, INFO_OPTION_ICON_MEDIUM, INFO_OPTION_ICON_SMALL, INFO_OWNER, INFO_PROGRAM_DIRECTORY, INFO_ROOT_LIST, INFO_SET_USER_AND_GROUP, INFO_SYMBOLIC_LINK_TARGET, INFO_SYSTEM_TYPE, INFO_TEMPORARY_DIRECTORY, INFO_TOOL_TIP, INFO_TOTAL_DRIVE_SPACE, INFO_VOLUME_FLAGS, INFO_VOLUME_LIST, INFO_VOLUME_PROPERTIES, LIST_ALWAYS_INCLUDE_DIRECTORIES, LIST_BY_DATE, LIST_BY_NAME, LIST_BY_SIZE, LIST_BY_TYPE, LIST_CHECK_FOR_ANY_MATCHING_CHILDREN, LIST_DESCENDING, LIST_DIRECTORIES_FIRST, LIST_DIRECTORIES_LAST, LIST_DIRECTORIES_ONLY, LIST_DONT_LIST_HIDDEN_FILES, LIST_DONT_SORT, LIST_FILES_ONLY, LIST_IGNORE_DIRECTORY_STATUS, MEMORY_SYSTEM, OpenFolderIcon, PageIcon, PALM_SYSTEM, pathSeparator, pathSeparatorChar, separator, separatorChar, UNIX_SYSTEM
VOLUME_FLAG_CDROM, VOLUME_FLAG_FIXED, VOLUME_FLAG_NETWORK, VOLUME_FLAG_RAM, VOLUME_FLAG_REMOVABLE, VOLUME_PROPERTY_BYTES_FREE, VOLUME_PROPERTY_BYTES_TOTAL, VOLUME_PROPERTY_FILESYSTEM_NAME, VOLUME_PROPERTY_NAME
Constructor and Description |
---|
FileSpecs() |
Modifier and Type | Method and Description |
---|---|
void |
cached()
This is called if a FileSpecs object is placed in the cache.
|
static Vector |
filterAndSort(Vector fileSpecs,
String mask,
int listOptions,
Vector destination)
Filter and sort the Vector of FileSpecs according to the file mask and the listOptions.
|
static StringCollator |
getCollator() |
FileSpecs |
getFrom(File src)
Set this FileSpecs to be that of a specific file.
|
static Comparer |
getListComparer(int listOptions)
Get a Comparer that compares two FileSpecs based on the listOptions.
|
int |
listCompare(FileSpecs other,
int listOptions)
Compare this FileSpecs to another based on list sort options.
|
static void |
setCollator(StringCollator collator) |
String |
toString()
This returns the name field of the FileSpec.
|
public File parent
public String name
public int flagsAndPermissions
public boolean exists
public boolean isDirectory
public boolean isSymbolicLink
public long modifiedTime
public long length
public static void setCollator(StringCollator collator)
public static StringCollator getCollator()
public int listCompare(FileSpecs other, int listOptions)
other
- the other FileSpecs.listOptions
- the sort ORed with the directory handling criteria.
The sort criteria can be ONE of LIST_BY_NAME, LIST_BY_TYPE, LIST_BY_DATE, LIST_BY_SIZE.
The directory handling criteria can be ONE of LIST_DIRECTORIES_FIRST, LIST_DIRECTORIES_LAST, LIST_IGNORE_DIRECTORY_STATUS.public static Comparer getListComparer(int listOptions)
listOptions
- the listOptions to use for comparing.public static Vector filterAndSort(Vector fileSpecs, String mask, int listOptions, Vector destination)
fileSpecs
- the list of FileSpec objects.mask
- the mask used to filter the file names.listOptions
- any of the LIST_XXX options ORed together.destination
- a destination Vector to hold the filtered sorted data or null to create and return a new one.public FileSpecs getFrom(File src)
src
- the file to get the data from.public String toString()
public void cached()