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

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


            Node contentNode = getNode().getNode(Node.JCR_CONTENT);
            Property data = contentNode.getProperty(Property.JCR_DATA);

            // check overwrite
            if (!overwriteFlag && data.getLength() != 0) {
                throw new CmisContentAlreadyExistsException("Content already exists!");
            }

            JcrVersionBase jcrVersion = isVersionable()
                    ? asVersion()
                    : null;
View Full Code Here


        }

        // check overwrite
        boolean owf = (overwriteFlag == null ? true : overwriteFlag.booleanValue());
        if (!owf && file.length() > 0) {
            throw new CmisContentAlreadyExistsException("Content already exists!");
        }

        try {
            OutputStream out = new BufferedOutputStream(new FileOutputStream(file), BUFFER_SIZE);
View Full Code Here

        switch (ex.getFaultInfo().getType()) {
        case CONSTRAINT:
            return new CmisConstraintException(msg, code);
        case CONTENT_ALREADY_EXISTS:
            return new CmisContentAlreadyExistsException(msg, code);
        case FILTER_NOT_VALID:
            return new CmisFilterNotValidException(msg, code);
        case INVALID_ARGUMENT:
            return new CmisInvalidArgumentException(msg, code);
        case NAME_CONSTRAINT_VIOLATION:
View Full Code Here

            content = (DocumentVersion) so;
        } else
            throw new IllegalArgumentException("Content cannot be set on this object (must be document or version)");

        if (!overwriteFlag && content.getContent(0, -1) != null)
            throw new CmisContentAlreadyExistsException("cannot overwrite existing content if overwrite flag is not set");

        content.setContent(contentStream, true);
        LOG.debug("stop setContentStream()");
    }
View Full Code Here

        } else {
            throw new IllegalArgumentException("Content cannot be set on this object (must be document or version)");
        }

        if (!overwriteFlag && content.getContent(0, -1) != null) {
            throw new CmisContentAlreadyExistsException("cannot overwrite existing content if overwrite flag is not set");
        }

        content.setContent(contentStream, true);
        LOG.debug("stop setContentStream()");
    }
View Full Code Here

            Node contentNode = getNode().getNode(Node.JCR_CONTENT);
            Property data = contentNode.getProperty(Property.JCR_DATA);

            // check overwrite
            if (!overwriteFlag && data.getLength() != 0) {
                throw new CmisContentAlreadyExistsException("Content already exists!");
            }

            JcrVersionBase jcrVersion = isVersionable()
                    ? asVersion()
                    : null;
View Full Code Here

        }

        // check overwrite
        boolean owf = (overwriteFlag == null ? true : overwriteFlag.booleanValue());
        if (!owf && file.length() > 0) {
            throw new CmisContentAlreadyExistsException("Content already exists!");
        }

        try {
            OutputStream out = new BufferedOutputStream(new FileOutputStream(file), BUFFER_SIZE);
View Full Code Here

        switch (ex.getFaultInfo().getType()) {
        case CONSTRAINT:
            return new CmisConstraintException(msg, code);
        case CONTENT_ALREADY_EXISTS:
            return new CmisContentAlreadyExistsException(msg, code);
        case FILTER_NOT_VALID:
            return new CmisFilterNotValidException(msg, code);
        case INVALID_ARGUMENT:
            return new CmisInvalidArgumentException(msg, code);
        case NAME_CONSTRAINT_VIOLATION:
View Full Code Here

            content = (DocumentVersion) so;
        } else
            throw new IllegalArgumentException("Content cannot be set on this object (must be document or version)");

        if (!overwriteFlag && content.getContent(0, -1) != null)
            throw new CmisContentAlreadyExistsException("cannot overwrite existing content if overwrite flag is not set");

        content.setContent(contentStream, true);
        LOG.debug("stop setContentStream()");
    }
View Full Code Here

        switch (ex.getFaultInfo().getType()) {
        case CONSTRAINT:
            return new CmisConstraintException(msg, code, errorContent);
        case CONTENT_ALREADY_EXISTS:
            return new CmisContentAlreadyExistsException(msg, code, errorContent);
        case FILTER_NOT_VALID:
            return new CmisFilterNotValidException(msg, code, errorContent);
        case INVALID_ARGUMENT:
            return new CmisInvalidArgumentException(msg, code, errorContent);
        case NAME_CONSTRAINT_VIOLATION:
View Full Code Here

TOP

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

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.