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 [ | 5 [ |
6 { | 6 { |
7 "namespace":"fileBrowserPrivate", | 7 "namespace":"fileBrowserPrivate", |
8 "description": "none", | 8 "description": "none", |
9 "platforms": ["chromeos"], | 9 "platforms": ["chromeos"], |
10 "types": [ | 10 "types": [ |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
313 "description": "Approximated completed portion of the transfer opera tion." | 313 "description": "Approximated completed portion of the transfer opera tion." |
314 }, | 314 }, |
315 "total": { | 315 "total": { |
316 "type": "number", | 316 "type": "number", |
317 "optional": true, | 317 "optional": true, |
318 "description": "Approximated total size of transfer operation." | 318 "description": "Approximated total size of transfer operation." |
319 } | 319 } |
320 } | 320 } |
321 }, | 321 }, |
322 { | 322 { |
323 "id": "CopyProgressStatus", | |
324 "type": "object", | |
325 "description": "Payload data for copy status progress updates.", | |
326 "properties": { | |
327 "type": { | |
328 "type": "string", | |
329 "enum": ["BEGIN_ENTRY_COPY", "END_ENTRY_COPY", "PROGRESS", "SUCCESS" , "ERROR"], | |
330 "description": "The type of the progress event. BEGIN_ENTRY_COPY is fired for each entry (file or directory) before starting the copy operation, END _ENTRY_COPY is fired for each entry (file or directory) after ending the copy op eration. PROGRESS is fired periodically to report progress of a file copy (not d irectory). SUCCESS is fired after all entries are copied. ERROR is fired when an error occurs." | |
331 }, | |
332 "url": { | |
333 "type": "string", | |
334 "optional": true, | |
335 "description": "URL for the entry currently being copied. This field is particularly useful when a directory copy is initiated with startCopy(). The field tells what file/directory in that directory is now being copied." | |
336 }, | |
337 "size": { | |
338 "type": "number", | |
339 "optional": true, | |
340 "description": "Number of processed bytes for the file currently bei ng copied. Available only for PROGRESS event. To show the progress bar, a caller needs to pre-compute the size of files being copied for the file (not directory )." | |
341 }, | |
342 "error": { | |
343 "type": "integer", | |
344 "optional": true, | |
345 "description": "FileError's code of the error. Available only for ER ROR event." | |
346 } | |
347 } | |
348 }, | |
349 { | |
323 "id": "FileTransferCancelStatus", | 350 "id": "FileTransferCancelStatus", |
324 "type": "object", | 351 "type": "object", |
325 "description": "Payload data for file transfer cancel response.", | 352 "description": "Payload data for file transfer cancel response.", |
326 "properties": { | 353 "properties": { |
327 "fileUrl": { | 354 "fileUrl": { |
328 "type": "string", | 355 "type": "string", |
329 "description": "URL of file that is being transfered." | 356 "description": "URL of file that is being transfered." |
330 }, | 357 }, |
331 "canceled": { | 358 "canceled": { |
332 "type": "boolean", | 359 "type": "boolean", |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
785 "name" : "fileTransferCancelStatuses", | 812 "name" : "fileTransferCancelStatuses", |
786 "type": "array", | 813 "type": "array", |
787 "items": {"$ref": "FileTransferCancelStatus"}, | 814 "items": {"$ref": "FileTransferCancelStatus"}, |
788 "description": "The list of FileTransferCancelStatus." | 815 "description": "The list of FileTransferCancelStatus." |
789 } | 816 } |
790 ] | 817 ] |
791 } | 818 } |
792 ] | 819 ] |
793 }, | 820 }, |
794 { | 821 { |
822 "name": "startCopy", | |
823 "description": "Starts to copy an entry. If the source is directory, the copy is done recursively.", | |
asargent_no_longer_on_chrome
2013/08/30 05:22:10
nit: "source is directory" -> "source is a directo
hidehiko
2013/08/30 06:35:43
Done.
| |
824 "parameters": [ | |
825 { | |
826 "name": "sourceUrl", | |
827 "type": "string", | |
828 "description": "URL of the source entry to be copied." | |
829 }, | |
830 { | |
831 "name": "parent", | |
832 "type": "string", | |
833 "description": "URL of the destination directory." | |
834 }, | |
835 { | |
836 "name": "newName", | |
837 "type": "string", | |
838 "description": "Name of the new entry. It shouldn't contain '/'." | |
839 }, | |
840 { | |
841 "name": "callback", | |
842 "type": "function", | |
asargent_no_longer_on_chrome
2013/08/30 05:22:10
Consider making this optional
hidehiko
2013/08/30 06:35:43
Thank you for your feedback. Currently our client
| |
843 "description": "Completion callback.", | |
844 "parameters": [ | |
845 { | |
846 "name": "copyId", | |
847 "type": "integer", | |
848 "description": "ID of the copy task. Can be used to identify the progress, and to cancel the task." | |
849 } | |
850 ] | |
851 } | |
852 ] | |
853 }, | |
854 { | |
855 "name": "cancelCopy", | |
856 "description": "Cancels the running copy task.", | |
857 "parameters": [ | |
858 { | |
859 "name": "copyId", | |
860 "type": "integer", | |
861 "description": "ID of the copy task to be cancelled." | |
862 }, | |
863 { | |
864 "name": "callback", | |
865 "type": "function", | |
866 "optional": true, | |
867 "description": "Completion callback of the cancel.", | |
868 "parameters": [] | |
869 } | |
870 ] | |
871 }, | |
872 { | |
795 "name": "setLastModified", | 873 "name": "setLastModified", |
796 "description": "Updates last modified to specified time in seconds", | 874 "description": "Updates last modified to specified time in seconds", |
797 "parameters": [ | 875 "parameters": [ |
798 { | 876 { |
799 "name": "fileUrl", | 877 "name": "fileUrl", |
800 "type": "string", | 878 "type": "string", |
801 "description": "File url from the local file system." | 879 "description": "File url from the local file system." |
802 }, | 880 }, |
803 { | 881 { |
804 "name": "lastModified", | 882 "name": "lastModified", |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1151 "description": "Fired when file transfers with remote file system are in progress.", | 1229 "description": "Fired when file transfers with remote file system are in progress.", |
1152 "parameters": [ | 1230 "parameters": [ |
1153 { | 1231 { |
1154 "type": "array", | 1232 "type": "array", |
1155 "items": {"$ref": "FileTransferStatus"}, | 1233 "items": {"$ref": "FileTransferStatus"}, |
1156 "name": "event", | 1234 "name": "event", |
1157 "description": "List of ongoing file statuses for ongoing transfer o perations." | 1235 "description": "List of ongoing file statuses for ongoing transfer o perations." |
1158 } | 1236 } |
1159 ] | 1237 ] |
1160 }, | 1238 }, |
1239 // Here is an example of onCopyProgress: | |
1240 // Suppose a/b/c.txt (100bytes) and a/b/d.txt (200bytes), and trying to | |
1241 // copy a to x recursively. The events will be: | |
1242 // | |
1243 // BEGIN_ENTRY_COPY a | |
1244 // <create empty directory x/a> | |
1245 // END_ENTRY_COPY a | |
1246 // | |
1247 // BEGIN_ENTRY_COPY a/b | |
1248 // <create empty directory x/a/b> | |
1249 // END_ENTRY_COPY a/b | |
1250 // | |
1251 // BEGIN_ENTRY_COPY a/b/c.txt | |
1252 // PROGRESS a/b/c.txt 0 | |
1253 // PROGRESS a/b/c.txt 10 | |
1254 // : | |
1255 // PROGRESS a/b/c.txt 100 | |
1256 // END_ENTRY_COPY a/b/c.txt | |
1257 // | |
1258 // BEGIN_ENTRY_COPY a/b/d.txt | |
1259 // PROGRESS a/b/d.txt 0 | |
1260 // PROGRESS a/b/d.txt 10 | |
1261 // : | |
1262 // PROGRESS a/b/d.txt 200 | |
1263 // END_ENTRY_COPY a/b/d.txt | |
1264 // | |
1265 // SUCCESS x/a | |
1266 { | |
1267 "name": "onCopyProgress", | |
1268 "type": "function", | |
1269 "description": "Periodically fired during a copy task to report its prog ress update.", | |
1270 "parameters": [ | |
1271 { | |
1272 "type": "integer", | |
1273 "name": "copyId", | |
1274 "description": "Id of the copy task of this progress update." | |
1275 }, | |
1276 { | |
1277 "$ref": "CopyProgressStatus", | |
1278 "name": "status", | |
1279 "description": "Progress update status." | |
1280 } | |
1281 ] | |
1282 }, | |
1161 { | 1283 { |
1162 "name": "onDirectoryChanged", | 1284 "name": "onDirectoryChanged", |
1163 "type": "function", | 1285 "type": "function", |
1164 "description": "Fired when watched file change event is detected in a wa tched directory.", | 1286 "description": "Fired when watched file change event is detected in a wa tched directory.", |
1165 "parameters": [ | 1287 "parameters": [ |
1166 { | 1288 { |
1167 "$ref": "FileWatchEvent", | 1289 "$ref": "FileWatchEvent", |
1168 "name": "event", | 1290 "name": "event", |
1169 "description": "File watch event information." | 1291 "description": "File watch event information." |
1170 } | 1292 } |
1171 ] | 1293 ] |
1172 }, | 1294 }, |
1173 { | 1295 { |
1174 "name": "onPreferencesChanged", | 1296 "name": "onPreferencesChanged", |
1175 "type": "function", | 1297 "type": "function", |
1176 "description": "Fired when file manager preferences change. The preferen ces can be retrieved via 'getPreferences'.", | 1298 "description": "Fired when file manager preferences change. The preferen ces can be retrieved via 'getPreferences'.", |
1177 "parameters": [] | 1299 "parameters": [] |
1178 }, | 1300 }, |
1179 { | 1301 { |
1180 "name": "onDriveConnectionStatusChanged", | 1302 "name": "onDriveConnectionStatusChanged", |
1181 "type": "function", | 1303 "type": "function", |
1182 "description": "Fired when the active network connection state changes. The network connection state can be retrieved via 'getDriveConnectionState'.", | 1304 "description": "Fired when the active network connection state changes. The network connection state can be retrieved via 'getDriveConnectionState'.", |
1183 "parameters": [] | 1305 "parameters": [] |
1184 } | 1306 } |
1185 ] | 1307 ] |
1186 } | 1308 } |
1187 ] | 1309 ] |
OLD | NEW |