2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * @author Bartosz Janiak (b.janiak@samsung.com)
19 * @author Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
26 #include <sys/types.h>
29 #include <dpl/string.h>
30 #include <dpl/exception.h>
33 DECLARE_EXCEPTION_TYPE(DPL::Exception, CreateDirectoryException)
34 DECLARE_EXCEPTION_TYPE(DPL::Exception, RemoveDirectoryException)
36 bool FileExists(const DPL::String& absolutePath);
39 * Creates specified path recursively.
40 * @param path Path to create (e.g. /tmp/dir1/dir2).
41 * @param mode Mode for the non-existing parts of the path (e.g. 0755).
42 * @throw DPL::CommonException::::InternalError If sth bad happens.
44 void MakePath(const std::string& path,
48 * Removes specified directory recursively.
49 * @param path Full path to directory to remove.
50 * @throw FileUtils::DirectoryRemoveException If an error occured.
52 void RemoveDir(const std::string& path);