Package org.apache.chemistry.opencmis.commons.exceptions

Examples of org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException


        LOG.debug("start deleteContentStream()");
        StoredObject so = validator.deleteContentStream(context, repositoryId, objectId, extension);

        if (so == null) {
            throw new CmisObjectNotFoundException("Unknown object id: " + objectId);
        }

        if (!(so instanceof Content)) {
            throw new CmisObjectNotFoundException("Id" + objectId
                    + " does not refer to a document, but only documents can have content");
        }

        ((Content) so).setContent(null, true);
        LOG.debug("stop deleteContentStream()");
View Full Code Here


        StoredObject so = validator.getAllowableActions(context, repositoryId, objectId, extension);

        fStoreManager.getObjectStore(repositoryId);

        if (so == null) {
            throw new CmisObjectNotFoundException("Unknown object id: " + objectId);
        }

        String user = context.getUsername();
//      AllowableActions allowableActions = DataObjectCreator.fillAllowableActions(so, user);
        AllowableActions allowableActions = so.getAllowableActions(user);
View Full Code Here

        ObjectStore fs = fStoreManager.getObjectStore(repositoryId);
        StoredObject so = fs.getObjectById(folderId);
        Folder folder = null;

        if (so == null) {
            throw new CmisObjectNotFoundException("Unknown object id: " + folderId);
        }

        if (so instanceof Folder) {
            folder = (Folder) so;
        }
View Full Code Here

    protected void throwLinkException(String repositoryId, String id, String rel, String type) {
        int index = getLinkCache().checkLink(repositoryId, id, rel, type);

        switch (index) {
        case 0:
            throw new CmisObjectNotFoundException("Unknown repository!");
        case 1:
            throw new CmisObjectNotFoundException("Unknown object!");
        case 2:
            throw new CmisNotSupportedException("Operation not supported by the repository for this object!");
        case 3:
            throw new CmisNotSupportedException("No link with matching media type!");
        case 4:
View Full Code Here

            if (CmisStreamNotSupportedException.EXCEPTION_NAME.equals(exception)) {
                return new CmisStreamNotSupportedException(message, errorContent, t);
            }
            return new CmisPermissionDeniedException(message, errorContent, t);
        case 404:
            return new CmisObjectNotFoundException(message, errorContent, t);
        case 405:
            return new CmisNotSupportedException(message, errorContent, t);
        case 407:
            return new CmisProxyAuthenticationException(message, errorContent, t);
        case 409:
View Full Code Here

        parameters.put(Constants.PARAM_RENDITION_FILTER, renditionFilter);

        String link = loadTemplateLink(repositoryId, (idOrPath == IdentifierType.ID ? Constants.TEMPLATE_OBJECT_BY_ID
                : Constants.TEMPLATE_OBJECT_BY_PATH), parameters);
        if (link == null) {
            throw new CmisObjectNotFoundException("Unknown repository!");
        }

        UrlBuilder url = new UrlBuilder(link);
        // workaround for missing template parameter in the CMIS spec
        if (returnVersion != null && returnVersion != ReturnVersion.THIS) {
View Full Code Here

        Map<String, Object> parameters = new HashMap<String, Object>();
        parameters.put(Constants.PARAM_ID, typeId);

        String link = loadTemplateLink(repositoryId, Constants.TEMPLATE_TYPE_BY_ID, parameters);
        if (link == null) {
            throw new CmisObjectNotFoundException("Unknown repository!");
        }

        // read and parse
        HttpUtils.Response resp = read(new UrlBuilder(link));
        AtomEntry entry = parse(resp.getStream(), AtomEntry.class);
View Full Code Here

        ObjectStore fs = fStoreManager.getObjectStore(repositoryId);
        StoredObject so = fs.getObjectById(folderId);
        Folder folder = null;

        if (so == null) {
            throw new CmisObjectNotFoundException("Unknown object id: " + folderId);
        }

        if (so instanceof Folder) {
            folder = (Folder) so;
        }
View Full Code Here

    protected void throwLinkException(String repositoryId, String id, String rel, String type) {
        int index = getLinkCache().checkLink(repositoryId, id, rel, type);

        switch (index) {
        case 0:
            throw new CmisObjectNotFoundException("Unknown repository!");
        case 1:
            throw new CmisObjectNotFoundException("Unknown object!");
        case 2:
            throw new CmisNotSupportedException("Operation not supported by the repository for this object!");
        case 3:
            throw new CmisNotSupportedException("No link with matching media type!");
        case 4:
View Full Code Here

            if (CmisStreamNotSupportedException.EXCEPTION_NAME.equals(exception)) {
                return new CmisStreamNotSupportedException(message, errorContent, t);
            }
            return new CmisPermissionDeniedException(message, errorContent, t);
        case 404:
            return new CmisObjectNotFoundException(message, errorContent, t);
        case 405:
            return new CmisNotSupportedException(message, errorContent, t);
        case 407:
            return new CmisProxyAuthenticationException(message, errorContent, t);
        case 409:
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException

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.