|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewe.io.FileSys
ewe.io.FileBase
ewe.io.File
File is a file or directory (similar to the Java File) - it is not used for I/O. Use RandomAccessFile for file I/O or File.getInputStream(), File.getOutputStream() instead.
The File class will not work under the PalmPilot since it does not contain a filesystem.
Note that ewe.io.File objects ARE mutable. The set() method may be used to change the file which is being referred to.
| Field Summary |
| Fields inherited from class ewe.io.FileSys |
DOS_SYSTEM, MEMORY_SYSTEM, PALM_SYSTEM, UNIX_SYSTEM |
| Fields inherited from interface ewe.io.FilePermissions |
ALL_DOS_FLAGS, ALL_UNIX_PERMISSIONS, FLAG_ARCHIVE, FLAG_HIDDEN, FLAG_READONLY, FLAG_ROM, FLAG_ROMMODULE, FLAG_SYSTEM, GROUP_EXECUTE, GROUP_READ, GROUP_WRITE, OTHER_EXECUTE, OTHER_READ, OTHER_WRITE, OWNER_EXECUTE, OWNER_READ, OWNER_WRITE |
| Constructor Summary | |
protected |
File()
|
|
File(File parent,
String path)
Create a File Object which represents a file on the file system under the specified parent directory. |
|
File(String path)
Create a File Object which represents a file on the file system. |
|
File(String parent,
String path)
Create a File Object which represents a file on the file system under the specified parent directory. |
| Method Summary | |
boolean |
createDir()
Creates a directory. |
boolean |
delete()
Deletes the file or directory. |
void |
deleteOnExit()
This tells the system to delete the file when the program exits. |
boolean |
executeFileChooser(FileChooserParameters fcp)
|
boolean |
exists()
Returns true if the file exists and false otherwise. |
static String |
getFileChooserClass()
|
String |
getFullPath()
Return the fully qualified pathname of the file. |
Object |
getInfo(int infoCode,
Object sourceParameters,
Object resultDestination,
int options)
This method is used to get extended information about the File or the File system in general. |
int |
getLength()
Returns the length of the file in bytes. |
protected File |
getNewInstance()
|
protected void |
getSetModified(Time time,
boolean doGet)
This gets/sets the modified time of the file. |
protected int |
getSetPermissionsAndFlags(boolean isGet,
int valuesToSetOrGet,
int valuesToClear)
This is used to implement getPermissionsAndFlags() and changePermissionsAndFlags(). |
boolean |
isDirectory()
Returns true if the file is a directory and false otherwise. |
long |
length()
Return the length of the file in bytes. |
Handle |
listFiles(String mask,
int listAndSortOptions)
List files asynchronously. |
boolean |
move(File newFile)
This moves/renames the file to the destination newFile. |
protected Object |
nativeGetInfo(int infoCode,
Object sourceParameters,
Object resultDestination,
int options)
|
protected boolean |
nativeSetInfo(int infoCode,
Object sourceParameters,
int options)
|
void |
set(File directory,
String path)
Modifies the File to point to a different file on the file system. |
static void |
setFileChooserClass(String className)
|
Handle |
setInfo(int infoCode,
Object sourceParameters,
int options)
This is used to set extended information about the File or the File system in general. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass |
| Constructor Detail |
protected File()
public File(String path)
public File(File parent,
String path)
public File(String parent,
String path)
| Method Detail |
protected File getNewInstance()
getNewInstance in class FileBase
public void set(File directory,
String path)
set in class FileBasepublic boolean createDir()
createDir in class FileBasepublic boolean delete()
delete in class FileBasepublic boolean exists()
exists in class FileBasepublic int getLength()
getLength in class FileBase
public Handle listFiles(String mask,
int listAndSortOptions)
By default this method calls the doList() method and then returns a completed Handle that either indicates success or failure. Methods that inherit from FileBase are encouraged to provide a better version of this (preferrable one that spawns a thread).
listFiles in class FileBasemask - The a file maks using '*' characters.listAndSortOptions - LIST_ and SORT_ options ORed together.
public long length()
public String getFullPath()
getFullPath in class FileBasepublic boolean isDirectory()
isDirectory in class FileBasepublic boolean move(File newFile)
move in class FileBasepublic void deleteOnExit()
deleteOnExit in class FileBase
protected void getSetModified(Time time,
boolean doGet)
FileBase
getSetModified in class FileBase
public Object getInfo(int infoCode,
Object sourceParameters,
Object resultDestination,
int options)
getInfo in class FileBaseinfoCode - one of the INFO_ codes.sourceParameters - A (possibly null) object giving more details for the information to get. The Object
used depends on the infoCode.resultDestination - A (possibly null) object to be used as the destination for the results. The Object
used depends on the infoCode.options - Options or possibly an index value for the info to get.
protected Object nativeGetInfo(int infoCode,
Object sourceParameters,
Object resultDestination,
int options)
public Handle setInfo(int infoCode,
Object sourceParameters,
int options)
FileBase
setInfo in class FileBaseinfoCode - One of a few INFO_values.sourceParameters - The information to set. The object used is dependent on the infoCode.options - Options or possible an index value for the info to set.
protected boolean nativeSetInfo(int infoCode,
Object sourceParameters,
int options)
protected int getSetPermissionsAndFlags(boolean isGet,
int valuesToSetOrGet,
int valuesToClear)
throws IOException,
IllegalArgumentException
FileBaseIf 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 FileBaseIOException
IllegalArgumentExceptionpublic static void setFileChooserClass(String className)
public static String getFileChooserClass()
public boolean executeFileChooser(FileChooserParameters fcp)
throws IllegalStateException
IllegalStateException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||