Package org.glassfish.jersey.media.multipart.file

Examples of org.glassfish.jersey.media.multipart.file.StreamDataBodyPart


      bytes = compress(data, compressingStreamClass);
    }
    MediaType type =
        encoding == null ? MediaType.TEXT_PLAIN_TYPE : new MediaType("application", encoding);
    InputStream in = new ByteArrayInputStream(bytes);
    StreamDataBodyPart filePart = new StreamDataBodyPart("data", in, "data", type);
    MultiPart multiPart = new MultiPart(MediaType.MULTIPART_FORM_DATA_TYPE);
    multiPart.getBodyParts().add(filePart);
    Response response = target("/ingest").request().post(
        Entity.entity(multiPart, MediaType.MULTIPART_FORM_DATA_TYPE));
    checkResponse(response);
View Full Code Here

TOP

Related Classes of org.glassfish.jersey.media.multipart.file.StreamDataBodyPart

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.