6e19528ea351ebb518a22d237a972c8cb6ddefe5
[test/tct/web/api.git] /
1 cordova.define("cordova-plugin-file.fileSystemPaths", function(require, exports, module) { /*
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20 */
21
22 var exec = require('cordova/exec');
23 var channel = require('cordova/channel');
24
25 exports.file = {
26     // Read-only directory where the application is installed.
27     applicationDirectory: null,
28     // Root of app's private writable storage
29     applicationStorageDirectory: null,
30     // Where to put app-specific data files.
31     dataDirectory: null,
32     // Cached files that should survive app restarts.
33     // Apps should not rely on the OS to delete files in here.
34     cacheDirectory: null,
35     // Android: the application space on external storage.
36     externalApplicationStorageDirectory: null,
37     // Android: Where to put app-specific data files on external storage.
38     externalDataDirectory: null,
39     // Android: the application cache on external storage.
40     externalCacheDirectory: null,
41     // Android: the external storage (SD card) root.
42     externalRootDirectory: null,
43     // iOS: Temp directory that the OS can clear at will.
44     tempDirectory: null,
45     // iOS: Holds app-specific files that should be synced (e.g. to iCloud).
46     syncedDataDirectory: null,
47     // iOS: Files private to the app, but that are meaningful to other applciations (e.g. Office files)
48     documentsDirectory: null,
49     // BlackBerry10: Files globally available to all apps
50     sharedDirectory: null
51 };
52
53 channel.waitForInitialization('onFileSystemPathsReady');
54 channel.onCordovaReady.subscribe(function() {
55     function after(paths) {
56         for (var k in paths) {
57             exports.file[k] = paths[k];
58         }
59         channel.initializationComplete('onFileSystemPathsReady');
60     }
61     exec(after, null, 'File', 'requestAllPaths', []);
62 });
63
64
65 });