Package org.jboss.vfs

Examples of org.jboss.vfs.VirtualFile.openStream()


            descriptor = deploymentRoot.getRoot().getChild(APP_XML);
        }
        if (descriptor.exists()) {
            InputStream is = null;
            try {
                is = descriptor.openStream();
                ApplicationClientMetaData data = new ApplicationClientMetaDataParser().parse(getXMLStreamReader(is), propertyReplacer);
                return data;
            } catch (XMLStreamException e) {
                throw MESSAGES.failedToParseXml(e, descriptor, e.getLocation().getLineNumber(), e.getLocation().getColumnNumber());
            } catch (IOException e) {
View Full Code Here


        final VirtualFile deploymentRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT).getRoot();
        final VirtualFile appXml = deploymentRoot.getChild(JBOSS_CLIENT_XML);
        if (appXml.exists()) {
            InputStream is = null;
            try {
                is = appXml.openStream();
                JBossClientMetaData data = new JBossClientMetaDataParser().parse(getXMLStreamReader(is), propertyReplacer);
                return data;
            } catch (XMLStreamException e) {
                throw MESSAGES.failedToParseXml(e, appXml, e.getLocation().getLineNumber(), e.getLocation().getColumnNumber());
View Full Code Here

            return;

        InputStream xmlStream = null;
        IronJacamar result = null;
        try {
            xmlStream = serviceXmlFile.openStream();
            IronJacamarParser ironJacamarParser = new IronJacamarParser();
            ironJacamarParser.setSystemPropertiesResolved(resolveProperties);
            result = ironJacamarParser.parse(xmlStream);
            if (result != null) {
                IronJacamarXmlDescriptor xmlDescriptor = new IronJacamarXmlDescriptor(result);
View Full Code Here

        // Locate the descriptor
        final VirtualFile descriptor = deploymentRoot.getChild("META-INF/jbosscmp-jdbc.xml");
        JDBCApplicationMetaData deploymentJdbcApplicationMetaData = null;
        if (descriptor != null && descriptor.exists()) {
            try {
                inputStream = descriptor.openStream();
                xmlReader = inputFactory.createXMLStreamReader(inputStream);
                jdbcMetaData = JDBCMetaDataParser.parse(xmlReader, jdbcMetaData);
            } catch (Exception e) {
                throw new DeploymentUnitProcessingException("Failed to parse jbosscmp-jdbc.xml: " + descriptor.getPathName(), e);
            } finally {
View Full Code Here

        InputStream xmlStream = null;
        Connector result = null;
        try {
            if (serviceXmlFile != null && serviceXmlFile.exists()) {

                xmlStream = serviceXmlFile.openStream();
                RaParser raParser = new RaParser();
                raParser.setSystemPropertiesResolved(resolveProperties);
                result = raParser.parse(xmlStream);
                if (result == null)
                    throw MESSAGES.failedToParseServiceXml(serviceXmlFile);
View Full Code Here

        final WarMetaData warMetaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY);
        assert warMetaData != null;
        if (webXml.exists()) {
            InputStream is = null;
            try {
                is = webXml.openStream();
                final XMLInputFactory inputFactory = XMLInputFactory.newInstance();

                MetaDataElementParser.DTDInfo dtdInfo = new MetaDataElementParser.DTDInfo();
                inputFactory.setXMLResolver(dtdInfo);
                final XMLStreamReader xmlReader = inputFactory.createXMLStreamReader(is);
View Full Code Here

                WebMetaData webMetaData = WebMetaDataParser.parse(xmlReader, dtdInfo, SpecDescriptorPropertyReplacement.propertyReplacer(deploymentUnit));

                if (schemaValidation && webMetaData.getSchemaLocation() != null) {
                    XMLSchemaValidator validator = new XMLSchemaValidator(new XMLResourceResolver());
                    InputStream xmlInput = webXml.openStream();
                    try {
                        if (webMetaData.is23())
                            validator.validate("-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN", xmlInput);
                        else if(webMetaData.is24())
                            validator.validate("http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd", xmlInput);
View Full Code Here

        WarMetaData warMetaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY);
        assert warMetaData != null;
        if (jbossWebXml.exists()) {
            InputStream is = null;
            try {
                is = jbossWebXml.openStream();
                final XMLInputFactory inputFactory = XMLInputFactory.newInstance();
                inputFactory.setXMLResolver(NoopXMLResolver.create());
                XMLStreamReader xmlReader = inputFactory.createXMLStreamReader(is);

                final JBossWebMetaData jBossWebMetaData = JBossWebMetaDataParser.parse(xmlReader, JBossDescriptorPropertyReplacement.propertyReplacer(deploymentUnit));
View Full Code Here

            if (resourceRoot.getRoot().getName().toLowerCase(Locale.ENGLISH).endsWith(".jar")) {
                VirtualFile webFragment = resourceRoot.getRoot().getChild(WEB_FRAGMENT_XML);
                if (webFragment.exists() && webFragment.isFile()) {
                    InputStream is = null;
                    try {
                        is = webFragment.openStream();
                        final XMLInputFactory inputFactory = XMLInputFactory.newInstance();
                        inputFactory.setXMLResolver(NoopXMLResolver.create());
                        XMLStreamReader xmlReader = inputFactory.createXMLStreamReader(is);

                        webFragments.put(resourceRoot.getRootName(), WebFragmentMetaDataParser.parse(xmlReader, SpecDescriptorPropertyReplacement.propertyReplacer(deploymentUnit)));
View Full Code Here

                classURI = new URI(annotatedClassName.replace('.', '/'));
            } catch (final URISyntaxException ignore) {}
            final String handlerChaingConfigFileResourcePath = classURI.resolve(handlerChainConfigFile).toString();
            final VirtualFile config = resourceRoot.getRoot().getChild(handlerChaingConfigFileResourcePath);
            if (config.exists() && config.isFile()) {
                return config.openStream();
            }

            throw MESSAGES.missingHandlerChainConfigFile(handlerChaingConfigFileResourcePath, resourceRoot);
        }
    }
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.