Module com.hedera.hashgraph.sdk
Package com.hedera.hashgraph.sdk.proto
Class FileCreateTransactionBody
java.lang.Object
com.google.protobuf.AbstractMessageLite<FileCreateTransactionBody,FileCreateTransactionBody.Builder>
com.google.protobuf.GeneratedMessageLite<FileCreateTransactionBody,FileCreateTransactionBody.Builder>
com.hedera.hashgraph.sdk.proto.FileCreateTransactionBody
- All Implemented Interfaces:
com.google.protobuf.MessageLite,com.google.protobuf.MessageLiteOrBuilder,FileCreateTransactionBodyOrBuilder
@Generated
public final class FileCreateTransactionBody
extends com.google.protobuf.GeneratedMessageLite<FileCreateTransactionBody,FileCreateTransactionBody.Builder>
implements FileCreateTransactionBodyOrBuilder
* Create a new file. If successful, the new file SHALL contain the (possibly empty) content provided in the `contents` field.<br/> When the current consensus time exceeds the `expirationTime` value, the network SHALL expire the file, and MAY archive the state entry. #### Signature Requirements The HFS manages file authorization in a manner that can be confusing. The core element of file authorization is the `keys` field, which is a `KeyList`; a list of individual `Key` messages, each of which may represent a simple or complex key.<br/> The file service transactions treat this list differently.<br/> A `fileCreate`, `fileAppend`, or `fileUpdate` MUST have a valid signature from _each_ key in the list.<br/> A `fileDelete` MUST have a valid signature from _at least one_ key in the list. This is different, and allows a file "owned" by many entities to be deleted by any one of those entities. A deleted file cannot be restored, so it is important to consider this when assigning keys for a file.<br/> If any of the keys in a `KeyList` are complex, the full requirements of each complex key must be met to count as a "valid signature" for that key. A complex key structure (i.e. a `ThresholdKey`, or `KeyList`, possibly including additional `ThresholdKey` or `KeyList` descendants) may be assigned as the sole entry in a file `keys` field to ensure all transactions have the same signature requirements. If the `keys` field is an empty `KeyList`, then the file SHALL be immutable and the only transaction permitted to modify that file SHALL be a `fileUpdate` transaction with _only_ the `expirationTime` set. #### Shard and Realm The current API ignores shardID and realmID. All files are created in shard 0 and realm 0. Future versions of the API may support multiple realms and multiple shards. ### Block Stream Effects After the file is created, the FileID for it SHALL be returned in the transaction receipt, and SHALL be recorded in the transaction record.Protobuf type
proto.FileCreateTransactionBody-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class* Create a new file.Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageLite
com.google.protobuf.GeneratedMessageLite.DefaultInstanceBasedParser<T extends com.google.protobuf.GeneratedMessageLite<T,?>>, com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageLite.ExtendableMessage<MessageType, BuilderType>, BuilderType extends com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<MessageType, BuilderType>>, com.google.protobuf.GeneratedMessageLite.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageLite.ExtendableMessage<MessageType, BuilderType>, BuilderType extends com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<MessageType, BuilderType>>, com.google.protobuf.GeneratedMessageLite.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageLite.ExtendableMessage<MessageType, BuilderType>, BuilderType extends com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<MessageType, BuilderType>>, com.google.protobuf.GeneratedMessageLite.GeneratedExtension<ContainingType extends com.google.protobuf.MessageLite, Type>, com.google.protobuf.GeneratedMessageLite.MethodToInvoke, com.google.protobuf.GeneratedMessageLite.SerializedForm Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessageLite.InternalOneOfEnum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class com.google.protobuf.GeneratedMessageLite
unknownFieldsFields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode -
Method Summary
Modifier and TypeMethodDescriptionprotected final ObjectdynamicMethod(com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, Object arg0, Object arg1) com.google.protobuf.ByteString* A byte array of file content.static FileCreateTransactionBody* An expiration timestamp.getKeys()* A list of keys that represent file "owners".getMemo()* A short description of this file.com.google.protobuf.ByteString* A short description of this file.Deprecated.* A realm in which this file is created.* A shard in which this file is createdboolean* An expiration timestamp.booleanhasKeys()* A list of keys that represent file "owners".booleanDeprecated.boolean* A realm in which this file is created.boolean* A shard in which this file is creatednewBuilder(FileCreateTransactionBody prototype) static FileCreateTransactionBodyparseDelimitedFrom(InputStream input) static FileCreateTransactionBodyparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static FileCreateTransactionBodyparseFrom(byte[] data) static FileCreateTransactionBodyparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static FileCreateTransactionBodyparseFrom(com.google.protobuf.ByteString data) static FileCreateTransactionBodyparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static FileCreateTransactionBodyparseFrom(com.google.protobuf.CodedInputStream input) static FileCreateTransactionBodyparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static FileCreateTransactionBodyparseFrom(InputStream input) static FileCreateTransactionBodyparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static FileCreateTransactionBodyparseFrom(ByteBuffer data) static FileCreateTransactionBodyparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser<FileCreateTransactionBody> parser()Methods inherited from class com.google.protobuf.GeneratedMessageLite
createBuilder, createBuilder, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, emptyProtobufList, equals, getDefaultInstanceForType, getParserForType, getSerializedSize, hashCode, isInitialized, makeImmutable, mergeLengthDelimitedField, mergeUnknownFields, mergeVarintField, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBuilderForType, newMessageInfo, newRepeatedGeneratedExtension, newSingularGeneratedExtension, parseDelimitedFrom, parseDelimitedFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parsePartialFrom, parseUnknownField, registerDefaultInstance, toBuilder, toString, writeToMethods inherited from class com.google.protobuf.AbstractMessageLite
addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLiteOrBuilder
getDefaultInstanceForType, isInitialized
-
Field Details
-
EXPIRATIONTIME_FIELD_NUMBER
public static final int EXPIRATIONTIME_FIELD_NUMBER- See Also:
-
KEYS_FIELD_NUMBER
public static final int KEYS_FIELD_NUMBER- See Also:
-
CONTENTS_FIELD_NUMBER
public static final int CONTENTS_FIELD_NUMBER- See Also:
-
SHARDID_FIELD_NUMBER
public static final int SHARDID_FIELD_NUMBER- See Also:
-
REALMID_FIELD_NUMBER
public static final int REALMID_FIELD_NUMBER- See Also:
-
NEWREALMADMINKEY_FIELD_NUMBER
public static final int NEWREALMADMINKEY_FIELD_NUMBER- See Also:
-
MEMO_FIELD_NUMBER
public static final int MEMO_FIELD_NUMBER- See Also:
-
-
Method Details
-
hasExpirationTime
public boolean hasExpirationTime()* An expiration timestamp. <p> When the network consensus time exceeds this value, the network SHALL expire the file.
.proto.Timestamp expirationTime = 2;- Specified by:
hasExpirationTimein interfaceFileCreateTransactionBodyOrBuilder- Returns:
- Whether the expirationTime field is set.
-
getExpirationTime
* An expiration timestamp. <p> When the network consensus time exceeds this value, the network SHALL expire the file.
.proto.Timestamp expirationTime = 2;- Specified by:
getExpirationTimein interfaceFileCreateTransactionBodyOrBuilder- Returns:
- The expirationTime.
-
hasKeys
public boolean hasKeys()* A list of keys that represent file "owners". <p> Every `Key` in this list MUST sign this `fileCreate` transaction, as well as any `fileUpdate` or `fileAppend` that modifies this file.<br/> At least one `Key` in this list MUST sign any `fileDelete` transaction to delete this file.<br/> If this `KeyList` is empty, the file SHALL be created immutable and the only field that may be changed subsequently is the `expirationTime`. An immutable file cannot be deleted except with a `systemDelete` transaction, or by expiration.
.proto.KeyList keys = 3;- Specified by:
hasKeysin interfaceFileCreateTransactionBodyOrBuilder- Returns:
- Whether the keys field is set.
-
getKeys
* A list of keys that represent file "owners". <p> Every `Key` in this list MUST sign this `fileCreate` transaction, as well as any `fileUpdate` or `fileAppend` that modifies this file.<br/> At least one `Key` in this list MUST sign any `fileDelete` transaction to delete this file.<br/> If this `KeyList` is empty, the file SHALL be created immutable and the only field that may be changed subsequently is the `expirationTime`. An immutable file cannot be deleted except with a `systemDelete` transaction, or by expiration.
.proto.KeyList keys = 3;- Specified by:
getKeysin interfaceFileCreateTransactionBodyOrBuilder- Returns:
- The keys.
-
getContents
public com.google.protobuf.ByteString getContents()* A byte array of file content. <p> The file SHALL be created with initial content equal to this field.
bytes contents = 4;- Specified by:
getContentsin interfaceFileCreateTransactionBodyOrBuilder- Returns:
- The contents.
-
hasShardID
public boolean hasShardID()* A shard in which this file is created
.proto.ShardID shardID = 5;- Specified by:
hasShardIDin interfaceFileCreateTransactionBodyOrBuilder- Returns:
- Whether the shardID field is set.
-
getShardID
* A shard in which this file is created
.proto.ShardID shardID = 5;- Specified by:
getShardIDin interfaceFileCreateTransactionBodyOrBuilder- Returns:
- The shardID.
-
hasRealmID
public boolean hasRealmID()* A realm in which this file is created. <p> The shard number for this realm MUST match the value in `shardID`.<br/> Currently, this MUST be `0` for both fields.<br/> If the desired realm is `0.0`, this SHOULD NOT be set.
.proto.RealmID realmID = 6;- Specified by:
hasRealmIDin interfaceFileCreateTransactionBodyOrBuilder- Returns:
- Whether the realmID field is set.
-
getRealmID
* A realm in which this file is created. <p> The shard number for this realm MUST match the value in `shardID`.<br/> Currently, this MUST be `0` for both fields.<br/> If the desired realm is `0.0`, this SHOULD NOT be set.
.proto.RealmID realmID = 6;- Specified by:
getRealmIDin interfaceFileCreateTransactionBodyOrBuilder- Returns:
- The realmID.
-
hasNewRealmAdminKey
Deprecated.* The "create realm" was never enabled, and should not be possible on file creation.<br/> An admin key for a new realm, if one is created. Added deprecated tag 2024-05.
.proto.Key newRealmAdminKey = 7 [deprecated = true];- Specified by:
hasNewRealmAdminKeyin interfaceFileCreateTransactionBodyOrBuilder- Returns:
- Whether the newRealmAdminKey field is set.
-
getNewRealmAdminKey
Deprecated.* The "create realm" was never enabled, and should not be possible on file creation.<br/> An admin key for a new realm, if one is created. Added deprecated tag 2024-05.
.proto.Key newRealmAdminKey = 7 [deprecated = true];- Specified by:
getNewRealmAdminKeyin interfaceFileCreateTransactionBodyOrBuilder- Returns:
- The newRealmAdminKey.
-
getMemo
* A short description of this file. <p> This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` (default 100) bytes when encoded as UTF-8.
string memo = 8;- Specified by:
getMemoin interfaceFileCreateTransactionBodyOrBuilder- Returns:
- The memo.
-
getMemoBytes
public com.google.protobuf.ByteString getMemoBytes()* A short description of this file. <p> This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` (default 100) bytes when encoded as UTF-8.
string memo = 8;- Specified by:
getMemoBytesin interfaceFileCreateTransactionBodyOrBuilder- Returns:
- The bytes for memo.
-
parseFrom
public static FileCreateTransactionBody parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static FileCreateTransactionBody parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static FileCreateTransactionBody parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static FileCreateTransactionBody parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static FileCreateTransactionBody parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static FileCreateTransactionBody parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static FileCreateTransactionBody parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
- Throws:
IOException
-
parseDelimitedFrom
public static FileCreateTransactionBody parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseFrom
public static FileCreateTransactionBody parseFrom(com.google.protobuf.CodedInputStream input) throws IOException - Throws:
IOException
-
parseFrom
public static FileCreateTransactionBody parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
newBuilder
-
newBuilder
-
dynamicMethod
protected final Object dynamicMethod(com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, Object arg0, Object arg1) - Specified by:
dynamicMethodin classcom.google.protobuf.GeneratedMessageLite<FileCreateTransactionBody,FileCreateTransactionBody.Builder>
-
getDefaultInstance
-
parser
-