public abstract class FileAdapter extends File
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
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
Modifier | Constructor and Description |
---|---|
protected |
FileAdapter() |
protected |
FileAdapter(File directory,
String name) |
protected |
FileAdapter(String name) |
Modifier and Type | Method and Description |
---|---|
boolean |
canRead()
Returns true if the file exists and can be read.
|
boolean |
canWrite() |
abstract boolean |
createDir() |
boolean |
createSymbolicLink(String target)
Create a symbolic link to a specified target file.
|
abstract boolean |
delete() |
abstract void |
deleteOnExit() |
abstract boolean |
exists() |
abstract String |
getFullPath() |
Wrapper |
getInfo(int infoCode,
Wrapper sourceParameters,
int options) |
abstract long |
getLength() |
protected File |
getNewInstance() |
protected abstract long |
getSetModified(long time,
boolean doGet) |
protected int |
getSetPermissionsAndFlags(boolean isGet,
int valuesToSetOrGet,
int valuesToClear)
This is used to implement getPermissionsAndFlags() and changePermissionsAndFlags().
|
int |
getSupportedPermissionsAndFlags(int interestedFlags)
Returns a value indicating which of the flags
specified in the interestedFlags parameter is supported by the
underlying system.
|
File |
getSymbolicLinkTarget()
If this file is a symbolic link, return the target of the link.
|
abstract boolean |
isDirectory() |
boolean |
isSymbolicLink() |
abstract String[] |
list(String mask,
int listAndSortOptions)
Lists the files contained in a directory.
|
CharArray |
list(String mask,
int listAndSortOptions,
CharArray dest) |
abstract boolean |
move(File newFile) |
void |
set(File parent,
String name)
Modifies the File to point to a different file on the file system.
|
protected void |
setFullPathName(File parent,
String file) |
boolean |
setInfo(int infoCode,
Wrapper sourceParameters,
int options) |
File |
toJavaFile()
This returns null by default - since a FileAdapter does not represent an OS File.
|
RandomStream |
toRandomStream(String mode)
Create and return a RandomAccessStream for reading/writing to the data associated with this File object.
|
_jfilegetAbsolutePath, allowAllUsersFullAccess, changePermissionsAndFlags, chmod, chown, createNewFile, createTempFile, createTempFile, equals, filePathsAreEqual, fixupPath, getAbsoluteFile, getAbsolutePath, getBestFileChooser, getCanonicalFile, getCanonicalPath, getChild, getChild, getCopy, getCreationName, getCreationName, getDefaultRoot, getDrivePath, getDrivePath, getFileExt, getFileExt, getFlags, getGroup, getIcon, getInfo, getModified, getName, getNew, getNew, getNewFile, getNewFile, getNewFile, getOwner, getParent, getParentFile, getPermissionsAndFlags, getProgramDirectory, getPropertiesString, getSetInfo, getText, getTrueChild, getTrueParent, hashCode, isAbsolute, isFile, isHidden, isSameFileSystem, isSameVolume, lastModified, list, list, listMultiple, listRoots, listVolumes, makePath, makePath, mkdir, mkdirs, refresh, removeTrailingSlash, removeTrailingSlash, rename, renameTo, roots, setExecutable, setJavaFile, setJavaFile, setLastModified, setModified, setPermissionsAndFlags, setReadable, setReadOnly, setText, setWritable, toReadableStream, toString, toSystemDependantPath, toWritableStream, volumeFlags, volumeProperties, volumes
protected FileAdapter()
protected FileAdapter(String name)
public void set(File parent, String name)
File
public boolean canRead()
File
protected File getNewInstance()
getNewInstance
in class File
public abstract boolean isDirectory()
isDirectory
in class File
public boolean isSymbolicLink()
isSymbolicLink
in class File
public abstract String getFullPath()
getFullPath
in class File
public abstract void deleteOnExit()
deleteOnExit
in class File
public final CharArray list(String mask, int listAndSortOptions, CharArray dest) throws IOException
list
in class File
IOException
public abstract String[] list(String mask, int listAndSortOptions)
File
The default method calls the list() method and then splits the returned char array.
protected abstract long getSetModified(long time, boolean doGet) throws IOException
getSetModified
in class File
IOException
public boolean setInfo(int infoCode, Wrapper sourceParameters, int options)
protected int getSetPermissionsAndFlags(boolean isGet, int valuesToSetOrGet, int valuesToClear) throws IOException
File
If isGet is true, then the valuesToSetOrGet parameter will hold the flags that the user is interested in. If any of these flags are invalid on this system an IllegalArgumentException should be thrown. Otherwise the current state of the flags should be returned - it is OK to return extra flags even if they are not specified as flags the user is interested in.
If isGet is false, then the valuesToSetOrGet parameter will hold the flags to set and the valuesToClear parameter will hold the flags to clear. If any of these are not valid then an IllegalArgumentException should be thrown. Otherwise the flags should be changed and then the state of the flags AFTER the change has been made should be returned.
getSetPermissionsAndFlags
in class File
IOException
public int getSupportedPermissionsAndFlags(int interestedFlags)
getSupportedPermissionsAndFlags
in class File
interestedFlags
- the flags you wish to check OR'ed together.public boolean createSymbolicLink(String target)
createSymbolicLink
in class File
target
- the file to link to.public File getSymbolicLinkTarget()
getSymbolicLinkTarget
in class File
public File toJavaFile()
toJavaFile
in class File
public RandomStream toRandomStream(String mode) throws IOException
toRandomStream
in class File
mode
- must be "r" or "rw".IOException
- if an open stream could not be created.IllegalArgument
- exception if mode is not "r" or "rw"