xwalk.utils.checkPrivilegeAccess(xwalk.utils.privilege.FILESYSTEM_WRITE);
var args = validator_.validateArgs(arguments, [
- { name: "destinationDirectory", type: types_.STRING }, //TODO: add FileReferece validation
+ { name: "destinationDirectory", type: types_.FILE_REFERENCE },
{ name: "onsuccess", type: types_.FUNCTION, optional: true, nullable: true },
{ name: "onerror", type: types_.FUNCTION, optional: true, nullable: true },
{ name: "onprogress", type: types_.FUNCTION, optional: true, nullable: true },
]),
opId = getNextOpId();
- if (!CommonFS.isVirtualPath(args.destinationDirectory)) //TODO: add FileReferece validation
+ if (!CommonFS.isVirtualPath(args.destinationDirectory))
throw new WebAPIException(WebAPIException.TYPE_MISMATCH_ERR,
"Destination directory should be virtual path or file.");
bridge.async({
xwalk.utils.checkPrivilegeAccess(xwalk.utils.privilege.FILESYSTEM_WRITE);
var args = validator_.validateArgs(arguments, [
- { name: "sourceFile", type: types_.STRING }, //TODO: add FileReferece validation
+ { name: "sourceFile", type: types_.FILE_REFERENCE },
{ name: "onsuccess", type: types_.FUNCTION, optional: true, nullable: true },
{ name: "onerror", type: types_.FUNCTION, optional: true, nullable: true },
{ name: "onprogress", type: types_.FUNCTION, optional: true, nullable: true },
]),
opId = getNextOpId();
- if (!CommonFS.isVirtualPath(args.sourceFile)) //TODO: add FileReferece validation
+ if (!CommonFS.isVirtualPath(args.sourceFile))
throw new WebAPIException(WebAPIException.TYPE_MISMATCH_ERR,
"sourceFile should be virtual path or file.");
xwalk.utils.checkPrivilegeAccess(xwalk.utils.privilege.FILESYSTEM_WRITE);
var args = validator_.validateArgs(arguments, [
- { name: "destinationDirectory", type: types_.STRING }, //TODO: add FileReferece validation
+ { name: "destinationDirectory", type: types_.FILE_REFERENCE },
{ name: "onsuccess", type: types_.FUNCTION, optional: true, nullable: true },
{ name: "onerror", type: types_.FUNCTION, optional: true, nullable: true },
{ name: "onprogress", type: types_.FUNCTION, optional: true, nullable: true },
]),
opId = getNextOpId();
- if (!CommonFS.isVirtualPath(args.destinationDirectory)) //TODO: add FileReferece validation
+ if (!CommonFS.isVirtualPath(args.destinationDirectory))
throw new WebAPIException(WebAPIException.TYPE_MISMATCH_ERR,
"destinationDirectory should be virtual path or file.");
xwalk.utils.checkPrivilegeAccess(xwalk.utils.privilege.FILESYSTEM_WRITE);
var args = validator_.validateArgs(arguments, [
- { name: "file", type: types_.STRING }, //TODO: add FileReferece validation
+ { name: "file", type: types_.FILE_REFERENCE },
{ name: "mode", type: types_.ENUM, values: ["r", "rw", "w", "a"] },
{ name: "onsuccess", type: types_.FUNCTION },
{ name: "onerror", type: types_.FUNCTION, optional: true, nullable: true },
}
}
- if (!CommonFS.isVirtualPath(args.file)) //TODO: add FileReferece validation
+ if (!CommonFS.isVirtualPath(args.file))
throw new WebAPIException(WebAPIException.TYPE_MISMATCH_ERR,
"file should be virtual path or file.");