Package org.fcrepo.client.utility.validate

Examples of org.fcrepo.client.utility.validate.InvalidContentModelException


            }

            DatastreamInfo dsInfo =
                    object.getDatastreamInfo(DS_COMPOSITE_MODEL);
            if (dsInfo == null) {
                throw new InvalidContentModelException(pid,
                                                       "Content model has no '"
                                                               + DS_COMPOSITE_MODEL
                                                               + "' datastream.");
            }

            if (!DS_COMPOSITE_MODEL_FORMAT.equals(dsInfo.getFormatUri())) {
                throw new InvalidContentModelException(pid, "Datastream '"
                        + DS_COMPOSITE_MODEL + "' has incorrect format URI: '"
                        + dsInfo.getFormatUri() + "'.");
            }

            MIMETypedStream ds =
View Full Code Here


                    DocumentBuilderFactory.newInstance();
            factory.setNamespaceAware(true);
            DocumentBuilder builder = factory.newDocumentBuilder();
            return builder.parse(new ByteArrayInputStream(bytes));
        } catch (ParserConfigurationException e) {
            throw new InvalidContentModelException(pid, "Failed to parse "
                    + DS_COMPOSITE_MODEL, e);
        } catch (SAXException e) {
            throw new InvalidContentModelException(pid, "Failed to parse "
                    + DS_COMPOSITE_MODEL, e);
        } catch (IOException e) {
            throw new InvalidContentModelException(pid, "Failed to parse "
                    + DS_COMPOSITE_MODEL, e);
        }
    }
View Full Code Here

        public DsTypeModel(String pid, Element typeModelElement)
                throws InvalidContentModelException {
            id = typeModelElement.getAttribute(ATTRIBUTE_ID);
            if (id.length() == 0) {
                throw new InvalidContentModelException(pid, "<"
                        + ELEMENT_DS_TYPE_MODEL + "> has no '" + ATTRIBUTE_ID
                        + "'");
            }

            NodeList formNodes =
View Full Code Here

    /**
     * If we throw an {@link InvalidContentModelException}, it will look like
     * this.
     */
    public InvalidContentModelException createInvalidContentModelException(String pid) {
        return new InvalidContentModelException(pid, "forced exception on "
                + "content model");
    }
View Full Code Here

     * Convenience method: create a notation saying that the content model is
     * invalid.
     */
    private ValidationResultNotation noteInvalidContentModel(ContentModelInfo model) {
        String pid = model.getPid();
        InvalidContentModelException e =
                objectSource.createInvalidContentModelException(pid);
        return ValidationResultNotation.contentModelNotValid(e);
    }
View Full Code Here

TOP

Related Classes of org.fcrepo.client.utility.validate.InvalidContentModelException

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.