Class Blob.Builder (2.58.1) 
  
  
  
   
  
    
  
  
    
    
    
    
  Version 2.58.1keyboard_arrow_down  
  
 
    
    
    
    
      
  
  
  
    
public   static   class  Blob . Builder   extends   BlobInfo . Builder  
  
  
  
  Methods
   
  build() 
  
  Creates a BlobInfo object.
    
      
        Returns  
      
        Type Description  
      
        Blob  
     
  
  Overrides 
  
  setAcl(List<Acl> acl) 
  
    
public   Blob . Builder   setAcl ( List<Acl>   acl )  
  Sets the blob's access control configuration.
    
      
        Parameter  
      
        Name Description  
      
        aclList <Acl > 
     
  
  
  Overrides 
  
  setBlobId(BlobId blobId) 
  
    
public   Blob . Builder   setBlobId ( BlobId   blobId )  
  
  
    
      
        Parameter  
      
        Name Description  
      
        blobIdBlobId  
     
  
  
  Overrides 
  
  setCacheControl(String cacheControl) 
  
    
public   Blob . Builder   setCacheControl ( String   cacheControl )  
  Sets the blob's data cache control.
    
      
        Parameter  
      
        Name Description  
      
        cacheControlString  
     
  
  
  Overrides 
  
  setContentDisposition(String contentDisposition) 
  
    
public   Blob . Builder   setContentDisposition ( String   contentDisposition )  
  Sets the blob's data content disposition.
    
      
        Parameter  
      
        Name Description  
      
        contentDispositionString  
     
  
  
  Overrides 
  
  setContentEncoding(String contentEncoding) 
  
    
public   Blob . Builder   setContentEncoding ( String   contentEncoding )  
  Sets the blob's data content encoding.
    
      
        Parameter  
      
        Name Description  
      
        contentEncodingString  
     
  
  
  Overrides 
  
  setContentLanguage(String contentLanguage) 
  
    
public   Blob . Builder   setContentLanguage ( String   contentLanguage )  
  Sets the blob's data content language.
    
      
        Parameter  
      
        Name Description  
      
        contentLanguageString  
     
  
  
  Overrides 
  
  setContentType(String contentType) 
  
    
public   Blob . Builder   setContentType ( String   contentType )  
  Sets the blob's data content type.
    
      
        Parameter  
      
        Name Description  
      
        contentTypeString  
     
  
  
  Overrides 
  
  setContexts(BlobInfo.ObjectContexts contexts) 
  
    
public   Blob . Builder   setContexts ( BlobInfo . ObjectContexts   contexts )  
  
  
  Overrides 
  
  setCrc32c(String crc32c) 
  
    
public   Blob . Builder   setCrc32c ( String   crc32c )  
  Sets the CRC32C checksum of blob's data as described in RFC 4960, Appendix B;  encoded in
 base64 in big-endian order.
    
      
        Parameter  
      
        Name Description  
      
        crc32cString  
     
  
  
  Overrides 
  
  setCrc32cFromHexString(String crc32cHexString) 
  
    
public   Blob . Builder   setCrc32cFromHexString ( String   crc32cHexString )  
  
  
    
      
        Parameter  
      
        Name Description  
      
        crc32cHexStringString  
     
  
  
  Overrides 
  
  setCustomTime(Long customTime) (deprecated) 
  
    
public   Blob . Builder   setCustomTime ( Long   customTime )  
  Deprecated.  Use #setCustomTimeOffsetDateTime(OffsetDateTime)  
Sets the custom time for an object. Once set it can't be unset and only changed to a custom
 datetime in the future. To unset the custom time, you must either perform a rewrite operation
 or upload the data again.
 
Example of setting the custom time.
 
  String   bucketName   =   "my-unique-bucket" ; 
  String   blobName   =   "my-blob-name" ; 
  long   customTime   =   1598423868301L ; 
  BlobInfo   blob   =   BlobInfo . newBuilder ( bucketName ,   blobName ). setCustomTime ( customTime ). build (); 
  
    
      
        Parameter  
      
        Name Description  
      
        customTimeLong  
     
  
  
  Overrides 
  
  setCustomTimeOffsetDateTime(OffsetDateTime customTime) 
  
    
public   BlobInfo . Builder   setCustomTimeOffsetDateTime ( OffsetDateTime   customTime )  
  Sets the custom time for an object. Once set it can't be unset and only changed to a custom
 datetime in the future. To unset the custom time, you must either perform a rewrite operation
 or upload the data again.
 
Example of setting the custom time.
 
  String   bucketName   =   "my-unique-bucket" ; 
  String   blobName   =   "my-blob-name" ; 
  OffsetDateTime   customTime   =   Instant . ofEpochMilli ( 1598423868301L ). atOffset ( 0 );   // UTC 
  BlobInfo   blob   =   BlobInfo . newBuilder ( bucketName ,   blobName ). setCustomTime ( customTime ). build (); 
  Overrides 
  
  setEventBasedHold(Boolean eventBasedHold) 
  
    
public   Blob . Builder   setEventBasedHold ( Boolean   eventBasedHold )  
  Sets the blob's event-based hold.
    
      
        Parameter  
      
        Name Description  
      
        eventBasedHoldBoolean  
     
  
  
  Overrides 
  
  setMd5(String md5) 
  
    
public   Blob . Builder   setMd5 ( String   md5 )  
  Sets the MD5 hash of blob's data. MD5 value must be encoded in base64.
    
      
        Parameter  
      
        Name Description  
      
        md5String  
     
  
  
  Overrides 
  
  setMd5FromHexString(String md5HexString) 
  
    
public   Blob . Builder   setMd5FromHexString ( String   md5HexString )  
  Sets the MD5 hash of blob's data from hex string.
    
      
        Parameter  
      
        Name Description  
      
        md5HexStringString  
     
  
  
  Overrides 
  
  
    
public   Blob . Builder   setMetadata ( Map<String , String >  metadata )  
  Sets the blob's user provided metadata.
Overrides 
  
  setRetention(BlobInfo.Retention retention) 
  
    
public   Blob . Builder   setRetention ( BlobInfo . Retention   retention )  
  
  
  Overrides 
  
  setStorageClass(StorageClass storageClass) 
  
    
public   Blob . Builder   setStorageClass ( StorageClass   storageClass )  
  Sets the blob's storage class.
Overrides 
  
  setTemporaryHold(Boolean temporaryHold) 
  
    
public   Blob . Builder   setTemporaryHold ( Boolean   temporaryHold )  
  Sets the blob's temporary hold.
    
      
        Parameter  
      
        Name Description  
      
        temporaryHoldBoolean  
     
  
  
  Overrides 
  
  setTimeStorageClassUpdated(Long timeStorageClassUpdated) (deprecated) 
  
    
public   Blob . Builder   setTimeStorageClassUpdated ( Long   timeStorageClassUpdated )  
  
  
    
      
        Parameter  
      
        Name Description  
      
        timeStorageClassUpdatedLong  
     
  
  
  Overrides 
  
  setTimeStorageClassUpdatedOffsetDateTime(OffsetDateTime timeStorageClassUpdated) 
  
    
public   BlobInfo . Builder   setTimeStorageClassUpdatedOffsetDateTime ( OffsetDateTime   timeStorageClassUpdated )  
  
  
  Overrides 
  
 
     
    
  
  
  
     
  
    
    
      
       
    
    
  
  
 
  Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
  Last updated 2025-10-29 UTC.
 
 
  
  
  
    
      [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-29 UTC."],[],[]]