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

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


        }
        else if ("false".equalsIgnoreCase(s)) {
            return evaluator.value(false);
        }
        else {
            throw new CmisInvalidArgumentException("Not a boolean: " + s);
        }
    }
View Full Code Here


            return s.contains(".") || s.contains("e") || s.contains("E")
                    ? evaluator.value(Double.valueOf(s))
                    : evaluator.value(Long.valueOf(s));
        }
        catch (NumberFormatException e) {
            throw new CmisInvalidArgumentException("Not a number: " + s);
        }
    }
View Full Code Here

        s = s.substring(s.indexOf('\'') + 1, s.length() - 1);
        try {
            return evaluator.value(CalendarHelper.fromString(s));
        }
        catch (IllegalArgumentException e) {
            throw new CmisInvalidArgumentException("Not a date time value: " + s);
        }
    }
View Full Code Here

     */
    public String create(String repositoryId, Properties properties, String folderId, ContentStream contentStream,
            VersioningState versioningState, List<String> policies, ExtensionsData extension) {
        // check properties
        if (properties == null || properties.getProperties() == null) {
            throw new CmisInvalidArgumentException("Properties must be set!");
        }

        // check object type id
        PropertyData<?> obbjectTypeIdProperty = properties.getProperties().get(PropertyIds.OBJECT_TYPE_ID);
        if (obbjectTypeIdProperty == null || !(obbjectTypeIdProperty.getFirstValue() instanceof String)) {
            throw new CmisInvalidArgumentException("Property '" + PropertyIds.OBJECT_TYPE_ID + "' must be set!");
        }

        // get the type
        String objectTypeId = obbjectTypeIdProperty.getFirstValue().toString();
        TypeDefinition type = getTypeDefinition(repositoryId, objectTypeId, null);
View Full Code Here

        for (XPathBuilder p : parseResult.folderPredicates()) {
            if (folderPredicate == null) {
                folderPredicate = p.xPath();
            }
            else {
                throw new CmisInvalidArgumentException("Query may only contain a single folder predicate");
            }
        }

        // See the class comment on XPathBuilder for details on affirmative literals
        if (folderPredicate != null &&                             // IF has single folder predicate
            !Boolean.FALSE.equals(parseResult.eval(false))) {      // AND folder predicate is not affirmative
            throw new CmisInvalidArgumentException("Folder predicate " + folderPredicate + " is not affirmative.");
        }

        return folderPredicate;
    }
View Full Code Here

        return folderPredicate;
    }

    private static TypeDefinition getFromName(QueryObject queryObject) {
        if (queryObject.getTypes().size() != 1) {
            throw new CmisInvalidArgumentException("From must contain one single reference");
        }
        return queryObject.getMainFromName();
    }
View Full Code Here

        List<TypeDefinitionContainer> result = new ArrayList<TypeDefinitionContainer>();

        // check depth
        int d = (depth == null ? -1 : depth.intValue());
        if (d == 0) {
            throw new CmisInvalidArgumentException("Depth must not be 0!");
        }

        // set property definition flag to default value if not set
        boolean ipd = (includePropertyDefinitions == null ? false : includePropertyDefinitions.booleanValue());
View Full Code Here

        debug("createDocument");
        checkUser(context, true);

        // check properties
        if ((properties == null) || (properties.getProperties() == null)) {
            throw new CmisInvalidArgumentException("Properties must be set!");
        }

        // check versioning state
        if (VersioningState.NONE != versioningState) {
            throw new CmisConstraintException("Versioning not supported!");
View Full Code Here

        debug("createFolder");
        checkUser(context, true);

        // check properties
        if ((properties == null) || (properties.getProperties() == null)) {
            throw new CmisInvalidArgumentException("Properties must be set!");
        }

        // check type
        String typeId = getTypeId(properties);
        TypeDefinition type = types.getType(typeId);
View Full Code Here

            ObjectInfoHandler objectInfos) {
        debug("moveObject");
        boolean userReadOnly = checkUser(context, true);

        if (objectId == null) {
            throw new CmisInvalidArgumentException("Id is not valid!");
        }

        // get the file and parent
        File file = getFile(objectId.getValue());
        File parent = getFile(targetFolderId);
View Full Code Here

TOP

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

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.