Examples of ContentType


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

Examples of org.switchyard.component.http.ContentType

            try {
                HttpRequestBindingData httpRequest = new HttpRequestBindingData();
                byte[] responseBody = null;
                try {
                    String contentTypeStr = exchange.getRequestHeaders().getFirst(CONTENT_TYPE);
                    ContentType contentType = new ContentType(contentTypeStr);
                    httpRequest.setContentType(contentType);
                    httpRequest.setBodyFromStream(exchange.getRequestBody());
                    httpRequest.setHeaders(exchange.getRequestHeaders());
                    httpRequest.setRequestInfo(getRequestInfo(exchange, contentType));
                } catch (IOException e) {
View Full Code Here

Examples of org.wiztools.restclient.bean.ContentType

     */
    @Test
    public void testGetContentType_String() {
        System.out.println("getContentType");
        String header = "application/vnd.mnet.staticwebspaces+xml;version=1;charset=UTF-8";
        ContentType expResult = new ContentTypeBean("application/vnd.mnet.staticwebspaces+xml", Charsets.UTF_8);
        ContentType result = HttpUtil.getContentType(header);
        assertEquals(expResult, result);
    }   
View Full Code Here

Examples of org.xlightweb.ContentType

        public void onRequest(IHttpExchange httpExchange) throws IOException, BadMessageException {
            System.out.println("WebSockets.onRequest(IHttpExchange)");
       
            IHttpRequest httpRequest = httpExchange.getRequest();
            if (httpRequest.getAccept().contains(new ContentType("text/html"))) {
                String requestURI = httpRequest.getRequestURI();
               
                if (requestURI.equals("/websocket.html")) {
                    String page =   " <html> \r\n" +
                                    "   <head> \r\n" +
View Full Code Here

Examples of org.zanata.common.ContentType

{
   public ContentType unmarshal(String s) throws Exception
   {
      if (s == null)
         return null;
      return new ContentType(s);
   }
View Full Code Here

Examples of railo.commons.io.res.ContentType

      HTTPResponse method = HTTPEngine.get(url, authUser, authPassword, -1,HTTPEngine.MAX_REDIRECT, null, userAgent,
          ProxyDataImpl.getInstance(proxyserver, proxyport, proxyuser, proxypassword),null);
     
      // mimetype
      if(StringUtil.isEmpty(strMimetype)) {
        ContentType ct = method.getContentType();
        if(ct!=null)
          setMimetype(ct.toString());
       
      }
      InputStream is = new ByteArrayInputStream(method.getContentAsByteArray());
      try {
       
View Full Code Here

Examples of railo.commons.lang.mimetype.ContentType

 

  public static ContentType toContentType(String str, ContentType defaultValue) {
    if( StringUtil.isEmpty(str,true)) return defaultValue;
    String[] types=str.split(";");
    ContentType ct=null;
    if(types.length>0){
        ct=new ContentType(types[0]);
        if(types.length>1) {
              String tmp=types[types.length-1].trim();
              int index=tmp.indexOf("charset=");
              if(index!=-1) {
                ct.setCharset(StringUtil.removeQuotes(tmp.substring(index+8),true));
              }
          }
      }
      return ct;
  }
View Full Code Here

Examples of vn.pyco.tinycms.model.ContentType

    }

    @OnEvent(value = EventConstants.SUCCESS, component = "contentTypeForm")
    Object submitContentTypeFormForm() {
        if (_contentType == null) {
            _contentType = new ContentType();
        }
        _contentType.setName(_contentTypeName);
        _contentType.setDescription(_contentTypeDescription);
        _contentTypeService.saveContentType(_contentType);
        return vn.pyco.tinycms.web.pages.admin.Index.class;
View Full Code Here

Examples of xbird.xquery.type.schema.ComplexType.ContentType

            //  its typed-value is its dm:string-value as an xdt:untypedAtomic.
            // - If the element has a complex type with mixed content (including xs:anyType),
            //  its typed-value is its dm:string-value as an xdt:untypedAtomic.
            return new UntypedAtomicValue(stringValue());
        } else if(t instanceof ComplexType) {
            ContentType ct = ((ComplexType) t).getContentType();
            if(ct.isType(ContentType.EmptyContent)) {
                // - If the element has a complex type with empty content, its typed-value
                //  is the empty sequence.          
                return ValueSequence.<AtomicValue> emptySequence();
            } else if(ct.isType(ContentType.SimpleContent)) {
                // - If the element has a simple type or a complex type with simple content,
                //  the result is a sequence of zero or more atomic values.
                return new UntypedAtomicValue(stringValue().toString());
            }
        }
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.