本文整理汇总了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);
}