diff --git a/interfaces/common/file_share_sandbox.json b/interfaces/common/file_share_sandbox.json index 7dc018e085edc7d2d61abb342a846a2762b02d88..d185de52c2f6abed6696a3016bd50e9e8c7d9fc0 100644 --- a/interfaces/common/file_share_sandbox.json +++ b/interfaces/common/file_share_sandbox.json @@ -27,26 +27,17 @@ "sandbox-path" : "/mnt/data/fuse", "src-path" : "/mnt/data//fuse" }, { - "sandbox-path" : "/storage/local/Documents", - "src-path" : "/data/service/el2//hmdfs/account/files/Documents" - }, { - "sandbox-path" : "/storage/local/Download", - "src-path" : "/data/service/el2//hmdfs/account/files/Download" - }, { - "sandbox-path" : "/storage/local/Desktop", - "src-path" : "/data/service/el2//hmdfs/account/files/Desktop" - }, { - "sandbox-path" : "/storage/External", - "src-path" : "/mnt/data/External" - }, { - "sandbox-path" : "/storage/Share", - "src-path" : "/data/service/el1/public/storage_daemon/share/public" + "sandbox-path" : "/storage/Users/currentUserId/Documents", + "src-path" : "/mnt/hmdfs//account/merge_view/files/Documents" }, { - "sandbox-path" : "/storage/local/Download", + "sandbox-path" : "/storage/Users/currentUserId/Download", "src-path" : "/mnt/hmdfs//account/merge_view/files/Download" }, { - "sandbox-path" : "/storage/local/Desktop", + "sandbox-path" : "/storage/Users/currentUserId/Desktop", "src-path" : "/mnt/hmdfs//account/merge_view/files/Desktop" + }, { + "sandbox-path" : "/storage/Users/currentUserId", + "src-path" : "/mnt/hmdfs//account/merge_view/files/Docs" }, { "sandbox-path" : "/storage/External", "src-path" : "/mnt/data/External" diff --git a/interfaces/common/src/sandbox_helper.cpp b/interfaces/common/src/sandbox_helper.cpp index ceb157797f3d3f469ed55dc775b5419033c398ca..7cc028e1e4b47af112aa840ed3a5047ed997cc5f 100644 --- a/interfaces/common/src/sandbox_helper.cpp +++ b/interfaces/common/src/sandbox_helper.cpp @@ -245,14 +245,16 @@ int32_t SandboxHelper::GetPhysicalPath(const std::string &fileUri, const std::st GetSandboxPathMap(sandboxPathMap_); } + int32_t curPrefixMatchLen = 0; for (auto it = sandboxPathMap_.begin(); it != sandboxPathMap_.end(); it++) { string sandboxPathPrefix = it->first; - if (sandboxPath.length() >= sandboxPathPrefix.length()) { - string sandboxPathTemp = sandboxPath.substr(0, sandboxPathPrefix.length()); - if (sandboxPathTemp == sandboxPathPrefix) { + int32_t prefixMatchLen = sandboxPathPrefix.length(); + if (sandboxPath.length() >= prefixMatchLen) { + string sandboxPathTemp = sandboxPath.substr(0, prefixMatchLen); + if (sandboxPathTemp == sandboxPathPrefix && curPrefixMatchLen <= prefixMatchLen) { + curPrefixMatchLen = prefixMatchLen; lowerPathHead = it->second; - lowerPathTail = sandboxPath.substr(sandboxPathPrefix.length()); - break; + lowerPathTail = sandboxPath.substr(prefixMatchLen); } } }