当前位置: 首页>>代码示例>>Java>>正文


Java MimeTypeUtils.TEXT_PLAIN_VALUE属性代码示例

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

}
 
开发者ID:chanjarster,项目名称:spring-mvc-error-handling-example,代码行数:10,代码来源:CustomErrorController.java

示例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());
    }
}
 
开发者ID:redlink-gmbh,项目名称:smarti,代码行数:35,代码来源:RocketChatEndpoint.java

示例3: returnPlainText

@RequestMapping(value = "/return-text-plain", produces = MimeTypeUtils.TEXT_PLAIN_VALUE)
@ResponseBody
public String returnPlainText() throws SomeException {
  throw new SomeException();
}
 
开发者ID:chanjarster,项目名称:spring-mvc-error-handling-example,代码行数:5,代码来源:FooController.java

示例4: getTextPlainA

@RequestMapping(value = "/text-plain-a", produces = MimeTypeUtils.TEXT_PLAIN_VALUE)
@ResponseBody
public String getTextPlainA() throws SomeException {
  throw new SomeException();
}
 
开发者ID:chanjarster,项目名称:spring-mvc-error-handling-example,代码行数:5,代码来源:BarController.java

示例5: getTextPlainB

@RequestMapping(value = "/text-plain-b", produces = MimeTypeUtils.TEXT_PLAIN_VALUE)
@ResponseBody
public String getTextPlainB() throws AnotherException {
  throw new AnotherException();
}
 
开发者ID:chanjarster,项目名称:spring-mvc-error-handling-example,代码行数:5,代码来源:BarController.java

示例6: BridgeMessageTextContent

public BridgeMessageTextContent(String content) {
    super(MimeTypeUtils.TEXT_PLAIN_VALUE, content.getBytes());
}
 
开发者ID:kamax-io,项目名称:matrix-appservice-email,代码行数:3,代码来源:BridgeMessageTextContent.java


注:本文中的org.springframework.util.MimeTypeUtils.TEXT_PLAIN_VALUE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。