Examples of FileDataBodyPart


Examples of com.dotcms.repackage.com.sun.jersey.multipart.file.FileDataBodyPart

                form.field("GROUP_ID", UtilMethods.isSet(endpoint.getGroupId()) ? endpoint.getGroupId() : endpoint.getId());
                Bundle b=APILocator.getBundleAPI().getBundleById(config.getId());
                form.field("BUNDLE_NAME", b.getName());
                form.field("ENDPOINT_ID", endpoint.getId());
                form.bodyPart(new FileDataBodyPart("bundle", bundle, MediaType.MULTIPART_FORM_DATA_TYPE));


                //Sending bundle to endpoint
                WebResource resource = client.resource(endpoint.toURL()+"/api/bundlePublisher/publish");
View Full Code Here

Examples of com.dotcms.repackage.com.sun.jersey.multipart.file.FileDataBodyPart

    FormDataMultiPart form = new FormDataMultiPart();
    form.field( "AUTH_TOKEN", PublicEncryptionFactory.encryptString( (PublicEncryptionFactory.decryptString( receivingFromEndpoint.getAuthKey().toString() )) ) );
    form.field( "GROUP_ID", UtilMethods.isSet( receivingFromEndpoint.getGroupId() ) ? receivingFromEndpoint.getGroupId() : receivingFromEndpoint.getId() );
    form.field( "BUNDLE_NAME", bundle.getName() );
    form.field( "ENDPOINT_ID", receivingFromEndpoint.getId() );
    form.bodyPart( new FileDataBodyPart( "bundle", newBundleFile, MediaType.MULTIPART_FORM_DATA_TYPE ) );

    //Sending bundle to endpoint
    WebResource resource = client.resource( receivingFromEndpoint.toURL() + "/api/bundlePublisher/publish" );
    ClientResponse clientResponse = resource.type( MediaType.MULTIPART_FORM_DATA ).post( ClientResponse.class, form );
    //Validations
View Full Code Here

Examples of com.dotcms.repackage.com.sun.jersey.multipart.file.FileDataBodyPart

    FormDataMultiPart form = new FormDataMultiPart();
    form.field( "AUTH_TOKEN", PublicEncryptionFactory.encryptString( (PublicEncryptionFactory.decryptString( receivingFromEndpoint.getAuthKey().toString() )) ) );
    form.field( "GROUP_ID", UtilMethods.isSet( receivingFromEndpoint.getGroupId() ) ? receivingFromEndpoint.getGroupId() : receivingFromEndpoint.getId() );
    form.field( "BUNDLE_NAME", bundle.getName() );
    form.field( "ENDPOINT_ID", receivingFromEndpoint.getId() );
    form.bodyPart( new FileDataBodyPart( "bundle", newBundleFile, MediaType.MULTIPART_FORM_DATA_TYPE ) );

    /* TODO: We have the improve this test because of the new license updates
     *
    //Sending bundle to endpoint
    WebResource resource = client.resource( receivingFromEndpoint.toURL() + "/api/bundlePublisher/publish" );
View Full Code Here

Examples of com.dotcms.repackage.com.sun.jersey.multipart.file.FileDataBodyPart

                form.field("AUTH_TOKEN",
                        PushPublisher.retriveKeyString(
                                PublicEncryptionFactory.decryptString(endpoint.getAuthKey().toString())));

                form.field("TYPE", type);
                form.bodyPart(new FileDataBodyPart("DATA_TO_FIX", bundle, MediaType.MULTIPART_FORM_DATA_TYPE));

                String url = endpoint.toURL()+"/api/integrity/fixconflictsfromremote/";
                com.dotcms.repackage.com.sun.jersey.api.client.WebResource resource = client.resource(url);

                ClientResponse response = resource.type(MediaType.MULTIPART_FORM_DATA).post(ClientResponse.class, form);
View Full Code Here

Examples of com.sun.jersey.multipart.file.FileDataBodyPart

            final File archiveFile = new File(new File(System.getProperty("java.io.tmpdir")), archiveName);
            archive.as(ZipExporter.class).exportZip(archiveFile, true);

            // Build up the POST form to send to Glassfish
            final FormDataMultiPart form = new FormDataMultiPart();
            form.getBodyParts().add(new FileDataBodyPart("id", archiveFile));
            form.field("contextroot", archiveName.substring(0, archiveName.lastIndexOf(".")), MediaType.TEXT_PLAIN_TYPE);
            deploymentName = archiveName.substring(0, archiveName.lastIndexOf("."));
            form.field("name", deploymentName, MediaType.TEXT_PLAIN_TYPE);
            final String xmlResponse = prepareClient(APPLICATION).type(MediaType.MULTIPART_FORM_DATA_TYPE)
                    .post(String.class, form);
View Full Code Here

Examples of com.sun.jersey.multipart.file.FileDataBodyPart

    invoke(new Callable<Void>() {
      @Override
      public Void call() throws Exception {
        final MultiPart multiPartInput = new MultiPart();
        for (File file : myFiles) {
          FileDataBodyPart fileDataBodyPart = new FileDataBodyPart(FILE_ATTACHMENT_CONTROL_NAME, file);
          multiPartInput.bodyPart(fileDataBodyPart);
        }
        postFileMultiPart(multiPartInput, attachmentsUri);
        return null;
      }
View Full Code Here

Examples of com.sun.jersey.multipart.file.FileDataBodyPart

            throw new AppThwackException("file cannot be a directory");
        }

        FormDataMultiPart form = new FormDataMultiPart();
        form.field("name", name);
        form.bodyPart(new FileDataBodyPart("file", file, MediaType.APPLICATION_OCTET_STREAM_TYPE));

        return root.path("file").type(MediaType.MULTIPART_FORM_DATA).post(AppThwackFile.class, form);
    }
View Full Code Here

Examples of com.sun.jersey.multipart.file.FileDataBodyPart

        final WebResource.Builder builder = client.resource(soda2ifyUri(uri))
                                                  .accept(acceptType)
                                                  .type(MediaType.MULTIPART_FORM_DATA_TYPE);

        FormDataMultiPart form = new FormDataMultiPart();
        form.bodyPart(new FileDataBodyPart(file.getName(), file, mediaType));

        final ClientResponse response = builder.post(ClientResponse.class, form);
        return processErrors(response);
    }
View Full Code Here

Examples of com.sun.jersey.multipart.file.FileDataBodyPart

        final WebResource.Builder builder = client.resource(soda2ifyUri(uri))
                                                  .accept(acceptType)
                                                  .type(MediaType.MULTIPART_FORM_DATA_TYPE);

        FormDataMultiPart form = new FormDataMultiPart();
        form.bodyPart(new FileDataBodyPart(file.getName(), file, mediaType));

        final ClientResponse response = builder.put(ClientResponse.class, form);
        return processErrors(response);
    }
View Full Code Here

Examples of com.sun.jersey.multipart.file.FileDataBodyPart

        client.addFilter(new LoggingFilter());
       
        WebResource webResource = client.resource(WOOKIE_URL);
       
        FormDataMultiPart formDataMultiPart = new FormDataMultiPart();
        formDataMultiPart.bodyPart(new FileDataBodyPart(WIDGET_PARAM_NAME, widget, MediaType.APPLICATION_OCTET_STREAM_TYPE));
               
        String string = webResource.type(MediaType.MULTIPART_FORM_DATA).post(String.class, formDataMultiPart);
        // Parse respose for searching errors.
        System.out.println(string);
    }
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.