Package io.fathom.http

Examples of io.fathom.http.HttpRequest


    public ImportImageClient(HttpClient httpClient, URI baseUri) {
        super(httpClient, baseUri);
    }

    public ImageImportMetadata getMetadata(URI uri) throws RestClientException {
        HttpRequest request = getHttpClient().buildRequest(HttpMethod.GET, uri);
        addHeaders(request);

        ImageImportMetadata metadata = doRequest(request, ImageImportMetadata.class);
        return metadata;
    }
View Full Code Here


    public TempFile downloadImage(URI metadataUri, ImageImportMetadata metadata) throws IOException,
            RestClientException {
        URI uri = metadataUri.resolve(metadata.image);

        HttpRequest request = getHttpClient().buildRequest(HttpMethod.GET, uri);
        addHeaders(request);

        HttpResponse response = executeRawRequest(request);

        try {
View Full Code Here

    }

    protected HttpRequest buildPost(String relativePath) throws RestClientException {
        URI uri = resolve(relativePath);

        HttpRequest request = httpConfiguration.buildRequest(HttpMethod.POST, uri);
        addHeaders(request);
        return request;
    }
View Full Code Here

        addHeaders(request);
        return request;
    }

    protected String doPost(String relativePath, Object data) throws RestClientException {
        HttpRequest request = buildPost(relativePath);
        setEntityJson(request, data);
        return doStringRequest(request);
    }
View Full Code Here

    public OpenstackStorageClient(HttpClient httpClient, URI uri, TokenProvider tokenProvider) {
        super(httpClient, uri, tokenProvider);
    }

    public StorageObjectInfo findStorageObjectInfo(String path) throws RestClientException {
        HttpRequest request = buildHead(path);
        HttpResponse response = null;
        try {
            response = executeRawRequest(request);

            StorageObjectInfo info = new StorageObjectInfo();
View Full Code Here

            closeQuietly(response);
        }
    }

    public void putFile(String path, File src) throws RestClientException {
        HttpRequest request = buildPut(path);

        ByteSource entity = Files.asByteSource(src);
        setRequestContent(request, entity);

        doByteArrayRequest(request);
View Full Code Here

        doByteArrayRequest(request);
    }

    public void appendToFile(String path, ByteSource entity) throws RestClientException {
        HttpRequest request = buildPost(path);
        setRequestContent(request, entity);

        doByteArrayRequest(request);
    }
View Full Code Here

        doByteArrayRequest(request);
    }

    public void putFile(String path, ByteSource entity) throws RestClientException {
        // TODO: Support metadata
        HttpRequest request = buildPut(path);
        setRequestContent(request, entity);

        doByteArrayRequest(request);
    }
View Full Code Here

        doByteArrayRequest(request);
    }

    public void delete(String path) throws RestClientException {
        HttpRequest request = buildDelete(path);
        doStringRequest(request);
    }
View Full Code Here

            throw new UnsupportedOperationException();
        }
        if (maxListingLength != 0) {
            relativeUri += "&limit=" + maxListingLength;
        }
        HttpRequest get = buildGet(relativeUri);
        List<StorageObjectInfo> objects = doListRequest(get, StorageObjectInfo.class);

        String nextKey = null;
        if (maxListingLength != 0 && objects.size() == maxListingLength) {
            // set nextKey
View Full Code Here

TOP

Related Classes of io.fathom.http.HttpRequest

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.