#include <manifest_parser/utils/logging.h>
+#include <filesystem>
+
#include "common/utils/byte_size_literals.h"
#include "common/utils/file_util.h"
#include "common/utils/request.h"
-namespace bf = boost::filesystem;
+namespace fs = std::filesystem;
namespace {
ExternalStorage::ExternalStorage(RequestType type,
const std::string& pkgid, const std::string& package_type,
- const boost::filesystem::path& application_root, uid_t uid)
+ const fs::path& application_root, uid_t uid)
: type_(type),
pkgid_(pkgid),
package_type_(package_type),
ExternalStorage::ExternalStorage(RequestType type,
const std::string& pkgid, const std::string& package_type,
- const boost::filesystem::path& application_root, uid_t uid,
+ const fs::path& application_root, uid_t uid,
bool is_external_move)
: type_(type),
pkgid_(pkgid),
}
bool ExternalStorage::Initialize(
- const boost::filesystem::path& space_requirement) {
+ const fs::path& space_requirement) {
// external size in MB, set any-non zero size as default
int external_size = 1;
if (!space_requirement.empty()) {
if (package_type_ != kWgtType) {
for (auto& dir : kExternalDirsForTpk) {
- bf::path requirement = space_requirement / dir;
- if (!bf::exists(requirement))
+ fs::path requirement = space_requirement / dir;
+ if (!fs::exists(requirement))
continue;
external_size +=
SizeInMB(GetDirectorySize(requirement));
}
std::unique_ptr<ExternalStorage> ExternalStorage::MoveInstalledStorage(
- RequestType type, const boost::filesystem::path& application_root,
+ RequestType type, const fs::path& application_root,
const std::string& pkgid, const std::string& package_type,
uid_t uid, bool is_external_move) {
}
std::unique_ptr<ExternalStorage> ExternalStorage::AcquireExternalStorage(
- RequestType type, const boost::filesystem::path& application_root,
+ RequestType type, const fs::path& application_root,
const std::string& pkgid, const std::string& package_type,
- const boost::filesystem::path& space_requirement,
+ const fs::path& space_requirement,
uid_t uid) {
std::unique_ptr<ExternalStorage> external_storage(
new ExternalStorage(type, pkgid, package_type, application_root, uid));
RequestType type, const std::string& pkgid, uid_t uid) {
std::unique_ptr<ExternalStorage> external_storage(
new ExternalStorage(type, pkgid, uid));
- bf::path empty_path("");
+ fs::path empty_path("");
if (!external_storage->Initialize(empty_path)) {
LOG(WARNING) << "Cannot initialize external storage for request";
return nullptr;