Package com.ramforth.webserver.http.headers.entity

Examples of com.ramforth.webserver.http.headers.entity.ContentTypeHttpHeader


                    || !partContentDisposition.getDispositionType().getParameters().containsName("name")) {
                throw new HttpException(HttpStatusCode.STATUS_400_BAD_REQUEST,
                        String.format("Bad Content-Disposition: %s.", partContentDisposition.getRawValue()));
            }

            ContentTypeHttpHeader partContentType = (ContentTypeHttpHeader) headers.getHeader("Content-Type");
            BoundaryDelimitedInputStream bdis = new BoundaryDelimitedInputStream(inputStream, boundary);

            IHttpRequestBodyParserFactory bodyParserFactory = new HttpRequestBodyParserFactory();
            IHttpRequestBodyParser partBodyParser = bodyParserFactory.build(partContentType, partContentDisposition);
View Full Code Here


                break;
            case "content-length":
                header = new ContentLengthHttpHeader(Long.parseLong(rawValue));
                break;
            case "content-type":
                header = new ContentTypeHttpHeader(rawValue);
                break;
            case "transfer-encoding":
                header = new TransferEncodingHttpHeader(rawValue);
                break;
            case "content-disposition":
View Full Code Here

            cgiProcessBuilder.environment().put("CONTENT_LENGTH", String.valueOf(contentLengthRequestHeader.getValue()));
        }
       
        requestHeader = httpContext.getRequest().getHeaders().getHeader("Content-Type");
        if (requestHeader != null) {
            ContentTypeHttpHeader contentTypeRequestHeader = (ContentTypeHttpHeader)requestHeader;
            cgiProcessBuilder.environment().put("CONTENT_TYPE", String.valueOf(contentTypeRequestHeader.getValue()));
        }
       
        cgiProcessBuilder.environment().put("GATEWAY_INTERFACE", HttpCgiModule.CGI_VERSION);
        cgiProcessBuilder.environment().put("REMOTE_ADDR", httpContext.getRequest().getClientHostAddress());
        cgiProcessBuilder.environment().put("REMOTE_HOST", httpContext.getRequest().getClientHostName());
View Full Code Here

    public void setContentType(String value) {
        this.contentType = value;
        if (headers.contains("Content-Type")) {
            headers.getHeader("Content-Type").setRawValue(value);
        } else {
            headers.addHeader(new ContentTypeHttpHeader(value));
        }
    }
View Full Code Here

            if (requestLine.getURI().getQuery() != null) {
                fillQueryString(httpRequest, requestLine.getURI().getQuery(), true);
            }

            ContentLengthHttpHeader contentLengthHeader = ((ContentLengthHttpHeader) httpHeaders.getHeader("Content-Length"));
            ContentTypeHttpHeader contentTypeHeader = ((ContentTypeHttpHeader) httpHeaders.getHeader("Content-Type"));

            IHttpHeader transferEncoding = httpHeaders.getHeader("Transfer-Encoding");
            TransferEncodingHttpHeader transferEncodingHeader = null;
            if (transferEncoding != null) {
                transferEncodingHeader = (TransferEncodingHttpHeader) transferEncoding;
View Full Code Here

    }

    @Override
    public byte[] parseBody(InputStream is, IHttpHeaders headers) {
        ContentLengthHttpHeader contentLengthHeader = ((ContentLengthHttpHeader) headers.getHeader("Content-Length"));
        ContentTypeHttpHeader contentTypeHeader = ((ContentTypeHttpHeader) headers.getHeader("Content-Type"));

        IHttpHeader transferEncoding = headers.getHeader("Transfer-Encoding");
        TransferEncodingHttpHeader transferEncodingHeader = null;
        if (transferEncoding != null) {
            transferEncodingHeader = (TransferEncodingHttpHeader) transferEncoding;
        }

        String contentType = contentTypeHeader.getMediaType().getType();
        Charset charset = contentTypeHeader.getMediaType().getCharset();

        if (transferEncodingHeader == null || transferEncodingHeader.getValue() == null) {
            return null;
        } else {
            if (transferEncodingHeader.getValue().compareTo("chunked") == 0) {
View Full Code Here

TOP

Related Classes of com.ramforth.webserver.http.headers.entity.ContentTypeHttpHeader

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.