本文整理匯總了Java中org.springframework.http.MediaType.TEXT_PLAIN屬性的典型用法代碼示例。如果您正苦於以下問題:Java MediaType.TEXT_PLAIN屬性的具體用法?Java MediaType.TEXT_PLAIN怎麽用?Java MediaType.TEXT_PLAIN使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.springframework.http.MediaType
的用法示例。
在下文中一共展示了MediaType.TEXT_PLAIN屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createAuthHeaders
public static HttpHeaders createAuthHeaders() {
HttpHeaders headers = new HttpHeaders();
MediaType mediaType = new MediaType(MediaType.TEXT_PLAIN, UTF_8);
headers.setContentType(mediaType);
headers.set(HttpHeaders.AUTHORIZATION, "Bearer " + TokenUtils.extractCurrentToken());
return headers;
}
示例2: getStatusUpdate
@RequestMapping(method = GET, value = "{" + ImportIdPathVar + "}")
public ResponseEntity<String> getStatusUpdate(
@PathVariable(value=ImportIdPathVar) String importId,
HttpServletResponse response) throws IOException {
ImportId taskId = new ImportId(importId);
Path importLog = service.importLogPathFor(taskId).get();
FileStreamer streamer = new FileStreamer(importLog,
MediaType.TEXT_PLAIN,
Caches::doNotCache);
return streamer.streamOr404(response);
}
示例3: filesContentType
/**
* @return the content type of the files in the store; defaults to plain
* text.
*/
protected MediaType filesContentType() {
return MediaType.TEXT_PLAIN;
}