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));
                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));
                return data;
            } catch (XMLStreamException e) {
                throw MESSAGES.failedToParseXml(e, appXml, e.getLocation().getLineNumber(), e.getLocation().getColumnNumber());
View Full Code Here

        if(serviceXmlFile == null || !serviceXmlFile.exists())
            return;

        InputStream xmlStream = null;
        try {
            xmlStream = serviceXmlFile.openStream();
            final XMLStreamReader reader = inputFactory.createXMLStreamReader(xmlStream);
            final ParseResult<JBossServiceXmlDescriptor> result = new ParseResult<JBossServiceXmlDescriptor>();
            xmlMapper.parseDocument(result, reader);
            final JBossServiceXmlDescriptor xmlDescriptor = result.getResult();
            if(xmlDescriptor != null)
View Full Code Here

        if (vf == null) {
            throw ManagedDMRContentMessages.MESSAGES.noContentFoundWithHash(HashUtil.bytesToHexString(initialHash));
        }
        InputStream is = null;
        try {
            is = vf.openStream();
            ModelNode node = ModelNode.fromStream(is);
            if (node.isDefined()) {
                for (Property prop : node.asPropertyList()) {
                    ModelNode value = prop.getValue();
                    byte[] hash = hashContent(value);
View Full Code Here

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

                xmlStream = serviceXmlFile.openStream();
                result = (new RaParser()).parse(xmlStream);
                if (result == null)
                    throw MESSAGES.failedToParseServiceXml(serviceXmlFile);
            }
            File root = file.getPhysicalFile();
View Full Code Here

            return;

        InputStream xmlStream = null;
        IronJacamar result = null;
        try {
            xmlStream = serviceXmlFile.openStream();
            result = (new IronJacamarParser()).parse(xmlStream);
            if (result != null) {
                IronJacamarXmlDescriptor xmlDescriptor = new IronJacamarXmlDescriptor(result);
                phaseContext.getDeploymentUnit().putAttachment(IronJacamarXmlDescriptor.ATTACHMENT_KEY, xmlDescriptor);
            } else
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);
                warMetaData.setJbossWebMetaData(jBossWebMetaData);
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

                final XMLStreamReader xmlReader = inputFactory.createXMLStreamReader(is);
                WebMetaData webMetaData = WebMetaDataParser.parse(xmlReader, dtdInfo);

                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

        VirtualFile xserviceFile = virtualFile.getChild(XSERVICE_PROPERTIES_NAME);
        if (xserviceFile.exists() == false)
            return;

        try {
            metadata = OSGiMetaDataBuilder.load(xserviceFile.openStream());
            OSGiMetaDataAttachment.attachOSGiMetaData(deploymentUnit, metadata);
        } catch (IOException ex) {
            throw new DeploymentUnitProcessingException(MESSAGES.cannotParse(xserviceFile));
        }
    }
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.