Package retrofit.client

Examples of retrofit.client.Response


        if (syncToken == null) {
            throw new IllegalArgumentException("Sync token may not be null.");
        }

        ensureSpaceBlocking(true);
        Response response = service.performSynchronizationBlocking(spaceKey, null, syncToken);
        CDASyncedSpace result;

        try {
            result = gson.fromJson(
                    new InputStreamReader(response.getBody().in()), CDASyncedSpace.class);

            result = new SpaceMerger(null, result, null, null, getSpace()).call();
        } catch (Exception e) {
            throw RetrofitError.unexpectedError(response.getUrl(), e);
        }

        return result;
    }
View Full Code Here


     * @return {@link CDAArray} result.
     * @throws retrofit.RetrofitError in case of an error.
     */
    private CDAArray fetchArrayWithTypeBlocking(String type, Map<String, String> query) throws RetrofitError {
        ensureSpaceBlocking(false);
        Response response = service.fetchArrayWithTypeBlocking(spaceKey, type, query);

        CDAArray result;

        try {
            result = gson.fromJson(new InputStreamReader(response.getBody().in()), CDAArray.class);
            ArrayResponse.prepareResponse(result, response);
        } catch (IOException e) {
            throw RetrofitError.unexpectedError(response.getUrl(), e);
        }

        return result;
    }
View Full Code Here

     * @return {@link CDASyncedSpace} result.
     * @throws retrofit.RetrofitError in case of an error.
     */
    public CDASyncedSpace performInitialSynchronizationBlocking() throws RetrofitError {
        ensureSpaceBlocking(true);
        Response response = service.performSynchronizationBlocking(spaceKey, true, null);
        CDASyncedSpace result;

        try {
            result = gson.fromJson(
                    new InputStreamReader(response.getBody().in()), CDASyncedSpace.class);

            result = new SpaceMerger(null, result, null, null, getSpace()).call();
        } catch (Exception e) {
            throw RetrofitError.unexpectedError(response.getUrl(), e);
        }

        return result;
    }
View Full Code Here

        if (existingSpace == null) {
            throw new IllegalArgumentException("Existing space may not be null.");
        }

        ensureSpaceBlocking(true);
        Response response = service.performSynchronizationBlocking(spaceKey, null, existingSpace.getSyncToken());
        CDASyncedSpace result;

        try {
            CDASyncedSpace updatedSpace = gson.fromJson(new InputStreamReader(response.getBody().in()), CDASyncedSpace.class);
            result = new SpaceMerger(existingSpace, updatedSpace, null, response, getSpace()).call();
        } catch (Exception e) {
            throw RetrofitError.unexpectedError(response.getUrl(), e);
        }

        return result;
    }
View Full Code Here

        if (syncToken == null) {
            throw new IllegalArgumentException("Sync token may not be null.");
        }

        ensureSpaceBlocking(true);
        Response response = service.performSynchronizationBlocking(spaceKey, null, syncToken);
        CDASyncedSpace result;

        try {
            result = gson.fromJson(
                    new InputStreamReader(response.getBody().in()), CDASyncedSpace.class);

            result = new SpaceMerger(null, result, null, null, getSpace()).call();
        } catch (Exception e) {
            throw RetrofitError.unexpectedError(response.getUrl(), e);
        }

        return result;
    }
View Full Code Here

     * @return {@link CDAArray} result.
     * @throws retrofit.RetrofitError in case of an error.
     */
    private CDAArray fetchArrayWithTypeBlocking(String type, Map<String, String> query) throws RetrofitError {
        ensureSpaceBlocking(false);
        Response response = service.fetchArrayWithTypeBlocking(spaceKey, type, query);

        CDAArray result;

        try {
            result = gson.fromJson(new InputStreamReader(response.getBody().in()), CDAArray.class);
            ArrayResponse.prepareResponse(result, response);
        } catch (IOException e) {
            throw RetrofitError.unexpectedError(response.getUrl(), e);
        }

        return result;
    }
View Full Code Here

TOP

Related Classes of retrofit.client.Response

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.