helma.File

Object
   |
   +--helma.File


This class represents a local file or directory
Defined in File.js



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

helma.File(<String> path)

Properties Detail

lastError

Object lastError

separator

<static> Object separator

Method Detail

canRead

Boolean canRead()

canWrite

Boolean canWrite()

clearError

void clearError()

close

Boolean close()

eof

Boolean eof()

error

String error()

exists

Boolean exists()

flush

Boolean flush()

getAbsolutePath

String getAbsolutePath()

getLength

Number getLength()

getName

String getName()

getParent

String getParent()

getPath

String getPath()

hardCopy

Object hardCopy(<String|helma.File> dest)

isAbsolute

Boolean isAbsolute()

isDirectory

Boolean isDirectory()

isFile

Boolean isFile()

isOpened

Boolean isOpened()

lastModified

Number lastModified()

list

Object list(pattern)

listRecursive

Object listRecursive(<RegExp> pattern)

makeDirectory

Boolean makeDirectory()

move

Object move(<String> dest)

open

Boolean open()

readAll

String readAll()

readln

String readln()

remove

Boolean remove()

removeDirectory

Object removeDirectory()

renameTo

Boolean renameTo(<String> toFile)

toByteArray

Object toByteArray()

write

Boolean write(<String> what)

writeln

Boolean writeln(<String> what)


Documentation generated by JSDoc on Thu Apr 5 01:59:00 2007