|
||||||||||
| 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
ewe.io.FileAdapter
This is the class that you should use when implementing a new File object. A fully implemented File object/system can be used by a FileChooser for browsing and manipulation.
| 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 |
FileAdapter()
|
| Method Summary | |
boolean |
createDir()
Creates a directory. |
boolean |
delete()
Deletes the file or directory. |
protected String[] |
doList(String mask,
int listAndSortOptions)
|
protected abstract void |
endFind(int search)
This tells the File to free all resources associated with the find given the search ID returned by startFind(). |
abstract boolean |
exists()
Returns true if the file exists and false otherwise. |
protected abstract Object |
findNext(int search)
This will find the next file in sequence given the search ID returned by startFind(). |
String |
getFullPath()
Return the fully qualified pathname of the file. |
Object |
getInfo(int value,
Object source,
Object resultDestination,
int options)
This method is used to get extended information about the File or the File system in general. |
abstract 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(). |
abstract boolean |
isDirectory()
Returns true if the file is a directory and false otherwise. |
Handle |
listFiles(String mask,
int listAndSortOptions)
List files asynchronously. |
boolean |
move(File dest)
This moves/renames the file to the destination newFile. |
void |
set(File parent,
String file)
This is used to tell the File to represent a different File entity. |
protected void |
setFullPathName(File parent,
String file)
|
Handle |
setInfo(int infoCode,
Object sourceParameters,
int options)
This is used to set extended information about the File or the File system in general. |
protected abstract int |
startFind(String mask)
This is used as the start point for listing. |
RandomAccessStream |
toRandomAccessStream(String mode)
Create and return a RandomAccessStream for reading/writing to the data associated with this File object. |
| Methods inherited from class ewe.io.File |
deleteOnExit, executeFileChooser, getFileChooserClass, length, nativeGetInfo, nativeSetInfo, setFileChooserClass |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass |
| Constructor Detail |
protected FileAdapter()
| Method Detail |
protected void setFullPathName(File parent,
String file)
public void set(File parent,
String file)
set in class Filepublic abstract boolean exists()
File
exists in class Filepublic abstract boolean isDirectory()
File
isDirectory in class Filepublic abstract int getLength()
File
getLength in class Filepublic boolean createDir()
File
createDir in class Filepublic boolean delete()
File
delete in class Filepublic boolean move(File dest)
File
move in class Fileprotected File getNewInstance()
getNewInstance in class File
public RandomAccessStream toRandomAccessStream(String mode)
throws IOException
FileBase
toRandomAccessStream in class FileBasemode - must be "r" or "rw".
IOException - if an open stream could not be created.
public Object getInfo(int value,
Object source,
Object resultDestination,
int options)
File
getInfo in class File
public Handle setInfo(int infoCode,
Object sourceParameters,
int options)
FileBase
setInfo in class File
protected void getSetModified(Time time,
boolean doGet)
FileBase
getSetModified in class File
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 FileIOException
IllegalArgumentExceptionpublic String getFullPath()
File
getFullPath in class File
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 Filemask - The a file maks using '*' characters.listAndSortOptions - LIST_ and SORT_ options ORed together.
protected String[] doList(String mask,
int listAndSortOptions)
protected abstract int startFind(String mask)
protected abstract Object findNext(int search)
protected abstract void endFind(int search)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||