您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
30 KiB
30 KiB
HuaweiService.cloudstorage
Scenario: AGCStorageManagement初始化
Description | Api | Reference |
---|---|---|
Initializes the default storage instance.初始化系统默认的存储实例 |
AGCStorageManagement.getInstance(); | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/AGCStorageManagement |
Initializes your own storage instance. 初始化开发者自己创建的的存储实例。 |
getInstance(String bucketName) | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/AGCStorageManagement |
Initializes the storage instance using the builder class for HttpURLConnection, which that you have overridden. 使用重写的HttpURLConnection的创建类来初始化存储实例。 |
getInstance(HttpURLConnectionFactory factory) | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/AGCStorageManagement |
Scenario: AGCStorageManagement创建引用
Description | Api | Reference |
---|---|---|
Creates a reference to the root directory.创建根目录的引用。 |
getStorageReference() | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/AGCStorageManagement |
Creates a reference to a file or directory with a specified file path address. 创建指定文件路径地址的文件或目录的引用。 |
getStorageReference(String objectPath) | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/AGCStorageManagement |
Creates a reference to a cloud file or directory with a specified file path. 创建指定云端地址的文件或目录的引用。 |
getReferenceFromUrl(String fullUrl) | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/AGCStorageManagement |
Scenario: AGCStorageManagement获取配置
Scenario: StorageReference云端文件的引用
Scenario: StorageReference 删除文件
Description | Api | Reference |
---|---|---|
Deletes a file from the cloud server. 删除云端文件。删除目录时,请先枚举并删除该目录下的所有文件,否则目录不会被删除。 |
delete() | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageReference |
Scenario: StorageReference获取文件列表
Description | Api | Reference |
---|---|---|
Obtains a file list under a directory in pagination mode.分页获取目录下的文件列表。 |
list(int max, String marker) | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageReference |
Obtains the list of files with a specified number in a directory. 获取目录下指定文件数量的文件列表。 |
list(int max) | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageReference |
Obtains all objects in a directory, including files and subdirectories. 获取目录下所有文件列表。 |
listAll() | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageReference |
Scenario: StorageReference上传文件
Description | Api | Reference |
---|---|---|
Saves a local file to the cloud server and continues to upload the remaining part of the file from the offset position. 将本地文件存储到云端,从offset位置继续上传文件的剩下部分。 |
putFile(File srcFile, FileMetadata attribute, Long offset) | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageReference |
Saves a local file to the cloud server. 将本地文件存储到云端。 |
putFile(File srcFile, FileMetadata attribute) | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageReference |
Saves a local file to the cloud server. 将本地文件存储到云端。 |
putFile(File srcFile) | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageReference |
Uploads a local file binary byte array to the cloud server. 将本地的二进制字节数组上传到云端。 |
putBytes(byte[] bytes, FileMetadata attribute) | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageReference |
Uploads a local binary byte array from the offset position to the cloud server. 从offset位置开始将本地的二进制字节数组上传到云端。 |
putBytes(byte[] bytes, FileMetadata attribute, Long offset) | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageReference |
Scenario: StorageReference下载文件
Description | Api | Reference |
---|---|---|
Downloads a cloud file to a specified local file. 下载一个云端文件到指定的本地文件(文件由App管理,当文件大小超过0字节时,该接口会将文件大小作为断点续传的偏移位置,继续从云端下载) |
getFile(File destFile) | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageReference |
Downloads a cloud file to a local file with a specified URI. 下载一个云端文件到指定的Uri文件(文件由App管理,当文件大小超过0字节时,该接口会将文件大小作为断点续传的偏移位置,继续从云端下载) |
getFile(Uri destUri) | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageReference |
Returns a stream download task. 返回一个流式的下载任务。 |
getStream() | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageReference |
Returns a stream download task that implements a stream processing event. 返回一个实现了数据流处理事件的流式下载任务 |
getStream(StreamDownloadTask.StreamHandler streamHandler) | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageReference |
Downloads specified data from the cloud server to a binary byte array. 从云端存储中下载指定的数据到二进制字节数组中 |
getBytes(final long maxDownloadBytes) | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageReference |
Obtains the sharing URL of a cloud file. 获取云端文件的分享地址 |
getDownloadUrl() | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageReference |
Obtains the ongoing upload task list under the current reference. 获取当前引用下处于运行状态的上传任务列表 |
getActiveUploadTasks() | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageReference |
Obtains the ongoing download task list under the current reference. 获取当前引用下处于运行状态的下载任务列表 |
getActiveDownloadTasks() | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageReference |
Scenario: StorageReference文件操作
Description | Api | Reference |
---|---|---|
Compares reference addresses.比较引用地址。 |
compareTo(StorageReference other) | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageReference |
Returns the reference URL. 返回引用的Url地址。 |
toString() | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageReference |
Compares references. 比较引用是否相同。 |
equals(Object other) | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageReference |
Obtains the hashcode of a reference. 返回引用的hashcode值。 |
hashCode() | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageReference |
Scenario: FileMetadata配置文件云数据
Description | Api | Reference |
---|---|---|
Sets the SHA-256 value for file upload verification.设置上传文件的sha256(上传文件校验使用,更新元数据时该参数无意义) |
setSHA256Hash(String sha256) | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/FileMetadata |
Sets ContentType for the standard HTTP header.设置标准HTTP头部的ContentType类型。 |
setContentType(String contentType) | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/FileMetadata |
Sets CacheControl for the standard HTTP header. 设置标准HTTP头部的CacheControl设置。 |
setCacheControl(String cacheControl) | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/FileMetadata |
Sets ContentDisposition for the standard HTTP header. 设置标准HTTP头部的ContentDisposition设置。 |
setContentDisposition(String contentDisposition) | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/FileMetadata |
Sets ContentEncoding for the standard HTTP header. 设置标准HTTP头部的ContentEncoding设置。 |
setContentEncoding(String contentEncoding) | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/FileMetadata |
Sets ContentLanguage for the standard HTTP header. 设置标准HTTP头部的ContentLanguage设置。 |
setContentLanguage(String contentLanguage) | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/FileMetadata |
Sets custom cloud file attributes. 设置自定义的云端文件属性,不区分大小写,并且需要符合标准HTTP头部的规范。 |
setCustomMetadata(Map<String, String> metadata) | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/FileMetadata |
Obtains a reference to a file or directory. 返回文件或目录的引用。 |
getStorageReference() | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/FileMetadata |
Scenario: FileMetadata文件的元数据操作
Scenario: StorageTask注册任务
Description | Api | Reference |
---|---|---|
Registers a listener for task cancellation. 注册任务取消的监听器。 |
addOnCanceledListener(OnCanceledListener listener) addOnCanceledListener(Executor executor, OnCanceledListener listener) addOnCanceledListener(Activity activity, OnCanceledListener listener) |
https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageTask |
Registers a listener for task completion. 注册任务完成的监听器。 |
addOnCompleteListener(OnCompleteListener listener) addOnCompleteListener(Executor executor, OnCompleteListener listener) addOnCompleteListener(Activity activity, OnCompleteListener listener) |
https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageTask |
Registers a listener for task failure. 注册任务失败的监听器。 |
addOnFailureListener(OnFailureListener listener) addOnFailureListener(Executor executor, OnFailureListener listener) addOnFailureListener(Activity activity, OnFailureListener listener) |
https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageTask |
Registers a listener for task success. 注册任务成功的监听器。 |
addOnSuccessListener(OnSuccessListener listener) addOnSuccessListener(Executor executor, OnSuccessListener listener) addOnSuccessListener(Activity activity, OnSuccessListener listener) |
https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageTask |
Registers a listener for task suspension. 注册任务暂停的监听器。 |
addOnPausedListener(OnPausedListener listener) addOnPausedListener(Executor executor, OnPausedListener listener) addOnPausedListener(Activity activity, OnPausedListener listener) |
https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageTask |
Registers a listener for task execution. 注册任务执行中的监听器。 |
addOnProgressListener(OnProgressListener listener) addOnProgressListener(Executor executor, OnProgressListener listener) addOnProgressListener(Activity activity, OnProgressListener listener) |
https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageTask |
Scenario: StorageTask任务处理
Description | Api | Reference |
---|---|---|
Continues to execute the current task. 继续执行任务。 |
continueWithTask(ExecuteResult executeResult) continueWith(Continuation<TResult, TContinuationResult> continuation) |
https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageTask |
Continues to execute the task. 当前任务成功完成后,执行下一个任务。 |
continueWith(Executor executor, Continuation<TResult, TContinuationResult> continuation) continueWithTask(Executor executor, Continuation<TResult, Task> continuation) |
|
onSuccessTask(SuccessContinuation<TResult, TContinuation> continuation) onSuccessTask(Executor executor, SuccessContinuation<TResult, TContinuation> continuation) |
https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageTask | |
Cancels a task.取消任务。 Suspends a task. 暂停任务。 Resumes a task. 继续任务。 |
cancel() pause() resume() |
https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageTask |
Determines whether a task is canceled. 任务是否已取消。 |
||
Determines whether a task is complete.任务是否已完成。 |
||
Determines whether a task is successful.任务是否已成功。 |
||
Determines whether a task is being executed.任务是否正在执行中。 |
||
Determines whether a task is suspended.任务是否已暂停。 |
isCanceled() isComplete() isSuccessful() isInProgress() isPaused() |
https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageTask |
Obtains result information.获取结果信息。 Sets result information. 设置结果信息。 Obtains the task result. 返回任务结果。 |
getResult() setResult(TResult result) getTimePointState() |
https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageTask |
Obtains exception information. 获取异常信息。 Sets exception information. 设置异常信息 Obtains the result when an exception occurs. 获取结果时抛出的异常。 |
getException() setException(Exception exception) getResultThrowException(Class exceptionClass) |
https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageTask |
Removes the listener. 移除任务监听器 |
removeOnCanceledListener(OnCanceledListener listener) removeOnCompleteListener(OnCompleteListener listener) removeOnFailureListener(OnFailureListener listener) removeOnSuccessListener(OnSuccessListener listener) removeOnPausedListener(OnPausedListener listener) removeOnProgressListener(OnProgressListener listener) |
https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageTask |
Obtains error information.任务执行状态中的错误信息。 |
StorageTask.ErrorResult. getError() | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageTask-ErrorResult |
Scenario: StorageTask.TimePointStateBase任务状态信息
Description | Api | Reference |
---|---|---|
Obtains a StorageTask instance.获取StorageTask实例。 |
getTask() | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageTask-TimePointStateBase |
Obtains the reference to a task.获取该任务的引用。 |
getStorage() | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageTask-TimePointStateBase |
Obtains exception information.获取异常信息。 |
getError() | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StorageTask-TimePointStateBase |
Scenario: Download Task 下载任务操作
Description | Api | Reference |
---|---|---|
Cancels a task. 取消文件下载任务 |
DownloadTask.onCanceled() | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/DownloadTask |
Suspends a task. 暂停文件下载任务 |
DownloadTask.onPaused() | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/DownloadTask |
Cancels a task. 取消流式下载任务的结果信息。 |
StreamDownloadTask.onCanceled() | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StreamDownloadTask |
Refreshes the task progress. 刷新流式下载任务进度 |
StreamDownloadTask.onProgress() | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StreamDownloadTask |
Reads data from streams for service processing. 数据流读取接口 |
StreamDownloadTask.StreamHandler.readStream(StreamDownloadResult state, InputStream stream) throws IOException | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StreamDownloadTask-StreamHandler |
Scenario: DownloadTask.DownloadResult下载任务的结果信息
Description | Api | Reference |
---|---|---|
Get transferred bytes 获取已传输的字节。 |
getBytesTransferred() | |
Get total byte count 获取下载文件的总字节。 |
getTotalByteCount() |
Scenario: StreamDownloadTask.StreamDownloadResult流式下载任务的结果信息
Description | Api | Reference |
---|---|---|
Obtains passed bytes.获取已传输的字节。 |
getBytesTransferred() | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StreamDownloadTask-StreamDownloadResult |
Obtains the total file size.获取文件总大小。 |
getTotalByteCount() | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StreamDownloadTask-StreamDownloadResult |
Obtains a response stream.获取响应数据流。 |
getStream() | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/StreamDownloadTask-StreamDownloadResult |
Scenario: UploadTask上传任务的操作
Description | Api | Reference |
---|---|---|
Resumes the upload of a file to the cloud server.将上传任务延续上一次的进度上传到云端。 |
resume() | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/UploadTask |
Pauses the current upload task. 暂停当前上传任务。 |
onPaused() | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/UploadTask |
Cancels a task. 取消任务。 |
onCanceled() | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/UploadTask |
Resets task status. 重置任务状态。 |
resetState() | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/UploadTask |
Executes a task. 执行任务。 |
schedule() | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/UploadTask |
Scenario: UploadTask.UploadResult上传任务的结果信息
Description | Api | Reference |
---|---|---|
Obtains passed bytes.获取已传输的字节。 |
getBytesTransferred() | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/UploadTask-UploadResult |
Obtains the total number of bytes of an uploaded file. 获取上传文件的总字节 |
getTotalByteCount() | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/UploadTask-UploadResult |
Obtains metadata of an uploaded file.获取云端文件的云数据信息 |
getMetadata() | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/UploadTask-UploadResult |
Scenario: ListResult获取文件和子目录信息的列表
Description | Api | Reference |
---|---|---|
Obtains the references to all files in ListResult.获取ListResult中所有文件的引用。 |
getFileList() | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/ListResult |
Obtains the references to all directories in ListResult. 获取ListResult中所有目录的引用。 |
getDirList() | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/ListResult |
Obtains the pagination identifier for pagination query. 获取分页查询时的分页标识符。 |
getPageMarker() | |
https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/ListResult |
Scenario: ProgressListener任务监听器
Description | Api | Reference |
---|---|---|
Callback method when the task progress changes. 任务运行过程中的监听器,用来刷新任务进度条。 |
public interface OnProgressListener onProgress(TResult timePointState) |
https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/OnProgressListener |
Callback method when a task is suspended. 暂停任务的监听器。 |
public interface OnPausedListener OnPaused(TResult timePointState) |
https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/OnPausedListener |