file
(plugins.file)
Returned Types
Methods Summarized
Methods Detailed
appendToTXTFile(file, text)
Appends a string given in parameter to a file, using default platform encoding.
Parameters
Returns: Boolean true if appending worked
Sample
appendToTXTFile(file, text, encoding)
Appends a string given in parameter to a file, using the specified encoding.
Parameters
JSFile file a local JSFile
String text the text to append to the file
String encoding the encoding to use
Returns: Boolean true if appending worked
Sample
appendToTXTFile(file, text)
Appends a string given in parameter to a file, using default platform encoding.
Parameters
Returns: Boolean true if appending worked
Sample
appendToTXTFile(file, text, encoding)
Appends a string given in parameter to a file, using the specified encoding.
Parameters
String file the file path as a String
String text the text to append to the file
String encoding the encoding to use
Returns: Boolean
Sample
convertToJSFile(file)
Returns a JSFile instance corresponding to an alternative representation of a file (for example a string).
Parameters
Object file ;
Returns: JSFile JSFile
Sample
convertToRemoteJSFile(path)
Convenience return to get a JSFile representation of a server file based on its path.
Parameters
String path the path representing a file on the server (should start with "/")
Returns: JSFile the JSFile
Sample
copyFile(source, destination)
Copies the source file to the destination file. Returns true if the copy succeeds, false if any error occurs.
Parameters
Returns: Boolean
Sample
copyFolder(source, destination)
Copies the sourcefolder to the destination folder, recursively. Returns true if the copy succeeds, false if any error occurs.
Parameters
Returns: Boolean success boolean
Sample
createFile(targetFile)
Creates a JSFile instance. Does not create the file on disk.
Parameters
Object targetFile ;
Returns: JSFile
Sample
createFolder(destination)
Creates the folder by the given pathname, including anynecessary but nonexistent parent folders. Note that if this operation fails it may have succeeded in creating some of the necessary parent folders. Will return true if it could make this folder or if the folder did already exist.
Parameters
Object destination ;
Returns: Boolean
Sample
createTempFile(prefix, suffix)
Creates a temporary file on disk. A prefix and an extension are specified and they will be part of the file name.
Parameters
Returns: JSFile
Sample
deleteFile(destination)
Removes a file from disk. Returns true on success, false otherwise.
Parameters
Object destination ;
Returns: Boolean
Sample
deleteFolder(destination, showWarning)
Deletes a folder from disk recursively. Returns true on success, false otherwise. If the second parameter is set to true, then a warning will be issued to the user before actually removing the folder.
Parameters
Returns: Boolean
Sample
getDefaultUploadLocation()
Returns the default upload location path of the server.
Returns: String the location as canonical path
Sample
getDesktopFolder()
Returns a JSFile instance that corresponds to the Desktop folder of the currently logged in user.
Returns: JSFile
Sample
getDiskList()
Returns an Array of JSFile instances correponding to the file system root folders.
Returns: Array
Sample
getFileSize(fileOrPath)
Returns the size of the specified file.
Parameters
Object fileOrPath can be a (remote) JSFile or a local file path
Returns: Number
Sample
getFolderContents(targetFolder)
Returns an array of JSFile instances corresponding to content of the specified folder. The content can be filtered by optional name filter(s), by type, by visibility and by lock status.
Parameters
JSFile targetFolder JSFile object.
Returns: Array
Sample
getFolderContents(targetFolder, fileFilter)
Returns an array of JSFile instances corresponding to content of the specified folder. The content can be filtered by optional name filter(s), by type, by visibility and by lock status.
Parameters
Returns: Array
Sample
getFolderContents(targetFolder, fileFilter, fileOption)
Returns an array of JSFile instances corresponding to content of the specified folder. The content can be filtered by optional name filter(s), by type, by visibility and by lock status.
Parameters
JSFile targetFolder JSFile object.
Object fileFilter Filter or array of filters for files in folder.
Number fileOption 1=files, 2=dirs
Returns: Array
Sample
getFolderContents(targetFolder, fileFilter, fileOption, visibleOption)
Returns an array of JSFile instances corresponding to content of the specified folder. The content can be filtered by optional name filter(s), by type, by visibility and by lock status.
Parameters
JSFile targetFolder JSFile object.
Object fileFilter Filter or array of filters for files in folder.
Number fileOption 1=files, 2=dirs
Number visibleOption 1=visible, 2=nonvisible
Returns: Array
Sample
getFolderContents(targetFolder, fileFilter, fileOption, visibleOption, lockedOption)
Returns an array of JSFile instances corresponding to content of the specified folder. The content can be filtered by optional name filter(s), by type, by visibility and by lock status.
Parameters
JSFile targetFolder JSFile object.
Object fileFilter Filter or array of filters for files in folder.
Number fileOption 1=files, 2=dirs
Number visibleOption 1=visible, 2=nonvisible
Number lockedOption 1=locked, 2=nonlocked
Returns: Array
Sample
getFolderContents(targetFolder)
Returns an array of JSFile instances corresponding to content of the specified folder. The content can be filtered by optional name filter(s), by type, by visibility and by lock status.
Parameters
String targetFolder File path.
Returns: Array
Sample
getFolderContents(targetFolder, fileFilter)
Returns an array of JSFile instances corresponding to content of the specified folder. The content can be filtered by optional name filter(s), by type, by visibility and by lock status.
Parameters
Returns: Array
Sample
getFolderContents(targetFolder, fileFilter, fileOption)
Returns an array of JSFile instances corresponding to content of the specified folder. The content can be filtered by optional name filter(s), by type, by visibility and by lock status.
Parameters
String targetFolder File path.
Object fileFilter Filter or array of filters for files in folder.
Number fileOption 1=files, 2=dirs
Returns: Array
Sample
getFolderContents(targetFolder, fileFilter, fileOption, visibleOption)
Returns an array of JSFile instances corresponding to content of the specified folder. The content can be filtered by optional name filter(s), by type, by visibility and by lock status.
Parameters
String targetFolder File path.
Object fileFilter Filter or array of filters for files in folder.
Number fileOption 1=files, 2=dirs
Number visibleOption 1=visible, 2=nonvisible
Returns: Array
Sample
getFolderContents(targetFolder, fileFilter, fileOption, visibleOption, lockedOption)
Returns an array of JSFile instances corresponding to content of the specified folder. The content can be filtered by optional name filter(s), by type, by visibility and by lock status.
Parameters
String targetFolder File path.
Object fileFilter Filter or array of filters for files in folder.
Number fileOption 1=files, 2=dirs
Number visibleOption 1=visible, 2=nonvisible
Number lockedOption 1=locked, 2=nonlocked
Returns: Array
Sample
getHomeFolder()
Returns a JSFile instance corresponding to the home folder of the logged in used.
Returns: JSFile
Sample
getModificationDate(fileOrPath)
Returns the modification date of a file.
Parameters
Object fileOrPath can be a (remote) JSFile or a local file path
Returns: Date
Sample
getRemoteFolderContents(targetFolder)
Returns an array of JSFile instances corresponding to content of the specified folder on the server side. The content can be filtered by optional name filter(s), by type, by visibility and by lock status.
Parameters
JSFile targetFolder ;
Returns: Array the array of file names
Sample
getRemoteFolderContents(targetFolder, fileFilter)
Returns an array of JSFile instances corresponding to content of the specified folder on the server side. The content can be filtered by optional name filter(s), by type, by visibility and by lock status.
Parameters
JSFile targetFolder Folder as JSFile object.
Object fileFilter Filter or array of filters for files in folder.
Returns: Array the array of file names
Sample
getRemoteFolderContents(targetFolder, fileFilter, fileOption)
Returns an array of JSFile instances corresponding to content of the specified folder on the server side. The content can be filtered by optional name filter(s), by type, by visibility and by lock status.
Parameters
JSFile targetFolder Folder as JSFile object.
Object fileFilter Filter or array of filters for files in folder.
Number fileOption 1=files, 2=dirs
Returns: Array the array of file names
Sample
getRemoteFolderContents(targetFolder, fileFilter, fileOption, visibleOption)
Returns an array of JSFile instances corresponding to content of the specified folder on the server side. The content can be filtered by optional name filter(s), by type, by visibility and by lock status.
Parameters
JSFile targetFolder Folder as JSFile object.
Object fileFilter Filter or array of filters for files in folder.
Number fileOption 1=files, 2=dirs
Number visibleOption 1=visible, 2=nonvisible
Returns: Array the array of file names
Sample
getRemoteFolderContents(targetFolder, fileFilter, fileOption, visibleOption, lockedOption)
Returns an array of JSFile instances corresponding to content of the specified folder on the server side. The content can be filtered by optional name filter(s), by type, by visibility and by lock status.
Parameters
JSFile targetFolder Folder as JSFile object.
Object fileFilter Filter or array of filters for files in folder.
Number fileOption 1=files, 2=dirs
Number visibleOption 1=visible, 2=nonvisible
Number lockedOption 1=locked, 2=nonlocked
Returns: Array the array of file names
Sample