in src/browser/FileProxy.js [464:491]
exports.copyTo = function (successCallback, errorCallback, args) {
const srcPath = args[0];
const parentFullPath = args[1];
const name = args[2];
if (name.indexOf('/') !== -1 || srcPath === parentFullPath + name) {
if (errorCallback) {
errorCallback(FileError.INVALID_MODIFICATION_ERR);
}
return;
}
// Read src file
exports.getFile(function (srcFileEntry) {
const path = resolveToFullPath_(parentFullPath);
// Check directory
exports.getDirectory(function () {
// Create dest file
exports.getFile(function (dstFileEntry) {
exports.write(function () {
successCallback(dstFileEntry);
}, errorCallback, [dstFileEntry.file_.storagePath, srcFileEntry.file_.blob_, 0]);
}, errorCallback, [parentFullPath, name, { create: true }]);
}, function () { if (errorCallback) { errorCallback(FileError.NOT_FOUND_ERR); } },
[path.storagePath, null, { create: false }]);
}, errorCallback, [srcPath, null]);
};