A set of extra headers to be set for all requests performed within the scope of the operation
this option is passed to (a get, read, resumable upload etc).
If the same header name is specified across multiple options provided to a method, the
first occurrence will be the value included in the request(s).
The following headers are not allowed to be specified, and will result in an IllegalArgumentException.
Returns an option for blob's metageneration match. If this option is used the request will
fail if blob's metageneration does not match the provided value.
Returns an option for blob's metageneration mismatch. If this option is used the request will
fail if blob's metageneration matches the provided value.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-16 UTC."],[],[],null,["# Class Storage.BlobRestoreOption (2.55.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.55.0 (latest)](/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.54.0](/java/docs/reference/google-cloud-storage/2.54.0/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.53.3](/java/docs/reference/google-cloud-storage/2.53.3/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.52.3](/java/docs/reference/google-cloud-storage/2.52.3/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.50.0](/java/docs/reference/google-cloud-storage/2.50.0/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.49.0](/java/docs/reference/google-cloud-storage/2.49.0/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.48.2](/java/docs/reference/google-cloud-storage/2.48.2/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.47.0](/java/docs/reference/google-cloud-storage/2.47.0/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.46.0](/java/docs/reference/google-cloud-storage/2.46.0/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.45.0](/java/docs/reference/google-cloud-storage/2.45.0/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.44.1](/java/docs/reference/google-cloud-storage/2.44.1/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.43.2](/java/docs/reference/google-cloud-storage/2.43.2/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.42.0](/java/docs/reference/google-cloud-storage/2.42.0/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.41.0](/java/docs/reference/google-cloud-storage/2.41.0/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.40.1](/java/docs/reference/google-cloud-storage/2.40.1/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.39.0](/java/docs/reference/google-cloud-storage/2.39.0/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.38.0](/java/docs/reference/google-cloud-storage/2.38.0/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.37.0](/java/docs/reference/google-cloud-storage/2.37.0/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.36.1](/java/docs/reference/google-cloud-storage/2.36.1/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.34.0](/java/docs/reference/google-cloud-storage/2.34.0/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.33.0](/java/docs/reference/google-cloud-storage/2.33.0/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.32.1](/java/docs/reference/google-cloud-storage/2.32.1/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.30.1](/java/docs/reference/google-cloud-storage/2.30.1/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.29.1](/java/docs/reference/google-cloud-storage/2.29.1/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.28.0](/java/docs/reference/google-cloud-storage/2.28.0/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.27.1](/java/docs/reference/google-cloud-storage/2.27.1/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.24.0](/java/docs/reference/google-cloud-storage/2.24.0/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.23.0](/java/docs/reference/google-cloud-storage/2.23.0/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.22.6](/java/docs/reference/google-cloud-storage/2.22.6/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.21.0](/java/docs/reference/google-cloud-storage/2.21.0/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.20.2](/java/docs/reference/google-cloud-storage/2.20.2/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.19.0](/java/docs/reference/google-cloud-storage/2.19.0/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.18.0](/java/docs/reference/google-cloud-storage/2.18.0/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.17.2](/java/docs/reference/google-cloud-storage/2.17.2/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.16.0](/java/docs/reference/google-cloud-storage/2.16.0/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.15.1](/java/docs/reference/google-cloud-storage/2.15.1/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.14.0](/java/docs/reference/google-cloud-storage/2.14.0/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.13.1](/java/docs/reference/google-cloud-storage/2.13.1/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.12.0](/java/docs/reference/google-cloud-storage/2.12.0/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.11.3](/java/docs/reference/google-cloud-storage/2.11.3/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.10.0](/java/docs/reference/google-cloud-storage/2.10.0/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.9.3](/java/docs/reference/google-cloud-storage/2.9.3/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.8.1](/java/docs/reference/google-cloud-storage/2.8.1/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.7.1](/java/docs/reference/google-cloud-storage/2.7.1/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.6.1](/java/docs/reference/google-cloud-storage/2.6.1/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.5.1](/java/docs/reference/google-cloud-storage/2.5.1/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.4.5](/java/docs/reference/google-cloud-storage/2.4.5/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.3.0](/java/docs/reference/google-cloud-storage/2.3.0/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.2.3](/java/docs/reference/google-cloud-storage/2.2.3/com.google.cloud.storage.Storage.BlobRestoreOption)\n- [2.1.10](/java/docs/reference/google-cloud-storage/2.1.10/com.google.cloud.storage.Storage.BlobRestoreOption) \n\n public static class Storage.BlobRestoreOption extends Option\u003cUnifiedOpts.ObjectSourceOpt\u003e\n\nClass for specifying blob restore options \\* \n\nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e com.google.cloud.storage.UnifiedOpts.OptionShim \\\u003e [Option](/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Option) \\\u003e Storage.BlobRestoreOption \n\nInherited Members\n-----------------\n\ncom.google.cloud.storage.UnifiedOpts.OptionShim.equals(java.lang.Object) \ncom.google.cloud.storage.UnifiedOpts.OptionShim.hashCode() \ncom.google.cloud.storage.UnifiedOpts.OptionShim.toString() \n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nStatic Methods\n--------------\n\n### copySourceAcl(boolean copySourceAcl)\n\n public static Storage.BlobRestoreOption copySourceAcl(boolean copySourceAcl)\n\nReturns an option for whether the restored object should copy the access controls of the\nsource object.\n\n### extraHeaders(@NonNull ImmutableMap\\\u003cString,String\\\u003e extraHeaders)\n\n public static Storage.BlobRestoreOption extraHeaders(@NonNull ImmutableMap\u003cString,String\u003e extraHeaders)\n\nA set of extra headers to be set for all requests performed within the scope of the operation\nthis option is passed to (a get, read, resumable upload etc).\n\nIf the same header name is specified across multiple options provided to a method, the\nfirst occurrence will be the value included in the request(s).\n\nThe following headers are not allowed to be specified, and will result in an IllegalArgumentException.\n\n1. `Accept-Encoding`\n2. `Cache-Control`\n3. `Connection`\n4. `Content-ID`\n5. `Content-Length`\n6. `Content-Range`\n7. `Content-Transfer-Encoding`\n8. `Content-Type`\n9. `Date`\n10. `ETag`\n11. `If-Match`\n12. `If-None-Match`\n13. `Keep-Alive`\n14. `Range`\n15. `TE`\n16. `Trailer`\n17. `Transfer-Encoding`\n18. `User-Agent`\n19. `X-Goog-Api-Client`\n20. `X-Goog-Content-Length-Range`\n21. `X-Goog-Copy-Source-Encryption-Algorithm`\n22. `X-Goog-Copy-Source-Encryption-Key`\n23. `X-Goog-Copy-Source-Encryption-Key-Sha256`\n24. `X-Goog-Encryption-Algorithm`\n25. `X-Goog-Encryption-Key`\n26. `X-Goog-Encryption-Key-Sha256`\n27. `X-Goog-Gcs-Idempotency-Token`\n28. `X-Goog-Meta-*`\n29. `X-Goog-User-Project`\n30. `X-HTTP-Method-Override`\n31. `X-Upload-Content-Length`\n32. `X-Upload-Content-Type`\n\n### generationMatch(long generation)\n\n public static Storage.BlobRestoreOption generationMatch(long generation)\n\nReturns an option for blob's data generation match. If this option is used the request will\nfail if generation does not match.\n\n### generationNotMatch(long generation)\n\n public static Storage.BlobRestoreOption generationNotMatch(long generation)\n\nReturns an option for blob's data generation mismatch. If this option is used the request\nwill fail if blob's generation matches the provided value.\n\n### metagenerationMatch(long generation)\n\n public static Storage.BlobRestoreOption metagenerationMatch(long generation)\n\nReturns an option for blob's metageneration match. If this option is used the request will\nfail if blob's metageneration does not match the provided value.\n\n### metagenerationNotMatch(long generation)\n\n public static Storage.BlobRestoreOption metagenerationNotMatch(long generation)\n\nReturns an option for blob's metageneration mismatch. If this option is used the request will\nfail if blob's metageneration matches the provided value."]]