User Guide
18 Chapter 2: The Fireworks Object Model
deleteFileIfExisting (docOrDir)
string Deletes the specified file or directory.
Returns
true if successful; false if the file or
directory cannot be deleted. Unlike
deleteFile(), this method returns true if the
file or directory does not exist.
enumFiles(docOrDir)
string Returns an array of file URLs. If docOrDir is
a directory, the array contains an entry for
every file or directory that is contained in
the specified directory. If
docOrDir is a file,
the array contains a single entry (the
file passed in).
exists(docOrDir)
string Returns true if docOrDir refers to a directory
or file that exists;
false otherwise.
getDirectory(docname)
string Returns only the directory name from
docname, which is expressed as file://URL.
For example,
Files.getDirectory("file://
work/logo.png")
returns "file:///work".
getExtension(docname)
string Returns the filename extension, if any, of
docname. For example,
Files.getExtension("birthday.png")
returns
".png". If the filename has no
extension, an empty string is returned. A
filename that is expressed as file://URL
is acceptable.
getFilename(docname)
string Returns just the filename from docname,
which is expressed as file://URL. For
example,
Files.getFilename("file:///
work/logo.png")
returns "logo.png".
getLastErrorString()
none If the last call to a method in a Files object
resulted in an error, returns a string that
describes the error. If the last call succeeded,
returns
null.
getTempFilePath ({dirname})
string The argument, if used, must be expressed as
file://URL. Returns a file URL in the
Temporary Files directory or in the specified
directory. This method does not create a file;
it simply returns a unique file URL that does
not conflict with existing files in the directory.
If
dirname is passed and is not null, the URL
that is returned indicates a file in the specified
directory rather than in the Temporary
Files directory.
isDirectory(dirname)
string The argument must be expressed as file://
URL. Returns
true if the specified URL
refers to a directory that exists;
false otherwise.
Method Data type Notes