Package org.apache.chemistry.opencmis.client.bindings.spi.http

Examples of org.apache.chemistry.opencmis.client.bindings.spi.http.Response


     * result.
     */
    protected Response read(UrlBuilder url) {
        // make the call
        //Log.d("URL", url.toString());
        Response resp = getHttpInvoker().invokeGET(url, session);

        // check response code
        if (resp.getResponseCode() != 200) {
            throw convertStatusCode(resp.getResponseCode(), resp.getResponseMessage(), resp.getErrorContent(), null);
        }

        return resp;
    }
View Full Code Here


     * result.
     */
    protected Response post(UrlBuilder url, String contentType, Output writer) {
        // make the call
        //Log.d("URL", url.toString());
        Response resp = getHttpInvoker().invokePOST(url, contentType, writer, session);

        // check response code
        if (resp.getResponseCode() != 201) {
            throw convertStatusCode(resp.getResponseCode(), resp.getResponseMessage(), resp.getErrorContent(), null);
        }

        return resp;
    }
View Full Code Here

     */
    protected Response put(UrlBuilder url, String contentType, Map<String, String> headers,
            Output writer) {
        // make the call
        //Log.d("URL", url.toString());
        Response resp = getHttpInvoker().invokePUT(url, contentType, headers, writer, session);

        // check response code
        if ((resp.getResponseCode() < 200) || (resp.getResponseCode() > 299)) {
            throw convertStatusCode(resp.getResponseCode(), resp.getResponseMessage(), resp.getErrorContent(), null);
        }

        return resp;
    }
View Full Code Here

     * result.
     */
    protected void delete(UrlBuilder url) {
        // make the call
        //Log.d("URL", url.toString());
        Response resp = getHttpInvoker().invokeDELETE(url, session);

        // check response code
        if (resp.getResponseCode() != 204) {
            throw convertStatusCode(resp.getResponseCode(), resp.getResponseMessage(), resp.getErrorContent(), null);
        }
    }
View Full Code Here

        // retrieve service doc
        UrlBuilder url = new UrlBuilder(getServiceDocURL());
        url.addParameter(Constants.PARAM_REPOSITORY_ID, repositoryId);

        // read and parse
        Response resp = read(url);
        ServiceDoc serviceDoc = parse(resp.getStream(), ServiceDoc.class);

        // walk through the workspaces
        for (RepositoryWorkspace ws : serviceDoc.getWorkspaces()) {
            if (ws.getId() == null) {
                // found a non-CMIS workspace
View Full Code Here

        if (returnVersion != null && returnVersion != ReturnVersion.THIS) {
            url.addParameter(Constants.PARAM_RETURN_VERSION, returnVersion);
        }

        // read and parse
        Response resp = read(url);
        AtomEntry entry = parse(resp.getStream(), AtomEntry.class);

        // we expect a CMIS entry
        if (entry.getId() == null) {
            throw new CmisConnectionException("Received Atom entry is not a CMIS entry!");
        }
View Full Code Here

        if (link == null) {
            throw new CmisObjectNotFoundException("Unknown repository!");
        }

        // read and parse
        Response resp = read(new UrlBuilder(link));
        AtomEntry entry = parse(resp.getStream(), AtomEntry.class);

        // we expect a CMIS entry
        if (entry.getId() == null) {
            throw new CmisConnectionException("Received Atom entry is not a CMIS entry!");
        }
View Full Code Here

        UrlBuilder url = new UrlBuilder(link);
        url.addParameter(Constants.PARAM_ONLY_BASIC_PERMISSIONS, onlyBasicPermissions);

        // read and parse
        Response resp = read(url);
        AtomAcl acl = parse(resp.getStream(), AtomAcl.class);

        return acl.getACL();
    }
View Full Code Here

        UrlBuilder aclUrl = new UrlBuilder(link);
        aclUrl.addParameter(Constants.PARAM_ACL_PROPAGATION, aclPropagation);

        // update
        Response resp = put(aclUrl, Constants.MEDIATYPE_ACL, new Output() {
            public void write(OutputStream out) throws Exception {
                // TODO not implemented
                AtomEntryWriter.writeACL(out, acl);
            }
        });

        // parse new entry
        return parse(resp.getStream(), AtomAcl.class);
    }
View Full Code Here

        // set up object and writer
        final AtomEntryWriter entryWriter = new AtomEntryWriter(createIdObject(objectId.getValue()));

        // post move request
        Response resp = post(url, Constants.MEDIATYPE_ENTRY, new Output() {
            public void write(OutputStream out) throws Exception {
                entryWriter.write(out);
            }
        });

        // parse the response
        AtomEntry entry = parse(resp.getStream(), AtomEntry.class);

        objectId.setValue(entry.getId());

        lockLinks();
        try {
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.client.bindings.spi.http.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.