Class BlobInfo.Builder (2.46.0) 
  
      
     
  
  
  
   
  
    
  
  
    
    
    
  Version 2.46.0keyboard_arrow_down  
  
 
    
    
     
    
    
    
    
    
      
  
  
  
    
public   abstract   static   class  BlobInfo . Builder  
   
  
  
  
  Constructors
   
   
  Builder() 
  
  Methods
   
   
  build() 
  
    
public   abstract   BlobInfo   build ()  
   
  Creates a BlobInfo object.
 
  
   
  setAcl(List<Acl> acl) 
  
    
public   abstract   BlobInfo . Builder   setAcl ( List<Acl>   acl )  
   
  
  
    
      
        Parameter  
       
      
        Name  
        Description  
       
      
        acl 
        List <Acl > 
       
     
  
  
   
  setBlobId(BlobId blobId) 
  
    
public   abstract   BlobInfo . Builder   setBlobId ( BlobId   blobId )  
   
  
  
    
      
        Parameter  
       
      
        Name  
        Description  
       
      
        blobId 
        BlobId  
       
     
  
  
   
  setCacheControl(String cacheControl) 
  
    
public   abstract   BlobInfo . Builder   setCacheControl ( String   cacheControl )  
   
  
  
    
      
        Parameter  
       
      
        Name  
        Description  
       
      
        cacheControl 
        String  
       
     
  
  
   
  setContentDisposition(String contentDisposition) 
  
    
public   abstract   BlobInfo . Builder   setContentDisposition ( String   contentDisposition )  
   
  
  
    
      
        Parameter  
       
      
        Name  
        Description  
       
      
        contentDisposition 
        String  
       
     
  
  
   
  setContentEncoding(String contentEncoding) 
  
    
public   abstract   BlobInfo . Builder   setContentEncoding ( String   contentEncoding )  
   
  
  
    
      
        Parameter  
       
      
        Name  
        Description  
       
      
        contentEncoding 
        String  
       
     
  
  
   
  setContentLanguage(String contentLanguage) 
  
    
public   abstract   BlobInfo . Builder   setContentLanguage ( String   contentLanguage )  
   
  
  
    
      
        Parameter  
       
      
        Name  
        Description  
       
      
        contentLanguage 
        String  
       
     
  
  
   
  setContentType(String contentType) 
  
    
public   abstract   BlobInfo . Builder   setContentType ( String   contentType )  
   
  
  
    
      
        Parameter  
       
      
        Name  
        Description  
       
      
        contentType 
        String  
       
     
  
  
   
  setCrc32c(String crc32c) 
  
    
public   abstract   BlobInfo . Builder   setCrc32c ( String   crc32c )  
   
  
  
    
      
        Parameter  
       
      
        Name  
        Description  
       
      
        crc32c 
        String  
       
     
  
  
   
  setCrc32cFromHexString(String crc32cHexString) 
  
    
public   abstract   BlobInfo . Builder   setCrc32cFromHexString ( String   crc32cHexString )  
   
  
  
    
      
        Parameter  
       
      
        Name  
        Description  
       
      
        crc32cHexString 
        String  
       
     
  
  
   
  setCustomTime(Long customTime) (deprecated) 
  
    
public   BlobInfo . 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  
       
      
        customTime 
        Long  
       
     
  
  
   
  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 (); 
   
  
  
   
  setEventBasedHold(Boolean eventBasedHold) 
  
    
public   abstract   BlobInfo . Builder   setEventBasedHold ( Boolean   eventBasedHold )  
   
  
Beta 
This feature is covered by the Pre-GA Offerings Terms  of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.
 
Sets the blob's event-based hold.
 
  
    
      
        Parameter  
       
      
        Name  
        Description  
       
      
        eventBasedHold 
        Boolean  
       
     
  
  
   
  setMd5(String md5) 
  
    
public   abstract   BlobInfo . Builder   setMd5 ( String   md5 )  
   
  
  
    
      
        Parameter  
       
      
        Name  
        Description  
       
      
        md5 
        String  
       
     
  
  
   
  setMd5FromHexString(String md5HexString) 
  
    
public   abstract   BlobInfo . Builder   setMd5FromHexString ( String   md5HexString )  
   
  
  
    
      
        Parameter  
       
      
        Name  
        Description  
       
      
        md5HexString 
        String  
       
     
  
  
   
  
  
    
public   abstract   BlobInfo . Builder   setMetadata ( @Nullable   Map <@NonNull   String , @Nullable   String >  metadata )  
   
  Sets the blob's user provided metadata.
 
  
    
      
        Parameter  
       
      
        Name  
        Description  
       
      
        metadata 
        @org.checkerframework.checker.nullness.qual.Nullable java.util.Map <@org.checkerframework.checker.nullness.qual.NonNull java.lang.String ,@org.checkerframework.checker.nullness.qual.Nullable java.lang.String > 
       
     
  
  
   
  setRetention(BlobInfo.Retention retention) 
  
    
public   abstract   BlobInfo . Builder   setRetention ( BlobInfo . Retention   retention )  
   
  
  
   
  setStorageClass(StorageClass storageClass) 
  
    
public   abstract   BlobInfo . Builder   setStorageClass ( StorageClass   storageClass )  
   
  Sets the blob's storage class.
 
  
  
   
  setTemporaryHold(Boolean temporaryHold) 
  
    
public   abstract   BlobInfo . Builder   setTemporaryHold ( Boolean   temporaryHold )  
   
  
Beta 
This feature is covered by the Pre-GA Offerings Terms  of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.
 
Sets the blob's temporary hold.
 
  
    
      
        Parameter  
       
      
        Name  
        Description  
       
      
        temporaryHold 
        Boolean  
       
     
  
  
   
  setTimeStorageClassUpdated(Long timeStorageClassUpdated) (deprecated) 
  
    
public   BlobInfo . Builder   setTimeStorageClassUpdated ( Long   timeStorageClassUpdated )  
   
  
  
    
      
        Parameter  
       
      
        Name  
        Description  
       
      
        timeStorageClassUpdated 
        Long  
       
     
  
  
   
  setTimeStorageClassUpdatedOffsetDateTime(OffsetDateTime timeStorageClassUpdated) 
  
    
public   BlobInfo . Builder   setTimeStorageClassUpdatedOffsetDateTime ( OffsetDateTime   timeStorageClassUpdated )  
   
  
  
 
     
    
  
  
  
     
  
 
  
    
    
      
       
    
    
  
  
 
  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-30 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-30 UTC."],[],[]]