diff --git a/interfaces/common/file_share_sandbox.json b/interfaces/common/file_share_sandbox.json index 3f69410f7d7fc1148ed748a070b358fb3d422621..55e9cfc88829489b19345b72ba29d5b7874d0b4f 100644 --- a/interfaces/common/file_share_sandbox.json +++ b/interfaces/common/file_share_sandbox.json @@ -1,55 +1,55 @@ { "mount-path-map" : [{ - "sandbox-path" : "/data/storage/el1/bundle", - "src-path" : "/data/app/el1/bundle/public/" + "sandbox-path" : "/data/storage/el1/bundle/", + "src-path" : "/data/app/el1/bundle/public//" }, { - "sandbox-path" : "/data/storage/el2/base", - "src-path" : "/data/app/el2//base/" + "sandbox-path" : "/data/storage/el2/base/", + "src-path" : "/data/app/el2//base//" }, { - "sandbox-path" : "/data/storage/el1/database", - "src-path" : "/data/app/el1//database/" + "sandbox-path" : "/data/storage/el1/database/", + "src-path" : "/data/app/el1//database//" }, { - "sandbox-path" : "/data/storage/el2/database", - "src-path" : "/data/app/el2//database/" + "sandbox-path" : "/data/storage/el2/database/", + "src-path" : "/data/app/el2//database//" }, { - "sandbox-path" : "/data/storage/el1/base", - "src-path" : "/data/app/el1//base/" + "sandbox-path" : "/data/storage/el1/base/", + "src-path" : "/data/app/el1//base//" }, { - "sandbox-path" : "/data/storage/ark-cache", - "src-path" : "/data/local/ark-cache/" + "sandbox-path" : "/data/storage/ark-cache/", + "src-path" : "/data/local/ark-cache//" }, { - "sandbox-path" : "/data/storage/ark-profile", - "src-path" : "/data/local/ark-profile//" + "sandbox-path" : "/data/storage/ark-profile/", + "src-path" : "/data/local/ark-profile///" }, { - "sandbox-path" : "/data/storage/el2/distributedfiles", - "src-path" : "/mnt/hmdfs//account/merge_view/data/" + "sandbox-path" : "/data/storage/el2/distributedfiles/", + "src-path" : "/mnt/hmdfs//account/merge_view/data//" }, { - "sandbox-path" : "/mnt/data/fuse", - "src-path" : "/mnt/data//fuse" + "sandbox-path" : "/mnt/data/fuse/", + "src-path" : "/mnt/data//fuse/" }, { - "sandbox-path" : "/storage/Users/currentUser/Documents", - "src-path" : "/mnt/hmdfs//account/merge_view/files/Documents" + "sandbox-path" : "/storage/Users/currentUser/Documents/", + "src-path" : "/mnt/hmdfs//account/merge_view/files/Documents/" }, { - "sandbox-path" : "/storage/Users/currentUser/Download", - "src-path" : "/mnt/hmdfs//account/merge_view/files/Download" + "sandbox-path" : "/storage/Users/currentUser/Download/", + "src-path" : "/mnt/hmdfs//account/merge_view/files/Download/" }, { - "sandbox-path" : "/storage/Users/currentUser/Desktop", - "src-path" : "/mnt/hmdfs//account/merge_view/files/Desktop" + "sandbox-path" : "/storage/Users/currentUser/Desktop/", + "src-path" : "/mnt/hmdfs//account/merge_view/files/Desktop/" }, { - "sandbox-path" : "/storage/Users/currentUser", - "src-path" : "/mnt/hmdfs//account/merge_view/files/Docs" + "sandbox-path" : "/storage/Users/currentUser/", + "src-path" : "/mnt/hmdfs//account/merge_view/files/Docs/" }, { - "sandbox-path" : "/storage/External", - "src-path" : "/mnt/data/External" + "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/Share/", + "src-path" : "/data/service/el1/public/storage_daemon/share/public/" }, { - "sandbox-path" : "/Documents", - "src-path" : "/mnt/hmdfs//account/merge_view/files/Documents" + "sandbox-path" : "/Documents/", + "src-path" : "/mnt/hmdfs//account/merge_view/files/Documents/" }, { - "sandbox-path" : "/Download", - "src-path" : "/mnt/hmdfs//account/merge_view/files/Download" + "sandbox-path" : "/Download/", + "src-path" : "/mnt/hmdfs//account/merge_view/files/Download/" } ] } \ No newline at end of file diff --git a/interfaces/innerkits/native/file_uri/src/file_uri.cpp b/interfaces/innerkits/native/file_uri/src/file_uri.cpp index abef756080094e5c8f383a5506efe43f44333ca4..f48d6e3d2673a4e6243be051f8502ef4984a2e83 100644 --- a/interfaces/innerkits/native/file_uri/src/file_uri.cpp +++ b/interfaces/innerkits/native/file_uri/src/file_uri.cpp @@ -31,6 +31,7 @@ const std::string PATH_SHARE = "/data/storage/el2/share"; const std::string MODE_RW = "/rw/"; const std::string MODE_R = "/r/"; const std::string FILE_SCHEME_PREFIX = "file://"; +const std::string FILE_MANAGER_BASE_PATH = "/storage/Users/"; const std::string FILE_MANAGER_AUTHORITY = "docs"; const std::string MEDIA_AUTHORITY = "media"; string FileUri::GetName() @@ -67,7 +68,7 @@ string FileUri::GetRealPath() string bundleName = uri_.GetAuthority(); LOGD("GetRealPath decode path is %{private}s", sandboxPath.c_str()); if (bundleName == FILE_MANAGER_AUTHORITY && - access(realPath.c_str(), F_OK) == 0) { + access(FILE_MANAGER_BASE_PATH.c_str(), F_OK) == 0) { return realPath; }