Package org.simpleframework.http

Examples of org.simpleframework.http.ContentType


    * using this method if there is a need to parse that content.
    *
    * @return the body content containing the message body
    */
   public String getContent() throws IOException {
      ContentType type = getContentType();
     
      if(type == null) {
         return body.getContent("ISO-8859-1");
      }     
      return getContent(type);
View Full Code Here


    * used when a HTML form is used to post data to the server.
    *
    * @return this returns true if content type is a form post
    */  
   private boolean isFormPost() {
      ContentType type = request.getContentType();
     
      if(type == null) {
         return false;
      }
      return isFormPost(type);
View Full Code Here

    * as suggested by RFC 2616, section 3.7.1.
    *
    * @return returns the charset used by this response object
    */
   private String getCharset() {
      ContentType type = getContentType();
     
      if(type == null) {        
         return "ISO-8859-1";
      }
      if(type.getCharset()==null){
         return "ISO-8859-1";
      }
      return type.getCharset();
   }
View Full Code Here

    * @param header this is the header associated with the body
    *
    * @return the boundary for a multipart upload body
    */
   protected byte[] getBoundary(Segment header) {
      ContentType type = header.getContentType();
     
      if(type != null) {
         String token = type.getParameter(BOUNDARY);
        
         if(token != null) {
            return token.getBytes();
         }
      }
View Full Code Here

    * @param segment this is the header associated with the body
    *
    * @return true if the content type is that of a multipart body
    */  
   protected boolean isUpload(Segment segment) {
      ContentType type = segment.getContentType();     
     
      if(type != null) {
         String token = type.getPrimary();
     
         if(token.equals(MULTIPART)) {
            return true;
         }
      }
View Full Code Here

    * @param header this is the header associated with the body
    *
    * @return the boundary for a multipart upload body
    */
   protected byte[] getBoundary(Segment header) {
      ContentType type = header.getContentType();
     
      if(type != null) {
         String token = type.getParameter("boundary");
        
         if(token != null) {
            return token.getBytes();
         }
      }
View Full Code Here

    * @param segment this is the header associated with the body
    *
    * @return true if the content type is that of a multipart body
    */  
   protected boolean isPart(Segment segment) {
      ContentType type = segment.getContentType();     
     
      if(type != null) {
         String token = type.getPrimary();
     
         if(token.equals("multipart")) {
            return true;
         }
      }
View Full Code Here

    * using this method if there is a need to parse that content.
    *
    * @return the body content containing the message body
    */
   public String getContent() throws IOException {
      ContentType type = getContentType();
     
      if(type == null) {
         return body.getContent("UTF-8");
      }     
      return getContent(type);
View Full Code Here

    * used when a HTML form is used to post data to the server.
    *
    * @return this returns true if content type is a form post
    */  
   private boolean isFormPost() {
      ContentType type = request.getContentType();
     
      if(type == null) {
         return false;
      }
      return isFormPost(type);
View Full Code Here

    * as suggested by RFC 2616, section 3.7.1.
    *
    * @return returns the charset used by this response object
    */
   private String getCharset() {
      ContentType type = getContentType();
     
      if(type == null) {        
         return "iso-8859-1";
      }
      if(type.getCharset()==null){
         return "iso-8859-1";
      }
      return type.getCharset();
   }
View Full Code Here

TOP

Related Classes of org.simpleframework.http.ContentType

Copyright © 2018 www.massapicom. 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.