From: Pawel Andruszkiewicz Date: Fri, 12 Feb 2016 08:15:39 +0000 (+0100) Subject: [Archive] Add files recursively to an archive. X-Git-Tag: submit/tizen/20160212.103506^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e7a9cdb3a9d37a582d04d8b64a4cab91f3d2c652;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [Archive] Add files recursively to an archive. Fixes: SAD-62 [Verification] TCT pass rate (r31): 100% (106/106/0/0/0). Change-Id: Ibbf439a0a6986caba57f6ba4066ef70f22226d96 Signed-off-by: Pawel Andruszkiewicz --- diff --git a/src/archive/zip_add_request.cc b/src/archive/zip_add_request.cc index 969b0fbb..543bdacf 100755 --- a/src/archive/zip_add_request.cc +++ b/src/archive/zip_add_request.cc @@ -88,9 +88,8 @@ PlatformResult ZipAddRequest::run() m_root_src_file = m_callback->getFileEntry()->getFile(); m_root_src_file_node = m_root_src_file->getNode(); - //We just need read permission to list files in subdirectories - LoggerW("STUB Not setting PERM_READ permissions"); - //m_root_src_file_node->setPermissions(filesystem::PERM_READ); + // We just need read permission to list files in subdirectories + m_root_src_file_node->setPermissions(filesystem::PERM_READ); std::string src_basepath, src_name; getBasePathAndName(m_root_src_file_node->getPath()->getFullPath(), src_basepath, @@ -189,11 +188,14 @@ void ZipAddRequest::addNodeAndSubdirsToList(filesystem::NodePtr src_node, out_list_of_child_nodes.push_back(src_node); if(filesystem::NT_DIRECTORY == src_node->getType()) { - LoggerW("STUB Not generating recursive list of files in directory"); - //auto child_nodes = src_node->getChildNodes(); - //for(auto it = child_nodes.begin(); it != child_nodes.end(); ++it) { - // addNodeAndSubdirsToList(*it, out_list_of_child_nodes); - //} + LoggerD("Generating recursive list of files in directory"); + NodeList child_nodes; + auto result = src_node->getChildNodes(&child_nodes); + if (result) { + for(const auto& it : child_nodes) { + addNodeAndSubdirsToList(it, out_list_of_child_nodes); + } + } } }