Package org.glassfish.jersey.media.multipart

Examples of org.glassfish.jersey.media.multipart.FormDataMultiPart


     * @return a form data multi part entity.
     */
    private FormDataMultiPart getEntity(final HttpContext context) {
        final ContainerRequest requestContext = context.getRequestContext();
        if (requestContext.getProperty(FormDataMultiPart.class.getName()) == null) {
            FormDataMultiPart formDataMultiPart = requestContext.readEntity(FormDataMultiPart.class);
            requestContext.setProperty(FormDataMultiPart.class.getName(), formDataMultiPart);
        }

        return (FormDataMultiPart) requestContext.getProperty(FormDataMultiPart.class.getName());
    }
View Full Code Here


                //Make invocation
                Invocation invoc = null;
                Metrix.event("doRestCommand() - about to prepare invocation");
                if ("POST".equals(method)) {
                    if (outboundPayload != null && outboundPayload.size() > 0) {
                        FormDataMultiPart mp = new FormDataMultiPart();
                        //Copy params there
                        for (Map.Entry<String, List<String>> entry : options.entrySet()) {
                            String key = entry.getKey();
                            for (String val : entry.getValue()) {
                                mp.field(key, val);
                            }
                        }
                        //Copy outbound there
                        outboundPayload.addToMultipart(mp, logger);
                        Entity<FormDataMultiPart> entity = Entity.<FormDataMultiPart>entity(mp, mp.getMediaType());
                        invoc = request.build(method, entity);
                    } else {
                        Entity<ParameterMap> entity = Entity.<ParameterMap>entity(options, MediaType.APPLICATION_FORM_URLENCODED_TYPE);
                        invoc = request.build(method, entity);
                    }
View Full Code Here

TOP

Related Classes of org.glassfish.jersey.media.multipart.FormDataMultiPart

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.