camera.delete
使用指定 URI 刪除檔案。這個指令是在 API 級別 2 中修改。
參數
- API 級別 1
- fileUri:要刪除的檔案的 URI。製造商決定
是否使用絕對或相對 URI用戶端可能會將其視為不透明
或 ID。
- API 級別 2
結果
- fileUrls:未成功刪除的檔案網址。
請注意,如果 fileUrls 中的所有網址都有效,但相機無法正常運作,就會發生這個問題
刪除其中一些如有任何網址無效,錯誤代碼
傳回
invalidParameterValue
時,不應刪除任何檔案。
已新增至 API 級別 2。
錯誤
- missingParameter:未指定
fileUri
。
- INVALIDParameterName:無法辨識輸入參數名稱。
- invalidParameterValue::系統會識別輸入參數名稱,
但值無效;舉例來說,
fileUri
沒有
在 API 級別 1 中,或 fileUrls 中的任何網址不存在於 API 級別 2 中。
指令 I/O |
指令輸入 (API 級別 1) |
{ "parameters": { "fileUri": "file URI" } } |
指令輸出 (API 級別 1) |
none |
指令輸出 (錯誤) (API 級別 1) |
{ "error": { "code": "invalidParameterName", "message": "Parameter XYZ is unrecognized." } } |
指令輸入 (API 級別 2) |
{ "parameters": { "fileUrls": [ "url1", "url2", "url3", ... "urln" ] } } |
指令輸出 (API 級別 2) |
{ "results": { "fileUrls": [ "urln" ] } } |
指令輸出 (錯誤) (API 級別 2) |
{ "error": { "code": "invalidParameterValue", "message": "Parameter url3 doesn't exist." } } |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-08-21 (世界標準時間)。
[null,null,["上次更新時間:2024-08-21 (世界標準時間)。"],[[["The `deleteFile` command removes one or more files from the camera's storage."],["API level 1 uses `fileUri` to specify a single file for deletion, while API level 2 uses `fileUrls` to specify one or more files, or uses special values to delete all files, all images, or all videos."],["Errors are returned if parameters are missing, invalid, or if the specified files cannot be deleted."],["API level 2 introduced the `fileUrls` parameter and the ability to return a list of unsuccessfully deleted files in the results."]]],["This describes a command to delete files from a camera. In API level 1, it accepts a `fileUri` to delete a single file, where the URI's format is determined by the manufacturer. API level 2 was introduced to use the `fileUrls` parameter for multiple files, specified by absolute URLs. Special strings like \"all\", \"image\", or \"video\" delete all files, all images, or all videos. A list of `fileUrls` will return any files that did not delete correctly. Errors include invalid parameters or missing data.\n"]]