Add OOM exception handler
[platform/core/appfw/wgt-backend.git] / src / wgt / step / filesystem / step_wgt_prepare_package_directory.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 WGT_STEP_FILESYSTEM_STEP_WGT_PREPARE_PACKAGE_DIRECTORY_H_
6 #define WGT_STEP_FILESYSTEM_STEP_WGT_PREPARE_PACKAGE_DIRECTORY_H_
7
8 #include <manifest_parser/utils/logging.h>
9
10 #include <boost/filesystem/path.hpp>
11 #include <pkgmgrinfo_basic.h>
12
13 #include <string>
14
15 #include "common/installer_context.h"
16 #include "common/step/step.h"
17
18 namespace wgt {
19 namespace filesystem {
20
21 /**
22  * \brief Responsible for adjusting package directory after mounting zip package
23  *        by StepMountInstall or StepMountUpdate
24  *
25  * This step will preserve old application symlinks in bin/ directory.
26  */
27 class StepWgtPreparePackageDirectory : public common_installer::Step {
28  public:
29   using Step::Step;
30
31   Status process() override;
32   Status clean() override { return Status::OK; }
33   Status undo() override { return Status::OK; }
34   Status precheck() override;
35
36  private:
37   Status CreateSymlinkToMountPoint();
38
39   STEP_NAME(WgtPreparePackageDirectory)
40 };
41
42 }  // namespace filesystem
43 }  // namespace wgt
44
45 #endif  // WGT_STEP_FILESYSTEM_STEP_WGT_PREPARE_PACKAGE_DIRECTORY_H_