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 public class DirectoryInfo
24 private string _dataPath;
25 private string _cachePath;
26 private string _resourcePath;
28 private string _sharedDataPath;
29 private string _sharedResourcePath;
30 private string _sharedTrustedPath;
32 private string _externalDataPath;
33 private string _externalCachePath;
34 private string _externalSharedDataPath;
36 private string _expansionPackageResourcePath;
38 internal DirectoryInfo()
43 /// Gets the absolute path to the application's data directory which is used to store private data of the application.
49 if (_dataPath == null)
50 _dataPath = Interop.AppCommon.AppGetDataPath();
56 /// Gets the absolute path to the application's cache directory which is used to store temporary data of the application.
62 if (_cachePath == null)
63 _cachePath = Interop.AppCommon.AppGetCachePath();
69 /// Gets the absolute path to the application resource directory. The resource files are delivered with the application package.
71 public string Resource
75 if (_resourcePath == null)
76 _resourcePath = Interop.AppCommon.AppGetResourcePath();
82 /// Gets the absolute path to the application's shared data directory which is used to share data with other applications.
84 public string SharedData
88 if (_sharedDataPath == null)
89 _sharedDataPath = Interop.AppCommon.AppGetSharedDataPath();
90 return _sharedDataPath;
95 /// Gets the absolute path to the application's shared resource directory which is used to share resources with other applications.
97 public string SharedResource
101 if (_sharedResourcePath == null)
102 _sharedResourcePath = Interop.AppCommon.AppGetSharedResourcePath();
103 return _sharedResourcePath;
109 /// Gets the absolute path to the application's shared trusted directory which is used to share data with a family of trusted applications.
111 public string SharedTrusted
115 if (_sharedTrustedPath == null)
116 _sharedTrustedPath = Interop.AppCommon.AppGetSharedTrustedPath();
117 return _sharedTrustedPath;
122 /// Gets the absolute path to the application's external data directory which is used to store data of the application.
124 public string ExternalData
128 if (_externalDataPath == null)
129 _externalDataPath = Interop.AppCommon.AppGetExternalDataPath();
130 return _externalDataPath;
135 /// Gets the absolute path to the application's external cache directory which is used to store temporary data of the application.
137 public string ExternalCache
141 if (_externalCachePath == null)
142 _externalCachePath = Interop.AppCommon.AppGetExternalCachePath();
143 return _externalCachePath;
148 /// Gets the absolute path to the application's external shared data directory which is used to share data with other applications.
150 public string ExternalSharedData
154 if (_externalSharedDataPath == null)
155 _externalSharedDataPath = Interop.AppCommon.AppGetExternalSharedDataPath();
156 return _externalSharedDataPath;
161 /// Gets the absolute path to the application's TEP(Tizen Expansion Package) directory. The resource files are delivered with the expansion package.
163 public string ExpansionPackageResource
167 if (_expansionPackageResourcePath == null)
168 _expansionPackageResourcePath = Interop.AppCommon.AppGetTepResourcePath();
169 return _expansionPackageResourcePath;