Object | +--helma.File
This class represents a local file or directory
Defined in File.js
| SUMMARY: Constructor | Properties | Methods | DETAIL: Constructor | Properties | Methods |
| Constructor Summary | |
helma.File(<String> path)
Constructor for File objects, providing read and write access to the file system. |
|
| Properties Summary | |
Object |
lastError
|
<static> Object |
separator
|
| Methods Summary | |
Boolean
|
canRead()
Tests whether the application can read the file represented by this File object. |
Boolean
|
canWrite()
Tests whether the file represented by this File object is writable. |
void
|
clearError()
Clears any error message that may otherwise be returned by the error method. |
Boolean
|
close()
Closes the file represented by this File object. |
Boolean
|
eof()
Returns true if the file represented by this File object has been read entirely and the end of file has been reached. |
String
|
error()
Contains the last error that occured, if any. |
Boolean
|
exists()
Tests whether the file or directory represented by this File object exists. |
Boolean
|
flush()
Purges the content of the file represented by this File object. |
String
|
getAbsolutePath()
Returns the absolute pathname string of this file. |
Number
|
getLength()
Returns the length of the file represented by this File object. |
String
|
getName()
Returns the name of the file or directory represented by this File object. |
String
|
getParent()
Returns the pathname string of this File object's parent directory. |
String
|
getPath()
Returns the pathname string of this File object. |
Object
|
hardCopy(<String|helma.File> dest)
Makes a copy of a file over partitions. |
Boolean
|
isAbsolute()
Tests whether this File object's pathname is absolute. |
Boolean
|
isDirectory()
Tests whether the file represented by this File object is a directory. |
Boolean
|
isFile()
Tests whether the file represented by this File object is a normal file. |
Boolean
|
isOpened()
Returns true if the file represented by this File object is currently open. |
Number
|
lastModified()
Returns the time when the file represented by this File object was last modified. |
Object
|
list(pattern)
|
Object
|
listRecursive(<RegExp> pattern)
Recursivly lists all files below a given directory you may pass a RegExp Pattern to return just files matching this pattern. |
Boolean
|
makeDirectory()
Creates the directory represented by this File object. |
Object
|
move(<String> dest)
Moves a file to a new destination directory. |
Boolean
|
open()
Opens the file represented by this File object. |
String
|
readAll()
This methods reads all the lines contained in the file and returns them. |
String
|
readln()
This methods reads characters until an end of line/file is encountered then returns the string for these characters (without any end of line character). |
Boolean
|
remove()
Deletes the file or directory represented by this File object. |
Object
|
removeDirectory()
This method removes a directory recursively . |
Boolean
|
renameTo(<String> toFile)
Renames the file represented by this File object. |
Object
|
toByteArray()
Returns file as ByteArray. |
Boolean
|
write(<String> what)
Appends a string to the file represented by this File object. |
Boolean
|
writeln(<String> what)
Appends a string with a platform specific end of line to the file represented by this File object. |
| Constructor Detail |
helma.File(<String> path)
path - as String, can be either absolute or relative to the helma home directory
| Properties Detail |
Object lastError
<static> Object separator
| Method Detail |
Boolean canRead()
Boolean canWrite()
void clearError()
Boolean close()
Boolean eof()
String error()
Boolean exists()
Boolean flush()
String getAbsolutePath()
Number getLength()
String getName()
String getParent()
String getPath()
Object hardCopy(<String|helma.File> dest)
dest - as a File object or the String of full path of the new file
Boolean isAbsolute()
Boolean isDirectory()
Boolean isFile()
Boolean isOpened()
Number lastModified()
Object list(pattern)
Object listRecursive(<RegExp> pattern)
pattern - as RegExp, to test each file name against
Boolean makeDirectory()
Object move(<String> dest)
dest - as String, the full path of the new file
Boolean open()
String readAll()
String readln()
Boolean remove()
Object removeDirectory()
Boolean renameTo(<String> toFile)
toFile - as String, new pathname for the named file
Object toByteArray()
Boolean write(<String> what)
what - as String, to be written to the file
Boolean writeln(<String> what)
what - as String, to be written to the file
| SUMMARY: Constructor | Properties | Methods | DETAIL: Constructor | Properties | Methods |