function copyPath(source, destination, options) {
        var deferred = new $.Deferred();

        resolveNativeFileSystemPath(source).done(function (entry) {
            var promise;

            if (entry.isDirectory) {
                promise = copyDirectoryEntry(entry, destination, options);
            } else {
                promise = copyFileEntry(entry, destination, options);
            }

            promise.then(deferred.resolve, function (err) {
                console.error(destination);
                deferred.reject();
            });
        }).fail(function () {
            deferred.reject();
        });

        return deferred.promise();
    }
Copy a file or directory source path to a destination
@param {!string} source Path for the source file or directory to copy
@param {!string} destination Destination path to copy the source file or directory
@param {?{parseOffsets:boolean, infos:Object, removePrefix:boolean}}} options
    parseOffsets - allows optional offset markup parsing. File is written to the
      destination path without offsets. Offset data is passed to the
      doneCallbacks of the promise.
    infos - an optional Object used when parseOffsets is true. Offset
      information is attached here, indexed by the file destination path.
    removePrefix - When parseOffsets is true, set removePrefix true
      to add a new key to the infos array that drops the destination
      path root.
@return {$.Promise} A promise resolved when the directory and all it's
    contents are copied to the destination or rejected immediately
    upon the first error.