From: Pawel Andruszkiewicz Date: Wed, 24 Feb 2016 09:47:37 +0000 (+0100) Subject: [Archive] Removed hard-coded path. X-Git-Tag: accepted/tizen/ivi/20160225.083247^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7816923f103fe931bc165d3623aaf490c6adfd6a;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [Archive] Removed hard-coded path. The behaviour described in the WIDL has been restored: ArchiveFileEntryOptions.stripSourceDirectory [Verification] TCT pass rate: 100% (106/106/0/0/0) Change-Id: I7710659878f7d4f3622b57076854bd720dbe4e31 Signed-off-by: Pawel Andruszkiewicz --- diff --git a/src/archive/archive_callback_data.cc b/src/archive/archive_callback_data.cc index ba1e048..65ecfc9 100755 --- a/src/archive/archive_callback_data.cc +++ b/src/archive/archive_callback_data.cc @@ -16,6 +16,7 @@ #include "archive_callback_data.h" +#include "common/filesystem/filesystem_provider.h" #include "common/logger.h" #include "common/tools.h" @@ -527,7 +528,7 @@ void AddProgressCallback::setBasePath(const std::string& path) { LoggerD("Entered"); m_base_path = path; - m_base_virt_path = filesystem::External::cutVirtualRoot(m_base_path); + m_base_virt_path = common::FilesystemProvider::Create().GetVirtualPath(m_base_path); std::string::size_type pos = m_base_virt_path.find(filesystem::Path::getSeparator()); if (pos != std::string::npos) { diff --git a/src/archive/filesystem_file.cc b/src/archive/filesystem_file.cc index 85736e9..ef6071e 100644 --- a/src/archive/filesystem_file.cc +++ b/src/archive/filesystem_file.cc @@ -21,11 +21,6 @@ using namespace common; namespace extension { namespace filesystem { -namespace { -const std::string kVirtualRootsDirectory = "/opt/usr/media/"; -const std::string kSlash = "/"; -} - File::File(NodePtr node, const File::PermissionList &parentPermissions, const std::string& original_location) : m_node(node), @@ -70,13 +65,5 @@ const std::string& File::getOriginalFullPath() const return m_original_fullpath; } -std::string External::cutVirtualRoot(const std::string& path) -{ - LoggerD("Enter path %s", path.c_str()); - std::string tmp_path = path.substr(kVirtualRootsDirectory.length()); - return tmp_path.find(kSlash) == std::string::npos ? - tmp_path : tmp_path.substr(tmp_path.find(kSlash)); -} - } // filesystem } // extension diff --git a/src/archive/filesystem_file.h b/src/archive/filesystem_file.h index b764bbd..752f6a1 100644 --- a/src/archive/filesystem_file.h +++ b/src/archive/filesystem_file.h @@ -56,12 +56,6 @@ private: std::string m_original_fullpath; }; -class External { -public: - static std::string cutVirtualRoot(const std::string& path); -}; - - } // filesystem } // extension