Package org.fcrepo.server.errors

Examples of org.fcrepo.server.errors.ValidationException


            // the datastream
            // matches the one that is passed in.
            if (checksum != null) {
                String check = newds.getChecksum();
                if (!checksum.equals(check)) {
                    throw new ValidationException("Checksum Mismatch: " + check);
                }
            }

            // Update audit trail
            addAuditRecord(context,
View Full Code Here


                             String kind,
                             int maxLen,
                             char[] badChars) throws ValidationException {
        if (string != null) {
            if (string.length() > maxLen) {
                throw new ValidationException(kind + " is too long. Maximum "
                                              + "length is " + maxLen + " characters.");
            } else if (badChars != null) {
                for (char c : badChars) {
                    if (string.indexOf(c) != -1) {
                        throw new ValidationException(kind + " contains a "
                                                      + "'" + c + "', but that character is not "
                                                      + "allowed.");
                    }
                }
            }
View Full Code Here

            m_descriptionCount = 0;
            m_withinDescription = false;
            m_depth = 0;
            m_doURI = pid.toURI();
            if (!dsId.equals(RELS_EXT) && !dsId.equals(RELS_INT)) {
                throw new ValidationException("Relationships datastream ID must be RELS-EXT or RELS-INT ("
                        + dsId + ")");
            }
            m_dsId = dsId;
            m_parser.parse(content, this);
        } catch (Exception e) {
            throw new ValidationException(dsId + " validation failed: "
                    + e.getMessage(), e);
        }
    }
View Full Code Here

TOP

Related Classes of org.fcrepo.server.errors.ValidationException

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.