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

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


        // 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());
    }
View Full Code Here


                            MimeHelper.encodeContentDisposition(MimeHelper.DISPOSITION_ATTACHMENT,
                                    contentStream.getFileName()));
        }

        // send content
        Response resp = put(url, contentStream.getMimeType(), headers, new Output() {
            public void write(OutputStream out) throws Exception {
                int b;
                byte[] buffer = new byte[4096];

                while ((b = stream.read(buffer)) > -1) {
                    out.write(buffer, 0, b);
                }
            }
        });

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

        objectId.setValue(null);
        if (changeToken != null) {
            changeToken.setValue(null);
View Full Code Here

        url.addParameter(Constants.PARAM_POLICY_IDS, includePolicyIds);
        url.addParameter(Constants.PARAM_ACL, includeACL);
        url.addParameter(Constants.PARAM_MAX_ITEMS, maxItems);

        // read and parse
        Response resp = read(url);
        AtomFeed feed = parse(resp.getStream(), AtomFeed.class);

        // handle top level
        for (AtomElement element : feed.getElements()) {
            if (element.getObject() instanceof AtomLink) {
                if (isNextLink(element)) {
View Full Code Here

        query.setRenditionFilter(renditionFilter);
        query.setMaxItems(maxItems);
        query.setSkipCount(skipCount);

        // post the query and parse results
        Response resp = post(url, Constants.MEDIATYPE_QUERY, new Output() {
            public void write(OutputStream out) throws Exception {
                JaxBHelper.marshal(JaxBHelper.CMIS_OBJECT_FACTORY.createQuery(query), out, false);
            }
        });
        AtomFeed feed = parse(resp.getStream(), AtomFeed.class);

        // handle top level
        for (AtomElement element : feed.getElements()) {
            if (element.getObject() instanceof AtomLink) {
                if (isNextLink(element)) {
View Full Code Here

        url.addParameter(Constants.PARAM_ALLOWABLE_ACTIONS, includeAllowableActions);
        url.addParameter(Constants.PARAM_MAX_ITEMS, maxItems);
        url.addParameter(Constants.PARAM_SKIP_COUNT, skipCount);

        // read and parse
        Response resp = read(url);
        AtomFeed feed = parse(resp.getStream(), AtomFeed.class);

        // handle top level
        for (AtomElement element : feed.getElements()) {
            if (element.getObject() instanceof AtomLink) {
                if (isNextLink(element)) {
View Full Code Here

        url.addParameter(Constants.PARAM_PATH_SEGMENT, includePathSegment);
        url.addParameter(Constants.PARAM_MAX_ITEMS, maxItems);
        url.addParameter(Constants.PARAM_SKIP_COUNT, skipCount);

        // read and parse
        Response resp = read(url);
        AtomFeed feed = parse(resp.getStream(), AtomFeed.class);

        // handle top level
        for (AtomElement element : feed.getElements()) {
            if (element.getObject() instanceof AtomLink) {
                if (isNextLink(element)) {
View Full Code Here

        url.addParameter(Constants.PARAM_RELATIONSHIPS, includeRelationships);
        url.addParameter(Constants.PARAM_RENDITION_FILTER, renditionFilter);
        url.addParameter(Constants.PARAM_PATH_SEGMENT, includePathSegment);

        // read and parse
        Response resp = read(url);
        AtomFeed feed = parse(resp.getStream(), AtomFeed.class);

        // process tree
        addDescendantsLevel(repositoryId, feed, result);

        return result;
View Full Code Here

        UrlBuilder url = new UrlBuilder(link);
        url.addParameter(Constants.PARAM_FILTER, filter);

        // read
        Response resp = read(url);

        AtomBase base = parse(resp.getStream(), AtomBase.class);

        // get the entry
        AtomEntry entry = null;
        if (base instanceof AtomFeed) {
            AtomFeed feed = (AtomFeed) base;
View Full Code Here

        url.addParameter(Constants.PARAM_RELATIONSHIPS, includeRelationships);
        url.addParameter(Constants.PARAM_RENDITION_FILTER, renditionFilter);
        url.addParameter(Constants.PARAM_PATH_SEGMENT, includePathSegment);

        // read and parse
        Response resp = read(url);
        AtomFeed feed = parse(resp.getStream(), AtomFeed.class);

        // process tree
        addDescendantsLevel(repositoryId, feed, result);

        return result;
View Full Code Here

        url.addParameter(Constants.PARAM_RELATIONSHIPS, includeRelationships);
        url.addParameter(Constants.PARAM_RENDITION_FILTER, renditionFilter);
        url.addParameter(Constants.PARAM_RELATIVE_PATH_SEGMENT, includeRelativePathSegment);

        // read and parse
        Response resp = read(url);

        AtomBase base = parse(resp.getStream(), AtomBase.class);

        if (base instanceof AtomFeed) {
            // it's a feed
            AtomFeed feed = (AtomFeed) base;
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.