Skip to content

Commit 7c0bf08

Browse files
kstichGoogle Java Core Libraries
authored and
Google Java Core Libraries
committed
Add application/cbor to MediaType.
Fixes #7404 RELNOTES=`net`: Added `application/cbor` to `MediaType` PiperOrigin-RevId: 679244841
1 parent 3c7c173 commit 7c0bf08

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

android/guava/src/com/google/common/net/MediaType.java

+10
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ private static MediaType addKnownType(MediaType mediaType) {
171171
* may be necessary in certain situations for compatibility.
172172
*/
173173
public static final MediaType TEXT_JAVASCRIPT_UTF_8 = createConstantUtf8(TEXT_TYPE, "javascript");
174+
174175
/**
175176
* <a href="http://www.iana.org/assignments/media-types/text/tab-separated-values">Tab separated
176177
* values</a>.
@@ -458,6 +459,15 @@ private static MediaType addKnownType(MediaType mediaType) {
458459
*/
459460
public static final MediaType APPLICATION_BINARY = createConstant(APPLICATION_TYPE, "binary");
460461

462+
/**
463+
* As described in <a href="https://www.rfc-editor.org/rfc/rfc8949.html">RFC 8949</a>, this
464+
* constant ({@code application/cbor}) is used for the Concise Binary Object Representation (CBOR)
465+
* data format.
466+
*
467+
* @since NEXT
468+
*/
469+
public static final MediaType CBOR = createConstant(APPLICATION_TYPE, "cbor");
470+
461471
/**
462472
* Media type for the <a href="https://tools.ietf.org/html/rfc7946">GeoJSON Format</a>, a
463473
* geospatial data interchange format based on JSON.

guava/src/com/google/common/net/MediaType.java

+10
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ private static MediaType addKnownType(MediaType mediaType) {
171171
* may be necessary in certain situations for compatibility.
172172
*/
173173
public static final MediaType TEXT_JAVASCRIPT_UTF_8 = createConstantUtf8(TEXT_TYPE, "javascript");
174+
174175
/**
175176
* <a href="http://www.iana.org/assignments/media-types/text/tab-separated-values">Tab separated
176177
* values</a>.
@@ -458,6 +459,15 @@ private static MediaType addKnownType(MediaType mediaType) {
458459
*/
459460
public static final MediaType APPLICATION_BINARY = createConstant(APPLICATION_TYPE, "binary");
460461

462+
/**
463+
* As described in <a href="https://www.rfc-editor.org/rfc/rfc8949.html">RFC 8949</a>, this
464+
* constant ({@code application/cbor}) is used for the Concise Binary Object Representation (CBOR)
465+
* data format.
466+
*
467+
* @since NEXT
468+
*/
469+
public static final MediaType CBOR = createConstant(APPLICATION_TYPE, "cbor");
470+
461471
/**
462472
* Media type for the <a href="https://tools.ietf.org/html/rfc7946">GeoJSON Format</a>, a
463473
* geospatial data interchange format based on JSON.

0 commit comments

Comments
 (0)