Get file contents
Constructor
Description
new FileContentsQuery()Methods
Method
Type
Description
//Create the query
FileContentsQuery query = new FileContentsQuery()
.setFileId(newFileId);
//Sign with client operator private key and submit the query to a Hedera network
ByteString contents = query.execute(client);
//Change to Utf-8 encoding
String contentsToUtf8 = contents.toStringUtf8();
System.out.println(contentsToUtf8);
//v2.0.0//Create the query
const query = new FileContentsQuery()
.setFileId(newFileId);
//Sign with client operator private key and submit the query to a Hedera network
const contents = await query.execute(client);
console.log(contents.toString());
//v2.0.7Get query values
Method
Type
Description
Last updated