Examples of BinaryContentInput


Examples of com.volantis.shared.content.BinaryContentInput

            reader = new JiBXReader(Class.forName(
                "com.volantis.mcs.policies.impl.variants.layout.LayoutContentBuilderImpl"));
        } catch (ClassNotFoundException e) {
            throw new ExtendedIOException(e);
        }
        final BinaryContentInput content = new BinaryContentInput(inputStream);
        ContentBuilder contentBuilder = null;
        try {
            contentBuilder =
                (ContentBuilder) reader.read(content, file.getName());
        } catch (ArrayIndexOutOfBoundsException e) {
View Full Code Here

Examples of com.volantis.shared.content.BinaryContentInput

        try {
            IFile file = (IFile) policyResource;

            // Read the model using JiBX
            is = file.getContents();
            ContentInput content = new BinaryContentInput(is);
            InternalPolicyFactory policyFactory =
                    InternalPolicyFactory.getInternalInstance();

            // Don't use schema validation, as we may have a partial layout,
            // with missing attributes and empty formats.
View Full Code Here

Examples of com.volantis.shared.content.BinaryContentInput

            final IFile file = (IFile) policyResource;

            // Read the model using JiBX
            is = file.getContents();
            final ContentInput content =
                new BinaryContentInput(is);
            final InternalPolicyFactory policyFactory =
                    InternalPolicyFactory.getInternalInstance();

            // Don't use schema validation, as we may have a partial layout,
            // with missing attributes and empty formats.
View Full Code Here

Examples of com.volantis.shared.content.BinaryContentInput

    }

    protected Object byteArrayToObject(JiBXReader reader, byte[] buffer)
            throws IOException {
        ByteArrayInputStream bais = new ByteArrayInputStream(buffer);
        return reader.read(new BinaryContentInput(bais), "internal");
    }
View Full Code Here

Examples of com.volantis.shared.content.BinaryContentInput

            final ZipArchive archive = new ZipArchive(zipFileName);
            final InputStream stream = archive.getInputFrom(
                DeviceRepositoryConstants.IDENTIFICATION_XML);
            Object object = null;
            if (stream != null) {
                final BinaryContentInput content =
                    new BinaryContentInput(stream);
                final JiBXReader jibxReader =
                    new JiBXReader(Identification.class, null);
                object = jibxReader.read(content,
                    DeviceRepositoryConstants.IDENTIFICATION_XML);
            }
View Full Code Here

Examples of com.volantis.shared.content.BinaryContentInput

    public RuntimeProjectConfiguration readProject(
            InputStream stream, final String url)
            throws IOException {

        RuntimeProjectConfiguration readObject = (RuntimeProjectConfiguration)
                jibxReader.read(new BinaryContentInput(stream), url);

        return readObject;
    }
View Full Code Here

Examples of com.volantis.shared.content.BinaryContentInput

                // Do validation of the output.

                CachingOutputStream cachedOutput =
                        ((CachingOutputStream) actualOutput);
                InputStream reader = cachedOutput.getCacheInputStream();
                ContentInput content = new BinaryContentInput(reader);

                try {
                    outputSchemaValidator.validate(content);
                } catch (SAXException e) {
                    if (inputError) {
View Full Code Here

Examples of com.volantis.shared.content.BinaryContentInput

            // sorted out validation.
            JiBXReader reader = factory.createDangerousNonValidatingPolicyReader();
            if (resource instanceof IFile && resource.exists()) {
                IFile file = (IFile) resource;
                is = file.getContents();
                BinaryContentInput content = new BinaryContentInput(is);
                Object theme = reader.read(content, file.getName());

                InteractionFactory interactionFactory =
                        InteractionFactory.getDefaultInstance();
                InteractionModel interactionModel = interactionFactory
View Full Code Here

Examples of com.volantis.shared.content.BinaryContentInput

    }

    public void testSchema() throws SAXException, IOException {
        final SchemaValidator validator = new SchemaValidator();
        validator.addSchemata(XDIMESchemata.ALL_XDIME2_SCHEMATA);
        validator.validate(new BinaryContentInput(
            getClass().getResourceAsStream("res/script-test.xml")));
        try {
            validator.validate(new BinaryContentInput(
                getClass().getResourceAsStream("res/invalid-script-test.xml")));
            fail("should fail with exception");
        } catch (SAXException e) {
            // expected
        }
View Full Code Here

Examples of com.volantis.shared.content.BinaryContentInput

     * that is relative to the class.
     *
     * @return The {@link ContentInput} instance.
     */
    private ContentInput getClassRelativeResourceAsContent() {
        return new BinaryContentInput(testClass.getResourceAsStream(resource));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.