@@ -73,6 +73,7 @@ public StorageObject apply(BlobInfo blobInfo) {
7373 private final Long metageneration ;
7474 private final Long deleteTime ;
7575 private final Long updateTime ;
76+ private final Long createTime ;
7677 private final String contentType ;
7778 private final String contentEncoding ;
7879 private final String contentDisposition ;
@@ -188,6 +189,8 @@ public abstract static class Builder {
188189
189190 abstract Builder updateTime (Long updateTime );
190191
192+ abstract Builder createTime (Long createTime );
193+
191194 abstract Builder isDirectory (boolean isDirectory );
192195
193196 /**
@@ -218,6 +221,7 @@ static final class BuilderImpl extends Builder {
218221 private Long metageneration ;
219222 private Long deleteTime ;
220223 private Long updateTime ;
224+ private Long createTime ;
221225 private Boolean isDirectory ;
222226
223227 BuilderImpl (BlobId blobId ) {
@@ -245,6 +249,7 @@ static final class BuilderImpl extends Builder {
245249 metageneration = blobInfo .metageneration ;
246250 deleteTime = blobInfo .deleteTime ;
247251 updateTime = blobInfo .updateTime ;
252+ createTime = blobInfo .createTime ;
248253 isDirectory = blobInfo .isDirectory ;
249254 }
250255
@@ -369,6 +374,12 @@ Builder updateTime(Long updateTime) {
369374 return this ;
370375 }
371376
377+ @ Override
378+ Builder createTime (Long createTime ) {
379+ this .createTime = createTime ;
380+ return this ;
381+ }
382+
372383 @ Override
373384 Builder isDirectory (boolean isDirectory ) {
374385 this .isDirectory = isDirectory ;
@@ -403,6 +414,7 @@ public BlobInfo build() {
403414 metageneration = builder .metageneration ;
404415 deleteTime = builder .deleteTime ;
405416 updateTime = builder .updateTime ;
417+ createTime = builder .createTime ;
406418 isDirectory = firstNonNull (builder .isDirectory , Boolean .FALSE );
407419 }
408420
@@ -600,6 +612,13 @@ public Long updateTime() {
600612 return updateTime ;
601613 }
602614
615+ /**
616+ * Returns the creation time of the blob.
617+ */
618+ public Long createTime () {
619+ return createTime ;
620+ }
621+
603622 /**
604623 * Returns {@code true} if the current blob represents a directory. This can only happen if the
605624 * blob is returned by {@link Storage#list(String, Storage.BlobListOption...)} when the
@@ -660,6 +679,9 @@ public ObjectAccessControl apply(Acl acl) {
660679 if (updateTime != null ) {
661680 storageObject .setUpdated (new DateTime (updateTime ));
662681 }
682+ if (createTime != null ) {
683+ storageObject .setTimeCreated (new DateTime (createTime ));
684+ }
663685 if (size != null ) {
664686 storageObject .setSize (BigInteger .valueOf (size ));
665687 }
@@ -773,6 +795,9 @@ static BlobInfo fromPb(StorageObject storageObject) {
773795 if (storageObject .getUpdated () != null ) {
774796 builder .updateTime (storageObject .getUpdated ().getValue ());
775797 }
798+ if (storageObject .getTimeCreated () != null ) {
799+ builder .createTime (storageObject .getTimeCreated ().getValue ());
800+ }
776801 if (storageObject .getSize () != null ) {
777802 builder .size (storageObject .getSize ().longValue ());
778803 }
0 commit comments