Implement Cleanup in StepMountRecover
[platform/core/appfw/app-installers.git] / src / common / step / mount / step_mount_recover.h
1 // Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by an apache 2.0 license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMMON_STEP_MOUNT_STEP_MOUNT_RECOVER_H_
6 #define COMMON_STEP_MOUNT_STEP_MOUNT_RECOVER_H_
7
8 #include <manifest_parser/utils/logging.h>
9
10 #include "common/installer_context.h"
11 #include "common/mount_base.h"
12 #include "common/step/recovery/step_recovery.h"
13
14 namespace common_installer {
15 namespace mount {
16
17 /**
18  * \brief Responsible for mounting package zip in recovery mode
19  */
20 class StepMountRecover : public MountBase, public recovery::StepRecovery {
21  public:
22   using MountBase::MountBase;
23   using StepRecovery::StepRecovery;
24
25   Status RecoveryNew() override { return Status::OK; }
26   Status RecoveryUpdate() override { return Status::OK; }
27   Status RecoveryDelta() override { return Status::OK; }
28   Status RecoveryMountNew() override { return Status::OK; }
29   Status RecoveryMountUpdate() override;
30   Status Cleanup() override;
31
32   Status clean() override;
33   Status undo() override;
34
35  private:
36   std::unique_ptr<IZipInterface> CreateZipInterface(
37       const boost::filesystem::path& mount_path) override;
38   Status UmountPackagePath();
39
40   STEP_NAME(MountRecover)
41 };
42
43 }  // namespace mount
44 }  // namespace common_installer
45
46 #endif  // COMMON_STEP_MOUNT_STEP_MOUNT_RECOVER_H_