本文整理汇总了Java中org.springframework.util.MimeTypeUtils.TEXT_PLAIN_VALUE属性的典型用法代码示例。如果您正苦于以下问题:Java MimeTypeUtils.TEXT_PLAIN_VALUE属性的具体用法?Java MimeTypeUtils.TEXT_PLAIN_VALUE怎么用?Java MimeTypeUtils.TEXT_PLAIN_VALUE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.springframework.util.MimeTypeUtils
的用法示例。
在下文中一共展示了MimeTypeUtils.TEXT_PLAIN_VALUE属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: errorTextPlan
@RequestMapping(produces = MimeTypeUtils.TEXT_PLAIN_VALUE)
@ResponseBody
public String errorTextPlan(HttpServletRequest request) {
Map<String, Object> body = getErrorAttributes(request,
isIncludeStackTrace(request, MediaType.ALL));
body.put("status", getStatus(request));
return body.toString();
}
示例2: getConversation
/**
* Called by rocket.chat plugins to get the conversationId for the clientId and channelId known to the plugin.
* The returned conversationID can later be used for calls to the {@link ConversationWebservice}
* @param clientName the client id
* @param channelId the channelId
* @return a <code>200</code> with the conversation id as payload or a <code>404</code> if no conversation is
* active for the parsed parameters.
*/
@ApiOperation(value = "retrieve a conversation ID for a channel and client id", nickname = "rocketGetConversation",
produces=MimeTypeUtils.TEXT_PLAIN_VALUE
)
@RequestMapping(value = "{clientId}/{channelId}/conversationid", method = RequestMethod.GET,
produces=MimeTypeUtils.TEXT_PLAIN_VALUE, consumes=MimeTypeUtils.ALL_VALUE)
public ResponseEntity<?> getConversation(
AuthContext authContext,
@PathVariable(value="clientId") String clientName,
@PathVariable(value="channelId") String channelId) {
if (log.isTraceEnabled()) {
log.debug("{}[{}]: lookup conversation-id of {}", clientName, authContext, channelId);
} else {
log.debug("{}: lookup conversation-id of {}", clientName, channelId);
}
Client client = clientService.getByName(clientName);
if(client == null || !authenticationService.hasAccessToClient(authContext, client.getId())){
return ResponseEntity.notFound().build();
}
Conversation conversation = conversationService.getCurrentConversationByChannelId(
client, createChannelId(client, channelId),() -> null); //do not create new conversations
if (conversation == null || conversation.getId() == null) {
return ResponseEntity.notFound().build();
} else {
return ResponseEntity.ok(conversation.getId().toHexString());
}
}
示例3: returnPlainText
@RequestMapping(value = "/return-text-plain", produces = MimeTypeUtils.TEXT_PLAIN_VALUE)
@ResponseBody
public String returnPlainText() throws SomeException {
throw new SomeException();
}
示例4: getTextPlainA
@RequestMapping(value = "/text-plain-a", produces = MimeTypeUtils.TEXT_PLAIN_VALUE)
@ResponseBody
public String getTextPlainA() throws SomeException {
throw new SomeException();
}
示例5: getTextPlainB
@RequestMapping(value = "/text-plain-b", produces = MimeTypeUtils.TEXT_PLAIN_VALUE)
@ResponseBody
public String getTextPlainB() throws AnotherException {
throw new AnotherException();
}
示例6: BridgeMessageTextContent
public BridgeMessageTextContent(String content) {
super(MimeTypeUtils.TEXT_PLAIN_VALUE, content.getBytes());
}