|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Object | +--File
Defined in file.js
| Field Summary | |
string |
ext
|
int |
lastModified
|
string |
leaf
|
string |
name
|
nsIFile |
nsIFile
|
string |
path
|
int |
permissions
|
| Constructor Summary | |
File( aPath )
|
|
| Method Summary | |
boolean
|
append( <string> arg )
Constructs a descendent of the current file. |
boolean
|
canRead( )
Tests whether this file can be read with the current permissions. |
boolean
|
canWrite( )
Tests whether this file can be written to with the current permissions. |
void
|
close( )
Closes the current file object to further reading or writing. |
void
|
create( type )
Creates the file in the filesystem. |
boolean
|
exists( )
Whether the file exists in the filesystem or not |
string
|
getExtension( )
Returns everything after the name. |
int
|
getLastModified( )
Returns the the last time this file object was modified Requires file to exist. |
string
|
getLeaf( )
Returns everything after the path |
string
|
getName( )
Returns everything after the path and before the extension. |
nsIFIle
|
getNSIFile( )
|
File
|
getParent( )
Returns a File instance of this object's parent |
Object
|
getPath( <string> type )
|
int
|
getPermissions( )
Returns the permissions of the current file object. |
boolean
|
isDir( )
Tests whether this object represents a directory. |
boolean
|
isFile( )
Tests whether this object represents a file. |
boolean
|
move( <Object> arg )
Requires the file to exist. |
boolean
|
open( <string> arg )
Prepares the current file object for reading or writing. |
string
|
read( <int> size )
Performs a read on the underlying file object. |
array
|
readAllLines( )
Reads all lines of the file into an Array object If another type of read operation has or will be performed, a close() and open() must be done first. |
string
|
readBase64( )
Read the entire file with Base64 encoding. |
array
|
readByteArray( )
Read the file as an array of bytes. |
string
|
readLine( )
Reads a single line of string text terminated by a CR, LF, CRLF, LFCR, or eof. |
boolean
|
remove( )
Removes the current file from the filesystem. |
boolean
|
rename( <string> arg )
Renames the file. |
void
|
setPermissions( <int> arg )
Sets permissions of the current file object. |
boolean
|
write( arg )
Performs a write on the underlying nsIFile object. |
| Field Detail |
string ext
int lastModified
string leaf
string name
nsIFile nsIFile
string path
int permissions
| Constructor Detail |
File( aPath )
aeither - a string file uri path, nsIURI with 'file' scheme, or native string file uri (eg "/tmp/blah/" on mac/linux)
| Method Detail |
boolean append( <string> arg )
arg - name of the new descendent.
boolean canRead( )
boolean canWrite( )
void close( )
void create( type )
arg - "dir": to create a directory; "file" to create a file.
boolean exists( )
string getExtension( )
int getLastModified( )
string getLeaf( )
string getName( )
nsIFIle getNSIFile( )
File getParent( )
Object getPath( <string> type )
type - specifying format of path to return. Either "native": platorm native path; "uri": an nsIURI object; "": uri as a string
int getPermissions( )
boolean isDir( )
boolean isFile( )
boolean move( <Object> arg )
arg - nsIFile, nsIURI, string path, or another File object where the current file will be moved to
boolean open( <string> arg )
arg - "r" for read, "w" for write, "a" for append
string read( <int> size )
size - How much to read, assumed to be nsIFile.fileSize if not specified
array readAllLines( )
string readBase64( )
array readByteArray( )
string readLine( )
boolean remove( )
boolean rename( <string> arg )
arg - new name.
void setPermissions( <int> arg )
arg - A hexadecimal value: eg 0664
boolean write( arg )
What - to write
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||