Class: FileCommander

FileCommander()

Facade class for file operations.

Constructor

new FileCommander()

Instantiate a new file commander object.
Source:

Classes

FileCommander

Methods

areJobsStopped()

True if all jobs are stopped.
Source:
Returns:

cancel()

Cancel all jobs.
Source:

(async) copyFiles(filesToCopy, dir, move, onProgressChanged, autoRename, onFailed)

Copy files to another directory.
Parameters:
Name Type Description
filesToCopy The array of files to copy.
dir The target directory.
move True if moving files instead of copying.
onProgressChanged The progress change observer to notify.
autoRename The auto rename function to use when files with same filename are found
onFailed The observer to notify when failures occur
Source:
Throws:
Exception

(async) deleteFiles(filesToDelete, OnProgressChanged, onFailed)

Delete files.
Parameters:
Name Type Description
filesToDelete The files to delete.
OnProgressChanged The observer to notify when each file is deleted.
onFailed The observer to notify when a file has failed.
Source:

(async) exportFiles(filesToExport, exportDir, deleteSource, integrity, onProgressChanged, autoRename, onFailed)

Export a file from a drive.
Parameters:
Name Type Description
filesToExport The files to export.
exportDir The export target directory
deleteSource True if you want to delete the source files
integrity True to use integrity verification before exporting files
onProgressChanged Observer to notify when progress changes.
autoRename Function to rename file if another file with the same filename exists
onFailed Observer to notify when a file fails exporting
Source:
Throws:
Exception
Returns:
The exported files

(async) getFiles(files)

Get number of files recursively for the files provided.
Parameters:
Name Type Description
files Total number of files and files under subdirectories.
Source:
Returns:

(async) importFiles(filesToImport, importDir, deleteSource, integrity, onProgressChanged, autoRename, onFailed)

Import files to the drive.
Parameters:
Name Type Description
filesToImport The files to import.
importDir The target directory.
deleteSource True if you want to delete the source files when import complete.
integrity True to apply integrity to imported files.
onProgressChanged Observer to notify when progress changes.
autoRename Function to rename file if another file with the same filename exists
onFailed Observer to notify when a file fails importing
Source:
Throws:
Exception
Returns:
The imported files if completes successfully.

isFileSearcherRunning()

True if the file search is currently running.
Source:
Returns:

isFileSearcherStopped()

True if file search stopped.
Source:
Returns:

isRunning()

True if jobs are currently running.
Source:
Returns:

onError(ex) → {boolean}

Handle the error.
Parameters:
Name Type Description
ex The error
Source:
Returns:
True if handled
Type
boolean

(async) renameFile()

Rename an encrypted file
Source:
Search
Parameters:
Name Type Description
dir The directory to start the search.
terms The terms to search for.
any True if you want to match any term otherwise match all terms.
OnResultFound Callback interface to receive notifications when results found.
OnSearchEvent Callback interface to receive status events.
Source:
Returns:
An array with all the results found.

stopFileSearch()

Stop file search.
Source: