fd5ae94240fb819de961e3bbb15d947a19ef41a2
[platform/core/appfw/app-installers.git] / src / common / step / filesystem / step_remove_temporary_directory.h
1 // Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by a apache 2.0 license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMMON_STEP_FILESYSTEM_STEP_REMOVE_TEMPORARY_DIRECTORY_H_
6 #define COMMON_STEP_FILESYSTEM_STEP_REMOVE_TEMPORARY_DIRECTORY_H_
7
8 #include <manifest_parser/utils/logging.h>
9
10 #include "common/step/recovery/step_recovery.h"
11
12 namespace common_installer {
13 namespace filesystem {
14
15 /**
16  * @brief removes temp directories if install gets
17  *        interrupted
18  *
19  * Part of Recovery Mode. If recovery mode gets called
20  * path to temporary unpack directory and its content get
21  * deleted
22  */
23 class StepRemoveTemporaryDirectory : public recovery::StepRecovery {
24  public:
25   using StepRecovery::StepRecovery;
26
27   Status RecoveryNew() override;
28   Status RecoveryUpdate() override;
29   Status Cleanup() override;
30  private:
31   /**
32    * @brief RemoveFiles
33    * Removes all the temporary files
34    */
35   Status RemoveFiles();
36
37   STEP_NAME(RemoveTemporaryDirectory)
38 };
39
40 }  // namespace filesystem
41 }  // namespace common_installer
42
43 #endif  // COMMON_STEP_FILESYSTEM_STEP_REMOVE_TEMPORARY_DIRECTORY_H_