java.lang.Object
com.hedera.hashgraph.sdk.Executable<FileContentsQuery,Query,Response,com.google.protobuf.ByteString>
com.hedera.hashgraph.sdk.Query<com.google.protobuf.ByteString,FileContentsQuery>
com.hedera.hashgraph.sdk.FileContentsQuery
public final class FileContentsQuery
extends Query<com.google.protobuf.ByteString,FileContentsQuery>
Get the contents of a file. The content field is empty (no bytes) if the
file is empty.
A query to get the contents of a file. Queries do not change the state of
the file or require network consensus. The information is returned from a
single node processing the query.
See Hedera Documentation
-
Nested Class Summary
Nested classes/interfaces inherited from class com.hedera.hashgraph.sdk.Executable
Executable.GrpcRequest -
Field Summary
Fields inherited from class com.hedera.hashgraph.sdk.Query
paymentTransactionId, paymentTransactionsFields inherited from class com.hedera.hashgraph.sdk.Executable
attemptedAllNodes, blockingUnaryCall, grpcDeadline, logger, maxAttempts, maxBackoff, minBackoff, nodeAccountIds, nodes, random, RST_STREAM -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCostAsync(Client client) Fetch the expected cost asynchronously.Extract the file id.Called to direct the invocation of the query to the appropriate gRPC service.(package private) QueryHeadermapRequestHeader(Query request) The derived class should access its request header and return.(package private) com.google.protobuf.ByteStringmapResponse(Response response, AccountId nodeId, Query request) Called after receiving the query response from Hedera.(package private) ResponseHeadermapResponseHeader(Response response) The derived class should access its response header and return.(package private) voidonMakeRequest(Query.Builder queryBuilder, QueryHeader header) Called inQuery.makeRequest()just before the query is built.Sets the file ID of the file whose contents are requested.(package private) voidvalidateChecksums(Client client) Validate the checksums.Methods inherited from class com.hedera.hashgraph.sdk.Query
getCost, getCost, getCostAsync, getCostAsync, getCostAsync, getCostAsync, getCostAsync, getOperatorFromClient, getPaymentTransaction, getPaymentTransactionId, getTransactionIdInternal, isPaymentRequired, makeRequest, mapResponseStatus, onExecute, onExecuteAsync, setMaxQueryPayment, setPaymentTransactionId, setQueryPayment, toStringMethods inherited from class com.hedera.hashgraph.sdk.Executable
advanceRequest, checkNodeAccountIds, execute, execute, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, getExecutionState, getGrpcRequest, getMaxAttempts, getMaxBackoff, getMaxRetry, getMinBackoff, getNodeAccountIds, getNodeForExecute, grpcDeadline, isBatchedAndNotBatchTransaction, logTransaction, mergeFromClient, setGrpcDeadline, setLogger, setMaxAttempts, setMaxBackoff, setMaxRetry, setMinBackoff, setNodeAccountIds, setNodesFromNodeAccountIds, setRequestListener, setResponseListener, shouldRetryExceptionally
-
Constructor Details
-
FileContentsQuery
public FileContentsQuery()Constructor.
-
-
Method Details
-
getFileId
Extract the file id.- Returns:
- the file id
-
setFileId
Sets the file ID of the file whose contents are requested.- Parameters:
fileId- The FileId to be set- Returns:
this
-
getCostAsync
Description copied from class:QueryFetch the expected cost asynchronously.- Overrides:
getCostAsyncin classQuery<com.google.protobuf.ByteString,FileContentsQuery> - Parameters:
client- the client- Returns:
- Future result of the cost in hbar
-
validateChecksums
Description copied from class:QueryValidate the checksums.- Specified by:
validateChecksumsin classQuery<com.google.protobuf.ByteString,FileContentsQuery> - Throws:
BadEntityIdException
-
onMakeRequest
Description copied from class:QueryCalled inQuery.makeRequest()just before the query is built. The intent is for the derived class to assign their data variant to the query.- Specified by:
onMakeRequestin classQuery<com.google.protobuf.ByteString,FileContentsQuery>
-
mapResponseHeader
Description copied from class:QueryThe derived class should access its response header and return.- Specified by:
mapResponseHeaderin classQuery<com.google.protobuf.ByteString,FileContentsQuery>
-
mapRequestHeader
Description copied from class:QueryThe derived class should access its request header and return.- Specified by:
mapRequestHeaderin classQuery<com.google.protobuf.ByteString,FileContentsQuery>
-
mapResponse
Description copied from class:ExecutableCalled after receiving the query response from Hedera. The derived class should map into its output type.- Specified by:
mapResponsein classExecutable<FileContentsQuery,Query, Response, com.google.protobuf.ByteString>
-
getMethodDescriptor
Description copied from class:ExecutableCalled to direct the invocation of the query to the appropriate gRPC service.- Specified by:
getMethodDescriptorin classExecutable<FileContentsQuery,Query, Response, com.google.protobuf.ByteString>
-