Package com.ramforth.webserver.http

Examples of com.ramforth.webserver.http.HttpRequestByteArrayBodyData


        catch (IOException ex) {
            LOGGER.warn("Could not read plain content from client.", ex);
            throw new com.ramforth.webserver.exceptions.IOException(ex);
        }

        return new HttpRequestByteArrayBodyData(buffer.getCopy());
    }
View Full Code Here


        byteArrayBodyParser.setContentType(contentType);
        byteArrayBodyParser.setContentDisposition(contentDisposition);
        byteArrayBodyParser.setCharset(charset);
        byteArrayBodyParser.setTransferEncoding(transferEncoding);

        HttpRequestByteArrayBodyData byteArrayBodyData = (HttpRequestByteArrayBodyData) byteArrayBodyParser.parse(inputStream);

        String filename = contentDisposition.getDispositionType().getValue("filename");
        String name = contentDisposition.getDispositionType().getValue("name");
        String mimeType = contentType.getMediaType().getType();

        return new HttpRequestFileBodyData(name, filename, mimeType, byteArrayBodyData.getData());
    }
View Full Code Here

        IHttpRequestBodyParser byteArrayBodyParser = new HttpRequestByteArrayBodyParser();
        byteArrayBodyParser.setTransferEncoding(transferEncoding);
        byteArrayBodyParser.setContentType(contentType);
        byteArrayBodyParser.setCharset(charset);

        HttpRequestByteArrayBodyData byteArrayBodyData = (HttpRequestByteArrayBodyData) byteArrayBodyParser.parse(inputStream);

        byte[] data = byteArrayBodyData.getData();
        String parameterString = new String(data, charset);
        NameValueMap formData = parameterParser.parse(parameterString, true);
        return new HttpRequestFormBodyData(formData);
    }
View Full Code Here

TOP

Related Classes of com.ramforth.webserver.http.HttpRequestByteArrayBodyData

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.