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 Classes
    Modifier and Type
    Class
    Description
    static 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

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     

    Fields inherited from class com.google.protobuf.GeneratedMessageLite

    unknownFields

    Fields inherited from class com.google.protobuf.AbstractMessageLite

    memoizedHashCode
  • Method Summary

    Modifier and Type
    Method
    Description
    protected final Object
    dynamicMethod(com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, Object arg0, Object arg1)
     
    com.google.protobuf.ByteString
    * A byte array of file content.
     
    * An expiration timestamp.
    * A list of keys that represent file "owners".
    * 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 created
    boolean
    * An expiration timestamp.
    boolean
    * A list of keys that represent file "owners".
    boolean
    Deprecated.
    boolean
    * A realm in which this file is created.
    boolean
    * A shard in which this file is created
     
     
     
    parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    parseFrom(byte[] data)
     
    parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    parseFrom(com.google.protobuf.ByteString data)
     
    parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    parseFrom(com.google.protobuf.CodedInputStream input)
     
    parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
     
    parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
     
    parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static com.google.protobuf.Parser<FileCreateTransactionBody>
     

    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, writeTo

    Methods inherited from class com.google.protobuf.AbstractMessageLite

    addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.google.protobuf.MessageLiteOrBuilder

    getDefaultInstanceForType, isInitialized
  • Field Details

  • 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:
      hasExpirationTime in interface FileCreateTransactionBodyOrBuilder
      Returns:
      Whether the expirationTime field is set.
    • getExpirationTime

      public Timestamp 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:
      getExpirationTime in interface FileCreateTransactionBodyOrBuilder
      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:
      hasKeys in interface FileCreateTransactionBodyOrBuilder
      Returns:
      Whether the keys field is set.
    • getKeys

      public KeyList 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:
      getKeys in interface FileCreateTransactionBodyOrBuilder
      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:
      getContents in interface FileCreateTransactionBodyOrBuilder
      Returns:
      The contents.
    • hasShardID

      public boolean hasShardID()
       *
       A shard in which this file is created
       
      .proto.ShardID shardID = 5;
      Specified by:
      hasShardID in interface FileCreateTransactionBodyOrBuilder
      Returns:
      Whether the shardID field is set.
    • getShardID

      public ShardID getShardID()
       *
       A shard in which this file is created
       
      .proto.ShardID shardID = 5;
      Specified by:
      getShardID in interface FileCreateTransactionBodyOrBuilder
      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:
      hasRealmID in interface FileCreateTransactionBodyOrBuilder
      Returns:
      Whether the realmID field is set.
    • getRealmID

      public RealmID 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:
      getRealmID in interface FileCreateTransactionBodyOrBuilder
      Returns:
      The realmID.
    • hasNewRealmAdminKey

      @Deprecated public boolean 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:
      hasNewRealmAdminKey in interface FileCreateTransactionBodyOrBuilder
      Returns:
      Whether the newRealmAdminKey field is set.
    • getNewRealmAdminKey

      @Deprecated public Key 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:
      getNewRealmAdminKey in interface FileCreateTransactionBodyOrBuilder
      Returns:
      The newRealmAdminKey.
    • getMemo

      public String 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:
      getMemo in interface FileCreateTransactionBodyOrBuilder
      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:
      getMemoBytes in interface FileCreateTransactionBodyOrBuilder
      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

      public static FileCreateTransactionBody parseFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static FileCreateTransactionBody parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static FileCreateTransactionBody parseDelimitedFrom(InputStream input) throws IOException
      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

      public static FileCreateTransactionBody.Builder newBuilder()
    • newBuilder

      public static FileCreateTransactionBody.Builder newBuilder(FileCreateTransactionBody prototype)
    • dynamicMethod

      protected final Object dynamicMethod(com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, Object arg0, Object arg1)
      Specified by:
      dynamicMethod in class com.google.protobuf.GeneratedMessageLite<FileCreateTransactionBody,FileCreateTransactionBody.Builder>
    • getDefaultInstance

      public static FileCreateTransactionBody getDefaultInstance()
    • parser

      public static com.google.protobuf.Parser<FileCreateTransactionBody> parser()