Package javax.mail.internet

Examples of javax.mail.internet.ContentType.match()


        // and does not really check the actual content type.

        try
        {
            final ContentType ct = new ContentType(part.getDataHandler().getContentType());
            return ct.match(mimeType);
        }
        catch (final ParseException ex)
        {
            return part.getContentType().equalsIgnoreCase(mimeType);
        }
View Full Code Here


      LOG.warn("Unable to get content type from input message. {}", e.getMessage(), e);
    } catch (MessagingException e) {
      LOG.warn("Unable to get content type from input message. {}", e.getMessage(), e);
    }
    Message message = null;
    if (ct != null && ct.match("text/*")) {
      message = aConnection.createTextMessage();
      // TODO: MessageUtils.copy(aInput.getInputStream(), tmsg);
    } else {
      BytesMessage bmsg = aConnection.createBytesMessage();
      message = bmsg;
View Full Code Here

    ContentType ct = httpRequest.getContentType();
   
    if (ct == null)
      throw new SerializeException("Missing HTTP Content-Type header");
   
    if (! ct.match(CommonContentTypes.APPLICATION_URLENCODED))
      throw new SerializeException("The HTTP Content-Type header must be " + CommonContentTypes.APPLICATION_URLENCODED);
   
    Map <String,String> params = httpRequest.getQueryParameters();
   
    params.putAll(toParameters());
View Full Code Here

    ContentType ct = httpRequest.getContentType();
   
    if (ct == null)
      throw new SerializeException("Missing HTTP Content-Type header");
   
    if (! ct.match(CommonContentTypes.APPLICATION_URLENCODED))
      throw new SerializeException("The HTTP Content-Type header must be " + CommonContentTypes.APPLICATION_URLENCODED);
   
    Map <String,String> params = httpRequest.getQueryParameters();
   
    params.putAll(toParameters());
View Full Code Here

    ContentType ct = httpResponse.getContentType();
   
   
    UserInfoSuccessResponse response;
   
    if (ct.match(CommonContentTypes.APPLICATION_JSON)) {
   
      UserInfo claimsSet;
     
      try {
        claimsSet = new UserInfo(httpResponse.getContentAsJSONObject());
View Full Code Here

                           e.getMessage(), e);
      }
     
      response = new UserInfoSuccessResponse(claimsSet);
    }
    else if (ct.match(CommonContentTypes.APPLICATION_JWT)) {
   
      JWT jwt;
     
      try {
        jwt = httpResponse.getContentAsJWT();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.