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

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


        } else {
            link = loadTypeLink(repositoryId, typeId, Constants.REL_DOWN, Constants.MEDIATYPE_CHILDREN);
        }

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

        UrlBuilder url = new UrlBuilder(link);
        url.addParameter(Constants.PARAM_TYPE_ID, typeId);
        url.addParameter(Constants.PARAM_PROPERTY_DEFINITIONS, includePropertyDefinitions);
View Full Code Here


        } else {
            link = loadTypeLink(repositoryId, typeId, Constants.REL_DOWN, Constants.MEDIATYPE_DESCENDANTS);
        }

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

        UrlBuilder url = new UrlBuilder(link);
        url.addParameter(Constants.PARAM_TYPE_ID, typeId);
        url.addParameter(Constants.PARAM_DEPTH, depth);
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

            Boolean includePolicyIds, Boolean includeACL, ExtensionsData extension) {

        ObjectDataImpl od = new ObjectDataImpl();

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

        // build properties collection
        List<String> requestedIds = FilterParser.getRequestedIdsFromFilter(filter);
        Properties props = getPropertiesFromObject(so, typeDef, requestedIds, true);
View Full Code Here

            if (info.getId().equals(repositoryId)) {
                return info;
            }
        }

        throw new CmisObjectNotFoundException("Repository not found!");
    }
View Full Code Here

                } else if (CmisNameConstraintViolationException.EXCEPTION_NAME.equalsIgnoreCase((String) jsonError)) {
                    return new CmisNameConstraintViolationException(message, errorContent, t);
                } else if (CmisNotSupportedException.EXCEPTION_NAME.equalsIgnoreCase((String) jsonError)) {
                    return new CmisNotSupportedException(message, errorContent, t);
                } else if (CmisObjectNotFoundException.EXCEPTION_NAME.equalsIgnoreCase((String) jsonError)) {
                    return new CmisObjectNotFoundException(message, errorContent, t);
                } else if (CmisPermissionDeniedException.EXCEPTION_NAME.equalsIgnoreCase((String) jsonError)) {
                    return new CmisPermissionDeniedException(message, errorContent, t);
                } else if (CmisStorageException.EXCEPTION_NAME.equalsIgnoreCase((String) jsonError)) {
                    return new CmisStorageException(message, errorContent, t);
                } else if (CmisStreamNotSupportedException.EXCEPTION_NAME.equalsIgnoreCase((String) jsonError)) {
                    return new CmisStreamNotSupportedException(message, errorContent, t);
                } else if (CmisUpdateConflictException.EXCEPTION_NAME.equalsIgnoreCase((String) jsonError)) {
                    return new CmisUpdateConflictException(message, errorContent, t);
                } else if (CmisVersioningException.EXCEPTION_NAME.equalsIgnoreCase((String) jsonError)) {
                    return new CmisVersioningException(message, errorContent, t);
                }
            }
        }

        // fall back to status code
        switch (code) {
        case 400:
            return new CmisInvalidArgumentException(message, errorContent, t);
        case 401:
            return new CmisUnauthorizedException(message, errorContent, t);
        case 403:
            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

    }

    public JcrTypeHandler getTypeHandler(String typeId) {
        JcrTypeHandler typeHandler = typeHandlers.get(typeId);
        if (typeHandler == null) {
            throw new CmisObjectNotFoundException("Type '" + typeId + "' is unknown!");
        }
        return typeHandler;
    }
View Full Code Here

    }

    public JcrFolderTypeHandler getFolderTypeHandler(String typeId) {
        JcrTypeHandler typeHandler = getTypeHandler(typeId);
        if (!(typeHandler instanceof JcrFolderTypeHandler)) {
            throw new CmisObjectNotFoundException("Type '" + typeId + "' is not a folder!");
        }
        return (JcrFolderTypeHandler) typeHandler;
    }
View Full Code Here

    }

    public JcrDocumentTypeHandler getDocumentTypeHandler(String typeId) {
        JcrTypeHandler typeHandler = getTypeHandler(typeId);
        if (!(typeHandler instanceof JcrDocumentTypeHandler)) {
            throw new CmisObjectNotFoundException("Type '" + typeId + "' is not a document!");
        }
        return (JcrDocumentTypeHandler) typeHandler;
    }
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.