2 * Copyright (c) 2016 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.
17 namespace Tizen.Applications
20 /// Represents directory information of the application.
22 /// <since_tizen> 3 </since_tizen>
23 public class DirectoryInfo
25 private string _dataPath;
26 private string _cachePath;
27 private string _resourcePath;
29 private string _sharedDataPath;
30 private string _sharedResourcePath;
31 private string _sharedTrustedPath;
33 private string _externalDataPath;
34 private string _externalCachePath;
35 private string _externalSharedDataPath;
37 private string _expansionPackageResourcePath;
39 internal DirectoryInfo()
44 /// Gets the absolute path to the application's data directory, which is used to store private data of the application.
46 /// <since_tizen> 3 </since_tizen>
51 if (_dataPath == null)
52 _dataPath = Interop.AppCommon.AppGetDataPath();
58 /// Gets the absolute path to the application's cache directory, which is used to store temporary data of the application.
60 /// <since_tizen> 3 </since_tizen>
65 if (_cachePath == null)
66 _cachePath = Interop.AppCommon.AppGetCachePath();
72 /// Gets the absolute path to the application resource directory. The resource files are delivered with the application package.
74 /// <since_tizen> 3 </since_tizen>
75 public string Resource
79 if (_resourcePath == null)
80 _resourcePath = Interop.AppCommon.AppGetResourcePath();
86 /// Gets the absolute path to the application's shared data directory, which is used to share data with other applications.
88 /// <since_tizen> 3 </since_tizen>
89 public string SharedData
93 if (_sharedDataPath == null)
94 _sharedDataPath = Interop.AppCommon.AppGetSharedDataPath();
95 return _sharedDataPath;
100 /// Gets the absolute path to the application's shared resource directory, which is used to share resources with other applications.
102 /// <since_tizen> 3 </since_tizen>
103 public string SharedResource
107 if (_sharedResourcePath == null)
108 _sharedResourcePath = Interop.AppCommon.AppGetSharedResourcePath();
109 return _sharedResourcePath;
115 /// Gets the absolute path to the application's shared trusted directory, which is used to share data with a family of trusted applications.
117 /// <since_tizen> 3 </since_tizen>
118 public string SharedTrusted
122 if (_sharedTrustedPath == null)
123 _sharedTrustedPath = Interop.AppCommon.AppGetSharedTrustedPath();
124 return _sharedTrustedPath;
129 /// Gets the absolute path to the application's external data directory, which is used to store data of the application.
131 /// <since_tizen> 3 </since_tizen>
132 public string ExternalData
136 if (_externalDataPath == null)
137 _externalDataPath = Interop.AppCommon.AppGetExternalDataPath();
138 return _externalDataPath;
143 /// Gets the absolute path to the application's external cache directory, which is used to store temporary data of the application.
145 /// <since_tizen> 3 </since_tizen>
146 public string ExternalCache
150 if (_externalCachePath == null)
151 _externalCachePath = Interop.AppCommon.AppGetExternalCachePath();
152 return _externalCachePath;
157 /// Gets the absolute path to the application's external shared data directory, which is used to share data with other applications.
159 /// <since_tizen> 3 </since_tizen>
160 public string ExternalSharedData
164 if (_externalSharedDataPath == null)
165 _externalSharedDataPath = Interop.AppCommon.AppGetExternalSharedDataPath();
166 return _externalSharedDataPath;
171 /// Gets the absolute path to the application's TEP(Tizen Expansion Package) directory. The resource files are delivered with the expansion package.
173 /// <since_tizen> 3 </since_tizen>
174 public string ExpansionPackageResource
178 if (_expansionPackageResourcePath == null)
179 _expansionPackageResourcePath = Interop.AppCommon.AppGetTepResourcePath();
180 return _expansionPackageResourcePath;