Package dk.i2m.drupal.util

Examples of dk.i2m.drupal.util.URLBuilder


                }.getType());
    }

    public FileMessage retrieve(Long id) throws HttpResponseException,
            IOException {
        URLBuilder builder = new URLBuilder(getDc().getHostname());
        builder.add(getDc().getEndpoint());
        builder.add(getAlias());
        builder.add(id);
        builder.addQuery("file_contents", 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, FileMessage.class);
View Full Code Here


        return new Gson().fromJson(response, FileMessage.class);
    }

    public boolean delete(Long id) throws HttpResponseException, IOException {
        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

TOP

Related Classes of dk.i2m.drupal.util.URLBuilder

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.