2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FSys_EnvironmentImpl.cpp
20 * @brief This is the implementation file for %_EnvironmentImpl class.
23 #include <FBaseSysLog.h>
25 #include "FSys_EnvironmentImpl.h"
27 using namespace Tizen::Base;
29 namespace Tizen { namespace System
32 static const wchar_t _MEDIA_PATH[] = L"/opt/usr/media/";
33 static const wchar_t _MEDIA_IMAGES_PATH[] = L"/opt/usr/media/Images/";
34 static const wchar_t _MEDIA_SOUNDS_PATH[] = L"/opt/usr/media/Sounds/";
35 static const wchar_t _MEDIA_VIDEOS_PATH[] = L"/opt/usr/media/Videos/";
36 static const wchar_t _MEDIA_CAMERA_PATH[] = L"/opt/usr/media/Camera/";
37 static const wchar_t _MEDIA_DOWNLOADS_PATH[] = L"/opt/usr/media/Downloads/";
38 static const wchar_t _MEDIA_OTHERS_PATH[] = L"/opt/usr/media/Others/";
40 static const wchar_t _EXTERNAL_MMC_PATH[] = L"/opt/storage/sdcard/";
41 static const wchar_t _EXTERNAL_MMC_IMAGES_PATH[] = L"/opt/storage/sdcard/Images/";
42 static const wchar_t _EXTERNAL_MMC_SOUNDS_PATH[] = L"/opt/storage/sdcard/Sounds/";
43 static const wchar_t _EXTERNAL_MMC_VIDEOS_PATH[] = L"/opt/storage/sdcard/Videos/";
44 static const wchar_t _EXTERNAL_MMC_CAMERA_PATH[] = L"/opt/storage/sdcard/Camera/";
45 static const wchar_t _EXTERNAL_MMC_DOWNLOADS_PATH[] = L"/opt/storage/sdcard/Downloads/";
46 static const wchar_t _EXTERNAL_MMC_OTHERS_PATH[] = L"/opt/storage/sdcard/Others/";
47 static const wchar_t _RINGTONE_PATH[] = L"/opt/share/settings/Ringtones";
49 static const wchar_t _APPLICATIONS_PATH[] = L"/opt/usr/apps/";
50 static const wchar_t _EXTERNAL_APPLICATIONS_PATH[] = L"/opt/storage/sdcard/app2sd/";
52 static const wchar_t _COMPAT_SHARED_PATH[] = L"/opt/usr/share/.osp-compat/";
54 _EnvironmentImpl::_EnvironmentImpl(void)
58 _EnvironmentImpl::~_EnvironmentImpl(void)
63 _EnvironmentImpl::GetMediaPath(void)
65 static String mediaPath(_MEDIA_PATH);
70 _EnvironmentImpl::GetDefaultDownloadPath(void)
72 static String downloadPath(_MEDIA_DOWNLOADS_PATH);
77 _EnvironmentImpl::GetExternalStoragePath(void)
79 static String externalStoragePath(_EXTERNAL_MMC_PATH);
80 return externalStoragePath;
84 _EnvironmentImpl::GetOspCompatSharedPath(void)
86 static String ospCompatSharedPath(_COMPAT_SHARED_PATH);
87 return ospCompatSharedPath;
91 _EnvironmentImpl::GetPredefinedPath(PredefinedDirectoryType dirType)
95 case PREDEFINED_DIRECTORY_IMAGES:
97 String path(_MEDIA_IMAGES_PATH);
100 case PREDEFINED_DIRECTORY_SOUNDS:
102 static String path(_MEDIA_SOUNDS_PATH);
105 case PREDEFINED_DIRECTORY_VIDEOS:
107 static String path(_MEDIA_VIDEOS_PATH);
110 case PREDEFINED_DIRECTORY_CAMERA:
112 static String path(_MEDIA_CAMERA_PATH);
115 case PREDEFINED_DIRECTORY_DOWNLOADS:
117 static String path(_MEDIA_DOWNLOADS_PATH);
120 case PREDEFINED_DIRECTORY_OTHERS:
122 static String path(_MEDIA_OTHERS_PATH);
125 case PREDEFINED_DIRECTORY_SYSTEM_RINGTONES:
127 static String path(_RINGTONE_PATH);
129 case PREDEFINED_DIRECTORY_EXTERNAL_IMAGES:
131 static String path(_EXTERNAL_MMC_IMAGES_PATH);
134 case PREDEFINED_DIRECTORY_EXTERNAL_SOUNDS:
136 static String path(_EXTERNAL_MMC_SOUNDS_PATH);
139 case PREDEFINED_DIRECTORY_EXTERNAL_VIDEOS:
141 static String path(_EXTERNAL_MMC_VIDEOS_PATH);
144 case PREDEFINED_DIRECTORY_EXTERNAL_CAMERA:
146 static String path(_EXTERNAL_MMC_CAMERA_PATH);
149 case PREDEFINED_DIRECTORY_EXTERNAL_DOWNLOADS:
151 static String path(_EXTERNAL_MMC_DOWNLOADS_PATH);
154 case PREDEFINED_DIRECTORY_EXTERNAL_OTHERS:
156 static String path(_EXTERNAL_MMC_OTHERS_PATH);
159 case PREDEFINED_DIRECTORY_APPLICATIONS:
161 static String path(_APPLICATIONS_PATH);
164 case PREDEFINED_DIRECTORY_EXTERNAL_APPLICATIONS:
166 static String path(_EXTERNAL_APPLICATIONS_PATH);