Jaxer.FileUtils : Object
Return to: Jaxer Framework index

This is a general class that wraps XPCOM filesystem functionality and from which File and Dir objects are derived.

Platform Support

Jaxer Server FrameworkJaxer Client Framework
1.0no

Constructors

ConstructorActionJaxer Server FrameworkJaxer Client Framework
Jaxer.FileUtils Constructor() : Jaxer.FileUtils
A helper object for filesystem access
Show Details1.0no

Jaxer.FileUtils() : Jaxer.FileUtils

A helper object for filesystem access

Returns
Jaxer.FileUtilsReturns an instance of FileUtils.

Throws
Throws a Exception containing the error code.

Functions

MethodActionJaxer Server FrameworkJaxer Client Framework
append(String leafname) : String
Changes the path of the filesystem object by appending the provided leaf value.
Show Details1.0no

Parameters
StringleafnameThe leafname to be appended

Returns
StringThe appended directory and leafname

Throws
Throws a Exception containing the error code.
chromeToPath(String a) : String
Convert a chrome path to a filesystem path
Show Details1.0no

Parameters
Stringachrome path

Returns
Stringthe chrome path as a filesystem path

Throws
Throws a Exception containing the error code.
copy(String source, String destination) : void
Copies the source path to the destination path
Show Details1.0no

Parameters
Stringsourcepath The source path
Stringdestinationpath The destination apth

Throws
Throws a Exception containing the error code.
create(String aPath) : void
Creates a file on the filesystem with the default permissions
Show Details1.0no

Parameters
StringaPatha file system path

Throws
Throws a Exception containing the error code.
dateModified() : Object
The last modified timestamp as reported by the OS
Show Details1.0no

Returns
Objecta date object representing the last modified timestamp of the file

Throws
Throws a Exception containing the error code.
exists() : Boolean
A boolean indicator of whether the referenced object physically exists on the filesystem.
Show Details1.0no

Returns
Booleantrue if file exists otherwise false

Throws
Throws a Exception containing the error code.
ext(String aPath) : String
Returns the extension of the file object
Show Details1.0no

Parameters
StringaPathThe path to the filesystem object

Returns
Stringthe file extension of the referenced filesytem object

Examples
	 var p='/tmp/foo.dat';
	 var f=new File(p);
	 alert(f.ext);
outputs: dat
Throws
Throws a Exception containing the error code.
isValidPath(String aPath) : Boolean
Returns a boolean indicator that is true for a valid path and false otherwise
Show Details1.0no

Parameters
StringaPatha file system path

Returns
Booleantrue if valid path was requested

Throws
Throws a Exception containing the error code.
leaf(String a) : String
Returns the leaf (filename + extension) portion of the file path
Show Details1.0no

Parameters
Stringafilesystem path

Returns
StringThe leaf name

Throws
Throws a Exception containing the error code.
nsIFile(String aPath) : Object
Returns an nsIFIle object for the specified path
Show Details1.0no

Parameters
StringaPatha file system path

Returns
ObjectnsIFile

Throws
Throws a Exception containing the error code.
parent(String aPath) : String
Returns the path of the parent filesystem object
Show Details1.0no

Parameters
StringaPathThe path to the filesystem object

Returns
StringThe path of the parent file system object

pathToURL(String a) : String
Convert a filesystem path to a file protocol URL
Show Details1.0no

Parameters
Stringapath

Returns
Stringthe filesystem path as a URL

Throws
Throws a Exception containing the error code.
permissions() : String
Get the file permissions for the File object
Show Details1.0no

Returns
Stringthe chmod style permissions of the file

Throws
Throws a Exception containing the error code.
remove() : void
Removes the referenced object physically from the filesystem.
Show Details1.0no
Throws
Throws a Exception containing the error code.
run(String aPath, Array aArgs) : Number
Trys to execute the requested file as a separate *non-blocking* process. Passes the supplied *array* of arguments on the command line if the OS supports it.
Show Details1.0no

Parameters
StringaPatha filesystem path
ArrayaArgsa set of arguments passed to the command to be run

Returns
Numberthe exit code of the process

Throws
Throws a Exception containing the error code.
size(String source) : Number
Returns the size in bytes as reported by the OS
Show Details1.0no

Parameters
Stringsourcepath The path to the filesystem object

Returns
Numberthe size of the file in bytes

Throws
Throws a Exception containing the error code.
urlToPath(String a) : String
Convert a file protocol URL to a filesystem path
Show Details1.0no

Parameters
StringaURL

Returns
Stringthe URL as a filesystem path

Throws
Throws a Exception containing the error code.
validatePermissions(Number the) : Boolean
This function will validate the numeric permissions value provided, if true the permissions value is valid, if false the value is invalid.
Show Details1.0no

Parameters
Numberthechmod style permission (0777,0622 etc)

Returns
Booleanindicates whether the permissions are valid

Throws
Throws a Exception containing the error code.
aptana_docs