private MediaType acceptabePlainTextMediaType ( ) { final List < MediaType > acceptable = headers . getAcceptableMediaTypes ( ) ; if ( acceptable == null || acceptable . size ( ) == 0 ) { return TEXT_PLAIN_TYPE ; } for ( final MediaType type : acceptable ) { if ( type . isWildcardType ( ) || ( type . isCompatible ( TEXT_PLAIN_TYPE ) && type . isWildcardSubtype ( ) ) ) { return TEXT_PLAIN_TYPE ; } else if ( type . isCompatible ( TEXT_PLAIN_TYPE ) ) { return type ; } } return null ; }
Returns an acceptable plain text media type if possible or null if not .