作者:wrennlatsha_188 | 来源:互联网 | 2023-08-17 09:07
本文整理了Java中software.amazon.awssdk.core.async.AsyncRequestBody.fromFile()方法的一些代码示例,展示了
本文整理了Java中software.amazon.awssdk.core.async.AsyncRequestBody.fromFile()
方法的一些代码示例,展示了AsyncRequestBody.fromFile()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AsyncRequestBody.fromFile()
方法的具体详情如下:
包路径:software.amazon.awssdk.core.async.AsyncRequestBody
类名称:AsyncRequestBody
方法名:fromFile
AsyncRequestBody.fromFile介绍
[英]Creates an AsyncRequestBody that produces data from the contents of a file. See FileAsyncRequestBody#builder to create a customized body implementation.
[中]
代码示例
代码示例来源:origin: aws/aws-sdk-java-v2
/**
* Invokes the StreamingInputOperation operation asynchronously.
*
* @param streamingInputOperationRequest
* @param sourcePath
* {@link Path} to file containing data to send to the service. File will be read entirely and may be read
* multiple times in the event of a retry. If the file does not exist or the current user does not have
* access to read it then an exception will be thrown. The service documentation for the request content is
* as follows ''
* @return A Java Future containing the result of the StreamingInputOperation operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - ProtocolRestJsonException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample ProtocolRestJsonAsyncClient.StreamingInputOperation
* @see * target="_top">AWS API Documentation
*/
default CompletableFuture streamingInputOperation(
StreamingInputOperationRequest streamingInputOperationRequest, Path sourcePath) {
return streamingInputOperation(streamingInputOperationRequest, AsyncRequestBody.fromFile(sourcePath));
}
代码示例来源:origin: aws/aws-sdk-java-v2
/**
* Invokes the StreamingInputOperation operation asynchronously.
*
* @param streamingInputOperationRequest
* @param sourcePath
* {@link Path} to file containing data to send to the service. File will be read entirely and may be read
* multiple times in the event of a retry. If the file does not exist or the current user does not have
* access to read it then an exception will be thrown. The service documentation for the request content is
* as follows ''
* @return A Java Future containing the result of the StreamingInputOperation operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - ProtocolRestJsonException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample ProtocolRestJsonAsyncClient.StreamingInputOperation
* @see * target="_top">AWS API Documentation
*/
default CompletableFuture streamingInputOperation(
StreamingInputOperationRequest streamingInputOperationRequest, Path sourcePath) {
return streamingInputOperation(streamingInputOperationRequest, AsyncRequestBody.fromFile(sourcePath));
}
代码示例来源:origin: aws/aws-sdk-java-v2
/**
* Invokes the StreamingInputOperation operation asynchronously.
*
* @param streamingInputOperationRequest
* @param sourcePath
* {@link Path} to file containing data to send to the service. File will be read entirely and may be read
* multiple times in the event of a retry. If the file does not exist or the current user does not have
* access to read it then an exception will be thrown. The service documentation for the request content is
* as follows ''
* @return A Java Future containing the result of the StreamingInputOperation operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - CodeGenerationJsonRpcCustomizedException Base class for all service exceptions. Unknown exceptions
* will be thrown as an instance of this type.
*
* @sample CodeGenerationJsonRpcCustomizedAsyncClient.StreamingInputOperation
*/
default CompletableFuture streamingInputOperation(
StreamingInputOperationRequest streamingInputOperationRequest, Path sourcePath) {
return streamingInputOperation(streamingInputOperationRequest, AsyncRequestBody.fromFile(sourcePath));
}
代码示例来源:origin: aws/aws-sdk-java-v2
return putObject(putObjectRequest, AsyncRequestBody.fromFile(sourcePath));
代码示例来源:origin: software.amazon.awssdk/mediastoredata
return putObject(putObjectRequest, AsyncRequestBody.fromFile(sourcePath));
代码示例来源:origin: aws/aws-sdk-java-v2
return uploadPart(uploadPartRequest, AsyncRequestBody.fromFile(sourcePath));
代码示例来源:origin: aws/aws-sdk-java-v2
return putObject(putObjectRequest, AsyncRequestBody.fromFile(sourcePath));
代码示例来源:origin: aws/aws-sdk-java-v2
return uploadDocuments(uploadDocumentsRequest, AsyncRequestBody.fromFile(sourcePath));
代码示例来源:origin: aws/aws-sdk-java-v2
return uploadArchive(uploadArchiveRequest, AsyncRequestBody.fromFile(sourcePath));
代码示例来源:origin: software.amazon.awssdk/glacier
return uploadArchive(uploadArchiveRequest, AsyncRequestBody.fromFile(sourcePath));
代码示例来源:origin: software.amazon.awssdk/glacier
return uploadMultipartPart(uploadMultipartPartRequest, AsyncRequestBody.fromFile(sourcePath));
代码示例来源:origin: aws/aws-sdk-java-v2
return uploadMultipartPart(uploadMultipartPartRequest, AsyncRequestBody.fromFile(sourcePath));
代码示例来源:origin: aws/aws-sdk-java-v2
return postContent(postContentRequest, AsyncRequestBody.fromFile(sourcePath),
AsyncResponseTransformer.toFile(destinationPath));
代码示例来源:origin: software.amazon.awssdk/lexruntime
return postContent(postContentRequest, AsyncRequestBody.fromFile(sourcePath),
AsyncResponseTransformer.toFile(destinationPath));