[Archive] Removed hard-coded path.
authorPawel Andruszkiewicz <p.andruszkie@samsung.com>
Wed, 24 Feb 2016 09:47:37 +0000 (10:47 +0100)
committerPawel Andruszkiewicz <p.andruszkie@samsung.com>
Wed, 24 Feb 2016 09:47:37 +0000 (10:47 +0100)
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 <p.andruszkie@samsung.com>
src/archive/archive_callback_data.cc
src/archive/filesystem_file.cc
src/archive/filesystem_file.h

index ba1e048..65ecfc9 100755 (executable)
@@ -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)
     {
index 85736e9..ef6071e 100644 (file)
@@ -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
index b764bbd..752f6a1 100644 (file)
@@ -56,12 +56,6 @@ private:
     std::string m_original_fullpath;
 };
 
-class External {
-public:
-    static std::string cutVirtualRoot(const std::string& path);
-};
-
-
 } // filesystem
 } // extension