Package dk.i2m.drupal.util

Examples of dk.i2m.drupal.util.URLBuilder.toURI()


        List<NameValuePair> nvps = new ArrayList<NameValuePair>();
        nvps.add(new BasicNameValuePair("username", username));
        nvps.add(new BasicNameValuePair("password", password));

        HttpPost method = new HttpPost(builder.toURI());
        method.setEntity(new UrlEncodedFormEntity(nvps, Consts.UTF_8));

        ResponseHandler<String> handler = new BasicResponseHandler();
        getDc().getHttpClient().execute(method, handler);
    }
View Full Code Here


        URLBuilder builder = new URLBuilder(getDc().getHostname());
        builder.add(getDc().getEndpoint());
        builder.add(getAlias());
        builder.add("logout");

        HttpPost method = new HttpPost(builder.toURI());

        ResponseHandler<String> handler = new BasicResponseHandler();
        getDc().getHttpClient().execute(method, handler);
    }
View Full Code Here

            HttpResponseException, IOException {
        URLBuilder builder = new URLBuilder(getDc().getHostname());
        builder.add(getDc().getEndpoint());
        builder.add(getAlias());

        HttpPost method = new HttpPost(builder.toURI());
        method.setEntity(uefe);

        ResponseHandler<String> handler = new BasicResponseHandler();
        String response = getDc().getHttpClient().execute(method, handler);
View Full Code Here

        URLBuilder builder = new URLBuilder(getDc().getHostname());
        builder.add(getDc().getEndpoint());
        builder.add(getAlias());
        builder.add(id);

        HttpGet method = new HttpGet(builder.toURI());

        ResponseHandler<String> handler = new BasicResponseHandler();
        String response = getDc().getHttpClient().execute(method, handler);

        return new Gson().fromJson(response, NodeMessage.class);
View Full Code Here

        URLBuilder builder = new URLBuilder(getDc().getHostname());
        builder.add(getDc().getEndpoint());
        builder.add(getAlias());
        builder.add(id);

        HttpPut method = new HttpPut(builder.toURI());
        method.setEntity(uefe);

        ResponseHandler<String> handler = new BasicResponseHandler();
        String response = getDc().getHttpClient().execute(method, handler);
View Full Code Here

        URLBuilder builder = new URLBuilder(getDc().getHostname());
        builder.add(getDc().getEndpoint());
        builder.add(getAlias());
        builder.add(id);

        HttpDelete method = new HttpDelete(builder.toURI());

        ResponseHandler<String> handler = new BasicResponseHandler();
        String response = getDc().getHttpClient().execute(method, handler);

        return Boolean.valueOf(response);
View Full Code Here

        URLBuilder builder = new URLBuilder(getDc().getHostname());
        builder.add(getDc().getEndpoint());
        builder.add(getAlias());
        builder.addQuery(params);

        HttpGet method = new HttpGet(builder.toURI());

        ResponseHandler<String> handler = new BasicResponseHandler();
        String response = getDc().getHttpClient().execute(method, handler);

        return new Gson().fromJson(response,
View Full Code Here

        builder.add(getAlias());
        builder.add(id);
        builder.add("files");
        builder.add(0); // Do not return the file contents (base64)

        HttpGet method = new HttpGet(builder.toURI());

        ResponseHandler<String> handler = new BasicResponseHandler();
        String response = getDc().getHttpClient().execute(method, handler);

        return new Gson().fromJson(response,
View Full Code Here

        MultipartEntity entity = EntityUtils.getMultipartEntity(files);
        entity.addPart("field_name", new StringBody(fieldName));
        entity.addPart("attach", new StringBody((attach ? "1" : "0")));

        HttpPost method = new HttpPost(builder.toURI());
        method.setEntity(entity);

        ResponseHandler<String> handler = new BasicResponseHandler();
        String response = getDc().getHttpClient().execute(method, handler);
View Full Code Here

        URLBuilder builder = new URLBuilder(getDc().getHostname());
        builder.add(getDc().getEndpoint());
        builder.add(getAlias());
        builder.add("create_raw");

        HttpPost method = new HttpPost(builder.toURI());
        method.setEntity(EntityUtils.getMultipartEntity(files));

        ResponseHandler<String> handler = new BasicResponseHandler();
        String response = getDc().getHttpClient().execute(method, handler);
View Full Code Here

TOP
Copyright © 2015 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.