OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Use the <code>chrome.fileSystem</code> API to create, read, navigate, | 5 // Use the <code>chrome.fileSystem</code> API to create, read, navigate, |
6 // and write to a sandboxed section of the user's local file system. With this | 6 // and write to a sandboxed section of the user's local file system. With this |
7 // API, Chrome Apps can read and write to a user-selected location. For | 7 // API, Chrome Apps can read and write to a user-selected location. For |
8 // example, a text editor app can use the API to read and write local documents. | 8 // example, a text editor app can use the API to read and write local documents. |
9 // All failures are notified via chrome.runtime.lastError. | 9 // All failures are notified via chrome.runtime.lastError. |
10 namespace fileSystem { | 10 namespace fileSystem { |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 // in the accepts argument. The default is true. If the accepts field is | 68 // in the accepts argument. The default is true. If the accepts field is |
69 // unset or contains no valid entries, this will always be reset to true. | 69 // unset or contains no valid entries, this will always be reset to true. |
70 boolean? acceptsAllTypes; | 70 boolean? acceptsAllTypes; |
71 | 71 |
72 // Whether to accept multiple files. This is only supported for openFile and | 72 // Whether to accept multiple files. This is only supported for openFile and |
73 // openWritableFile. The callback to chooseEntry will be called with a list | 73 // openWritableFile. The callback to chooseEntry will be called with a list |
74 // of entries if this is set to true. Otherwise it will be called with a | 74 // of entries if this is set to true. Otherwise it will be called with a |
75 // single Entry. | 75 // single Entry. |
76 boolean? acceptsMultiple; | 76 boolean? acceptsMultiple; |
77 }; | 77 }; |
78 callback GetDisplayPathCallback = void (DOMString displayPath); | 78 |
| 79 dictionary GetFullPathOptions { |
| 80 // Whether to resolve symlinks. The default is false. |
| 81 boolean? resolveSymlinks; |
| 82 |
| 83 }; |
| 84 callback GetPathCallback = void (DOMString path); |
79 callback EntryCallback = void ([instanceOf=Entry] object entry); | 85 callback EntryCallback = void ([instanceOf=Entry] object entry); |
80 callback EntriesCallback = void ( | 86 callback EntriesCallback = void ( |
81 [instanceOf=Entry] optional object entry, | 87 [instanceOf=Entry] optional object entry, |
82 [instanceOf=FileEntry] optional object[] fileEntries); | 88 [instanceOf=FileEntry] optional object[] fileEntries); |
83 callback IsWritableCallback = void (boolean isWritable); | 89 callback IsWritableCallback = void (boolean isWritable); |
84 callback IsRestorableCallback = void (boolean isRestorable); | 90 callback IsRestorableCallback = void (boolean isRestorable); |
85 | 91 |
86 interface Functions { | 92 interface Functions { |
87 // Get the display path of an Entry object. The display path is based on | 93 // Get the display path of an Entry object. The display path is based on |
88 // the full path of the file or directory on the local file system, but may | 94 // the full path of the file or directory on the local file system, but may |
89 // be made more readable for display purposes. | 95 // be made more readable for display purposes. |
90 static void getDisplayPath([instanceOf=Entry] object entry, | 96 static void getDisplayPath([instanceOf=Entry] object entry, |
91 GetDisplayPathCallback callback); | 97 GetPathCallback callback); |
92 | 98 |
93 // Get a writable Entry from another Entry. This call will fail with a | 99 // Get a writable Entry from another Entry. This call will fail with a |
94 // runtime error if the application does not have the 'write' permission | 100 // runtime error if the application does not have the 'write' permission |
95 // under 'fileSystem'. If entry is a DirectoryEntry, this call will fail if | 101 // under 'fileSystem'. If entry is a DirectoryEntry, this call will fail if |
96 // the application does not have the 'directory' permission under | 102 // the application does not have the 'directory' permission under |
97 // 'fileSystem'. | 103 // 'fileSystem'. |
98 static void getWritableEntry([instanceOf=Entry] object entry, | 104 static void getWritableEntry([instanceOf=Entry] object entry, |
99 EntryCallback callback); | 105 EntryCallback callback); |
100 | 106 |
101 // Gets whether this Entry is writable or not. | 107 // Gets whether this Entry is writable or not. |
(...skipping 13 matching lines...) Expand all Loading... |
115 // given id. This method is new in Chrome 31. | 121 // given id. This method is new in Chrome 31. |
116 static void isRestorable(DOMString id, IsRestorableCallback callback); | 122 static void isRestorable(DOMString id, IsRestorableCallback callback); |
117 | 123 |
118 // Returns an id that can be passed to restoreEntry to regain access to a | 124 // Returns an id that can be passed to restoreEntry to regain access to a |
119 // given file entry. Only the 500 most recently used entries are retained, | 125 // given file entry. Only the 500 most recently used entries are retained, |
120 // where calls to retainEntry and restoreEntry count as use. If the app has | 126 // where calls to retainEntry and restoreEntry count as use. If the app has |
121 // the 'retainEntries' permission under 'fileSystem', entries are retained | 127 // the 'retainEntries' permission under 'fileSystem', entries are retained |
122 // indefinitely. Otherwise, entries are retained only while the app is | 128 // indefinitely. Otherwise, entries are retained only while the app is |
123 // running and across restarts. This method is new in Chrome 31. | 129 // running and across restarts. This method is new in Chrome 31. |
124 static DOMString retainEntry([instanceOf=Entry] object entry); | 130 static DOMString retainEntry([instanceOf=Entry] object entry); |
| 131 |
| 132 // Returns the full path on the local file system of an Entry object. |
| 133 static void getFullPath([instanceOf=Entry] object entry, |
| 134 optional GetFullPathOptions options, |
| 135 GetPathCallback callback); |
| 136 |
125 }; | 137 }; |
126 }; | 138 }; |
OLD | NEW |