本文整理匯總了Java中org.springframework.http.MediaType.APPLICATION_OCTET_STREAM屬性的典型用法代碼示例。如果您正苦於以下問題:Java MediaType.APPLICATION_OCTET_STREAM屬性的具體用法?Java MediaType.APPLICATION_OCTET_STREAM怎麽用?Java MediaType.APPLICATION_OCTET_STREAM使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.springframework.http.MediaType
的用法示例。
在下文中一共展示了MediaType.APPLICATION_OCTET_STREAM屬性的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setOutputContentType
private void setOutputContentType(MediaType contentType, HttpOutputMessage outputMessage) {
HttpHeaders headers = outputMessage.getHeaders();
if (contentType == null || contentType.isWildcardType() || contentType.isWildcardSubtype()) {
contentType = MediaType.APPLICATION_OCTET_STREAM;
}
if (contentType != null) {
headers.setContentType(contentType);
}
}
示例2: getContentType
private MediaType getContentType(ClientHttpResponse response) {
MediaType contentType = response.getHeaders().getContentType();
if (contentType == null) {
if (logger.isTraceEnabled()) {
logger.trace("No Content-Type header found, defaulting to application/octet-stream");
}
contentType = MediaType.APPLICATION_OCTET_STREAM;
}
return contentType;
}
示例3: getDefaultContentType
@Override
protected MediaType getDefaultContentType(Resource resource) {
if (jafPresent) {
return ActivationMediaTypeFactory.getMediaType(resource);
}
else {
return MediaType.APPLICATION_OCTET_STREAM;
}
}
示例4: canRead
private boolean canRead() {
MediaType contentType = getHeaders().getContentType();
if (contentType != null && contentType != MediaType.APPLICATION_OCTET_STREAM) {
return true;
}
return false;
}
示例5: getContentType
private MediaType getContentType(ResponseEntity<HttpInputMessage> responseEntity) {
MediaType contentType = responseEntity.getHeaders().getContentType();
if (contentType == null) {
if (logger.isTraceEnabled()) {
logger.trace("No Content-Type header found, defaulting to application/octet-stream");
}
contentType = MediaType.APPLICATION_OCTET_STREAM;
}
return contentType;
}
示例6: SerializableObjectHttpMessageConverter
public SerializableObjectHttpMessageConverter() {
super(MediaType.APPLICATION_OCTET_STREAM, MediaType.ALL);
}
示例7: streamMessageConverter
@Bean
public StreamMessageConverter streamMessageConverter() {
return new StreamMessageConverter(MediaType.APPLICATION_OCTET_STREAM);
}
示例8: WxHttpInputMessageConverter
public WxHttpInputMessageConverter() {
super(MediaType.APPLICATION_OCTET_STREAM, MediaType.ALL);
}