return _fileRealPath;
};
+CommonFS.isVirtualPath = function(aPath) {
+ var root = aPath.split("/")[0];
+
+ return this.cacheVirtualToReal[root] != undefined;
+};
+
/**
* Returns new unique opId
*/
]),
opId = getNextOpId();
+ if (!CommonFS.isVirtualPath(args.destinationDirectory)) //TODO: add FileReferece validation
+ throw new tizen.WebAPIException(tizen.WebAPIException.TYPE_MISMATCH_ERR,
+ "Destination directory should be virtual path or file.");
bridge.async({
cmd: 'ArchiveFileEntry_extract',
args: {
]),
opId = getNextOpId();
+ if (!CommonFS.isVirtualPath(args.sourceFile)) //TODO: add FileReferece validation
+ throw new tizen.WebAPIException(tizen.WebAPIException.TYPE_MISMATCH_ERR,
+ "sourceFile should be virtual path or file.");
+
var optionsAttributes = ["destination", "stripSourceDirectory", "compressionLevel"],
options = args.options || {};
]),
opId = getNextOpId();
+ if (!CommonFS.isVirtualPath(args.destinationDirectory)) //TODO: add FileReferece validation
+ throw new tizen.WebAPIException(tizen.WebAPIException.TYPE_MISMATCH_ERR,
+ "destinationDirectory should be virtual path or file.");
+
bridge.async({
cmd: 'ArchiveFile_extractAll',
args: {
}
}
+ if (!CommonFS.isVirtualPath(args.file)) //TODO: add FileReferece validation
+ throw new tizen.WebAPIException(tizen.WebAPIException.TYPE_MISMATCH_ERR,
+ "file should be virtual path or file.");
+
bridge.async({
cmd: 'ArchiveManager_open',
args: {
const long handle = static_cast<long>(v_handle.get<double>());
- ArchiveFilePtr priv = ArchiveManager::getInstance().getPrivData(handle);
- priv->close();
- ArchiveManager::getInstance().erasePrivData(handle);
-
+ try {
+ ArchiveFilePtr priv = ArchiveManager::getInstance().getPrivData(handle);
+ priv->close();
+ ArchiveManager::getInstance().erasePrivData(handle);
+ } catch (...) {
+ LoggerD("Close method was called on already closed archive. Just end execution");
+ }
ReportSuccess(out);
}