|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.File
public class File
Implements a file system using pages of flash memory. Currently has limited functionality and only supports one file open at a time.
Field Summary | |
---|---|
static byte |
MAX_FILES
Number of files the file system can store. |
static byte |
totalFiles
The total number of files in the file system. |
Constructor Summary | |
---|---|
File(String name)
Creates a new File object. |
Method Summary | |
---|---|
boolean |
canRead()
|
boolean |
canWrite()
|
boolean |
createNewFile()
Creates a new file entry in the flash memory. |
static void |
defrag()
Defrag the file system. |
boolean |
delete()
Deletes the file represented by this File object. |
void |
exec()
If the file is a binary executable, begins running it. |
boolean |
exists()
Indicates if the file exists in the flash memory. |
static void |
format()
Essentially formats the file system by writing TABLE_ID characters to the first page of flash memory. |
static int |
freeMemory()
Returns to total free memory in the flash file system. |
int |
getIndex()
Returns location of file in the files[] array |
String |
getName()
Returns the name of the file. |
int |
getPage()
Internal method used to get the page number of the start of the file. |
boolean |
isHidden()
|
long |
length()
Returns the length of the file denoted by this file name. |
static File[] |
listFiles()
Returns a list of files in the flash file system. |
void |
moveToTop()
Move the file to become the last one in flash memory. |
static void |
reset()
Reset the files array after an error. |
boolean |
setReadOnly()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte MAX_FILES
public static byte totalFiles
Constructor Detail |
---|
public File(String name)
name
- Method Detail |
---|
public boolean delete()
public void exec()
public static File[] listFiles()
public String getName()
public long length()
public boolean exists()
public boolean canRead()
public boolean canWrite()
public boolean isHidden()
public boolean setReadOnly()
public static void format()
public boolean createNewFile() throws IOException
IOException
public void moveToTop() throws IOException
IOException
public static int freeMemory()
public int getIndex()
public static void defrag() throws IOException
IOException
public int getPage()
public static void reset()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |