diff options
author | Madhu Yaduguri <madhuyaduguri@UIE08563-2.local> | 2017-04-17 10:23:35 -0700 |
---|---|---|
committer | Madhu Yaduguri <madhuyaduguri@UIE08563-2.local> | 2017-04-17 10:23:35 -0700 |
commit | bf8f51e5b488826547abbcb1237db3138d7e2b8b (patch) | |
tree | c5c8df6264df4ab4568ce476ac09bc71586cce4e | |
parent | 2392564774a6b3c0dc1e92dc19cf495f733b5100 (diff) | |
download | sdl_core-bf8f51e5b488826547abbcb1237db3138d7e2b8b.tar.gz |
Getting files names by enumarating filsystem instead of from Cache.
-rw-r--r-- | src/components/application_manager/src/commands/mobile/list_files_request.cc | 18 |
1 files changed, 9 insertions, 9 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..c872ce3148 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,19 +76,19 @@ 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; + (*message_)[strings::msg_params][strings::filenames][i++] = *it; } else { LOG4CXX_DEBUG(logger_, "File " + filename + " not added to ListFiles response"); |