Package com.sun.jersey.multipart

Examples of com.sun.jersey.multipart.FormDataMultiPart.field()


        form.field("project", Integer.toString(id));
        form.field("name", name);
        form.field("app", app);

        if(pool != null) {
            form.field("pool", Integer.toString(pool.id));
        }

        if(optionalParams != null) {
            for(Map.Entry<String, String> entry : optionalParams.entrySet()) {
                form.field(entry.getKey(), entry.getValue());
View Full Code Here


            form.field("pool", Integer.toString(pool.id));
        }

        if(optionalParams != null) {
            for(Map.Entry<String, String> entry : optionalParams.entrySet()) {
                form.field(entry.getKey(), entry.getValue());
            }
        }

        AppThwackRun run = root.path("run").type(MediaType.MULTIPART_FORM_DATA).post(AppThwackRun.class, form);
        run.setRoot(root);
View Full Code Here

        if(!file.isFile()) {
            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

     * @param optionalParams Map of optional parameters to configure this run
     * @return AppThwackRun which represents the scheduled run
     */
    private AppThwackRun scheduleRun(String name, String app, AppThwackDevicePool pool, HashMap<String, String> optionalParams) {
        FormDataMultiPart form = new FormDataMultiPart();
        form.field("project", Integer.toString(id));
        form.field("name", name);
        form.field("app", app);

        if(pool != null) {
            form.field("pool", Integer.toString(pool.id));
View Full Code Here

     * @return AppThwackRun which represents the scheduled run
     */
    private AppThwackRun scheduleRun(String name, String app, AppThwackDevicePool pool, HashMap<String, String> optionalParams) {
        FormDataMultiPart form = new FormDataMultiPart();
        form.field("project", Integer.toString(id));
        form.field("name", name);
        form.field("app", app);

        if(pool != null) {
            form.field("pool", Integer.toString(pool.id));
        }
View Full Code Here

     */
    private AppThwackRun scheduleRun(String name, String app, AppThwackDevicePool pool, HashMap<String, String> optionalParams) {
        FormDataMultiPart form = new FormDataMultiPart();
        form.field("project", Integer.toString(id));
        form.field("name", name);
        form.field("app", app);

        if(pool != null) {
            form.field("pool", Integer.toString(pool.id));
        }

View Full Code Here

        form.field("project", Integer.toString(id));
        form.field("name", name);
        form.field("app", app);

        if(pool != null) {
            form.field("pool", Integer.toString(pool.id));
        }

        if(optionalParams != null) {
            for(Map.Entry<String, String> entry : optionalParams.entrySet()) {
                form.field(entry.getKey(), entry.getValue());
View Full Code Here

            form.field("pool", Integer.toString(pool.id));
        }

        if(optionalParams != null) {
            for(Map.Entry<String, String> entry : optionalParams.entrySet()) {
                form.field(entry.getKey(), entry.getValue());
            }
        }

        AppThwackRun run = root.path("run").type(MediaType.MULTIPART_FORM_DATA).post(AppThwackRun.class, form);
        run.setRoot(root);
View Full Code Here

        {
            final WebResource webResource = client.resource("http://localhost:8080/dcs/rest");
            final FormDataMultiPart form = new FormDataMultiPart();
            for (Map.Entry<String, String> entry : attributes.entrySet())
            {
                form.field(entry.getKey(), entry.getValue());
            }
   
            // We need to explicitly set form multipart boundary to some unique value
            final String boundary = "---------------------------"
                + System.currentTimeMillis();
View Full Code Here

         
          deploymentName = createDeploymentName(archive.getName());
          try {
              // Build up the POST form to send to Glassfish
              final FormDataMultiPart form = new FormDataMultiPart();
              form.field("target", this.configuration.getTarget(), MediaType.TEXT_PLAIN_TYPE);                       
              form.field("operation", DELETE_OPERATION, MediaType.TEXT_PLAIN_TYPE);
              glassFishClient.doUndeploy(this.deploymentName, form);
          } catch (GlassFishClientException e) {
              throw new DeploymentException("Could not undeploy " + archive.getName(), e);
          }
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.