summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJackLivio <jack@livio.io>2017-07-21 15:26:38 -0400
committerGitHub <noreply@github.com>2017-07-21 15:26:38 -0400
commit69675d27f8e52bb30fd2a7b4fa96e9304a4a4c56 (patch)
treef96ec5ffa85b922cd1393d48128f1a8aea15575d
parente5a5aad135629e802aff7154a005fbf0351430a3 (diff)
parentaac8cc1ffbee0ac4ce2e6669aa407ef878bb789c (diff)
downloadsdl_core-69675d27f8e52bb30fd2a7b4fa96e9304a4a4c56.tar.gz
Merge pull request #1484 from madhuy/hotfix/13934.3.1
Hotfix/1393 - getting ListFiles from filesytem instead from Cache
-rw-r--r--src/components/application_manager/src/commands/mobile/list_files_request.cc23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/components/application_manager/src/commands/mobile/list_files_request.cc b/src/components/application_manager/src/commands/mobile/list_files_request.cc
index 425f1ddb46..794fba631d 100644
--- a/src/components/application_manager/src/commands/mobile/list_files_request.cc
+++ b/src/components/application_manager/src/commands/mobile/list_files_request.cc
@@ -76,22 +76,21 @@ void ListFilesRequest::Run() {
(*message_)[strings::msg_params][strings::space_available] =
static_cast<int32_t>(application->GetAvailableDiskSpace());
+ // Enumarating through File system
uint32_t i = 0;
- const AppFilesMap& app_files = application->getAppFiles();
- for (AppFilesMap::const_iterator it = app_files.begin();
- it != app_files.end();
- ++it) {
- std::string filename = it->first.substr(it->first.find_last_of('/') + 1);
- // In AppFile to application stored full path to file. In message required
- // to write only name file.
- // Plus one required for move to next letter after '/'.
+ std::string directory_name =
+ application_manager_.get_settings().app_storage_folder();
+ directory_name += "/" + application->folder_name();
+ std::vector<std::string> persistent_files =
+ file_system::ListFiles(directory_name);
+ std::vector<std::string>::const_iterator it = persistent_files.begin();
+ for (; it != persistent_files.end(); ++it) {
if (i < application_manager_.get_settings().list_files_response_size()) {
- LOG4CXX_DEBUG(logger_,
- "File " + filename + " added to ListFiles response");
- (*message_)[strings::msg_params][strings::filenames][i++] = filename;
+ LOG4CXX_DEBUG(logger_, "File " + *it + " added to ListFiles response");
+ (*message_)[strings::msg_params][strings::filenames][i++] = *it;
} else {
LOG4CXX_DEBUG(logger_,
- "File " + filename + " not added to ListFiles response");
+ "File " + *it + " not added to ListFiles response");
}
}
(*message_)[strings::params][strings::message_type] =