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

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


    public AllowableActions getAllowableActions(String repositoryId, String objectId, ExtensionsData extension) {
        // build URL
        UrlBuilder url = getObjectUrl(repositoryId, objectId, Constants.SELECTOR_ALLOWABLEACTIONS);

        // read and parse
        Response resp = read(url);
        Map<String, Object> json = parseObject(resp.getStream(), resp.getCharset());

        return JSONConverter.convertAllowableActions(json);
    }
View Full Code Here


        url.addParameter(Constants.PARAM_POLICY_IDS, includePolicyIds);
        url.addParameter(Constants.PARAM_ACL, includeAcl);
        url.addParameter(Constants.PARAM_SUCCINCT, getSuccinctParameter());

        // read and parse
        Response resp = read(url);
        Map<String, Object> json = parseObject(resp.getStream(), resp.getCharset());

        TypeCache typeCache = new ClientTypeCacheImpl(repositoryId, this);

        return JSONConverter.convertObject(json, typeCache);
    }
View Full Code Here

        url.addParameter(Constants.PARAM_POLICY_IDS, includePolicyIds);
        url.addParameter(Constants.PARAM_ACL, includeAcl);
        url.addParameter(Constants.PARAM_SUCCINCT, getSuccinctParameter());

        // read and parse
        Response resp = read(url);
        Map<String, Object> json = parseObject(resp.getStream(), resp.getCharset());

        TypeCache typeCache = new ClientTypeCacheImpl(repositoryId, this);

        return JSONConverter.convertObject(json, typeCache);
    }
View Full Code Here

        UrlBuilder url = getObjectUrl(repositoryId, objectId, Constants.SELECTOR_PROPERTIES);
        url.addParameter(Constants.PARAM_FILTER, filter);
        url.addParameter(Constants.PARAM_SUCCINCT, getSuccinctParameter());

        // read and parse
        Response resp = read(url);
        Map<String, Object> json = parseObject(resp.getStream(), resp.getCharset());

        if (getSuccinct()) {
            TypeCache typeCache = new ClientTypeCacheImpl(repositoryId, this);
            return JSONConverter.convertSuccinctProperties(json, null, typeCache);
        } else {
View Full Code Here

        url.addParameter(Constants.PARAM_RENDITION_FILTER, renditionFilter);
        url.addParameter(Constants.PARAM_MAX_ITEMS, maxItems);
        url.addParameter(Constants.PARAM_SKIP_COUNT, skipCount);

        // read and parse
        Response resp = read(url);
        List<Object> json = parseArray(resp.getStream(), resp.getCharset());

        return JSONConverter.convertRenditions(json);
    }
View Full Code Here

        // build URL
        UrlBuilder url = getObjectUrl(repositoryId, objectId, Constants.SELECTOR_CONTENT);
        url.addParameter(Constants.PARAM_STREAM_ID, streamId);

        // get the content
        Response resp = getHttpInvoker().invokeGET(url, getSession(), offset, length);

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

        result.setFileName(null);
        result.setLength(resp.getContentLength());
        result.setMimeType(resp.getContentTypeHeader());
        result.setStream(resp.getStream());

        return result;
    }
View Full Code Here

        formData.addPropertiesParameters(properties);
        formData.addParameter(Constants.PARAM_CHANGE_TOKEN, (changeToken == null ? null : changeToken.getValue()));
        formData.addSuccinctFlag(getSuccinct());

        // send and parse
        Response resp = post(url, formData.getContentType(), new Output() {
            public void write(OutputStream out) throws Exception {
                formData.write(out);
            }
        });

        Map<String, Object> json = parseObject(resp.getStream(), resp.getCharset());

        TypeCache typeCache = new ClientTypeCacheImpl(repositoryId, this);

        ObjectData newObj = JSONConverter.convertObject(json, typeCache);
View Full Code Here

        formData.addPropertiesParameters(properties);
        formData.addSecondaryTypeIds(addSecondaryTypeIds);
        formData.removeSecondaryTypeIds(removeSecondaryTypeIds);

        // send and parse
        Response resp = post(url, formData.getContentType(), new Output() {
            public void write(OutputStream out) throws Exception {
                formData.write(out);
            }
        });

        List<Object> json = parseArray(resp.getStream(), resp.getCharset());

        return JSONConverter.convertBulkUpdate(json);
    }
View Full Code Here

        formData.addParameter(Constants.PARAM_TARGET_FOLDER_ID, targetFolderId);
        formData.addParameter(Constants.PARAM_SOURCE_FOLDER_ID, sourceFolderId);
        formData.addSuccinctFlag(getSuccinct());

        // send and parse
        Response resp = post(url, formData.getContentType(), new Output() {
            public void write(OutputStream out) throws Exception {
                formData.write(out);
            }
        });

        Map<String, Object> json = parseObject(resp.getStream(), resp.getCharset());

        TypeCache typeCache = new ClientTypeCacheImpl(repositoryId, this);

        ObjectData newObj = JSONConverter.convertObject(json, typeCache);
View Full Code Here

        formData.addParameter(Constants.PARAM_ALL_VERSIONS, allVersions);
        formData.addParameter(Constants.PARAM_UNFILE_OBJECTS, unfileObjects);
        formData.addParameter(Constants.PARAM_CONTINUE_ON_FAILURE, continueOnFailure);

        // send
        Response resp = post(url, formData.getContentType(), new Output() {
            public void write(OutputStream out) throws Exception {
                formData.write(out);
            }
        });

        if (!BigInteger.ZERO.equals(resp.getContentLength())) {
            Map<String, Object> json = parseObject(resp.getStream(), resp.getCharset());
            return JSONConverter.convertFailedToDelete(json);
        }

        return new FailedToDeleteDataImpl();
    }
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.