public class RapiFile extends FileAdapter
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
Constructor and Description |
---|
RapiFile(File parent,
String file) |
RapiFile(String file) |
Modifier and Type | Method and Description |
---|---|
boolean |
canWrite() |
boolean |
createDir()
Creates a directory.
|
boolean |
createSymbolicLink(String target)
Create a symbolic link to a specified target file.
|
boolean |
delete()
Deletes the file or directory.
|
void |
deleteOnExit()
This does nothing on a RapiFile.
|
boolean |
exists()
Returns true if the file exists and false otherwise.
|
String |
getFullPath() |
Wrapper |
getInfo(int infoCode,
Wrapper sourceParameters,
int options) |
long |
getLength() |
File |
getNew(File parent,
String file)
Get a new File object given the directory and new path.
|
protected long |
getSetModified(long value,
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.
|
boolean |
isDirectory()
Returns true if the file is a directory and false otherwise.
|
boolean |
isHidden()
This returns true if the file should be considered hidden.
|
boolean |
isSymbolicLink()
Returns true if the file is a symbolic link.
|
String[] |
list(String mask,
int listAndSortOptions)
Lists the files contained in a directory.
|
boolean |
move(File newFile)
This moves/renames the file to the destination new File.
|
void |
set(File parent,
String file)
Modifies the File to point to a different file on the file system.
|
RandomStream |
toRandomStream(String mode)
Create and return a RandomAccessStream for reading/writing to the data associated with this File object.
|
canRead, getNewInstance, getSymbolicLinkTarget, list, setFullPathName, setInfo, toJavaFile
_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, getNewFile, getNewFile, getNewFile, getOwner, getParent, getParentFile, getPermissionsAndFlags, getProgramDirectory, getPropertiesString, getSetInfo, getText, getTrueChild, getTrueParent, hashCode, isAbsolute, isFile, 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
public RapiFile(String file)
protected int getSetPermissionsAndFlags(boolean isGet, int valuesToSetOrGet, int valuesToClear) throws IOException
If isGet is true, then the valuesToSetOrGet parameter will hold the flags that 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.
The method should return the final flags for the file.
getSetPermissionsAndFlags
in class FileAdapter
IOException
public int getSupportedPermissionsAndFlags(int interestedFlags)
getSupportedPermissionsAndFlags
in class FileAdapter
interestedFlags
- the flags you wish to check OR'ed together.public boolean createDir()
createDir
in class FileAdapter
public boolean createSymbolicLink(String target)
createSymbolicLink
in class FileAdapter
target
- the file to link to.public boolean delete()
delete
in class FileAdapter
public boolean canWrite()
canWrite
in class FileAdapter
public boolean isHidden()
public boolean exists()
exists
in class FileAdapter
public boolean isDirectory()
isDirectory
in class FileAdapter
public boolean isSymbolicLink()
isSymbolicLink
in class FileAdapter
public boolean move(File newFile)
move
in class FileAdapter
public long getLength()
getLength
in class FileAdapter
public void set(File parent, String file)
File
set
in class FileAdapter
public File getNew(File parent, String file)
File
public Wrapper getInfo(int infoCode, Wrapper sourceParameters, int options)
getInfo
in class FileAdapter
protected long getSetModified(long value, boolean doGet) throws IOException
getSetModified
in class FileAdapter
IOException
public String getFullPath()
getFullPath
in class FileAdapter
public RandomStream toRandomStream(String mode) throws IOException
toRandomStream
in class FileAdapter
mode
- must be "r" or "rw".IOException
- if an open stream could not be created.IllegalArgument
- exception if mode is not "r" or "rw"public void deleteOnExit()
deleteOnExit
in class FileAdapter
public String[] list(String mask, int listAndSortOptions)
File
The default method calls the list() method and then splits the returned char array.
list
in class FileAdapter
mask
- A file mask.listAndSortOptions
- Use the LIST_XXX values OR'ed together.