Package org.jboss.vfs

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


            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


        // 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 CmpMessages.MESSAGES.failedToParse("jbosscmp-jdbc.xml", e);
            } finally {
View Full Code Here

    private static boolean findRailsPattern(VirtualFile root, String fileName, Pattern pattern) throws IOException {
        boolean retValue = false;
        VirtualFile railsFile = root.getChild( fileName );
        if (railsFile.exists()) {
            BufferedReader brIn = new BufferedReader( new InputStreamReader( railsFile.openStream() ) );
            String line;
            while ((line = brIn.readLine()) != null) {
                if (pattern.matcher( line ).matches()) {
                    retValue = true;
                    break;
View Full Code Here

        if (!file.exists()) {
            return null;
        }
        final long size = file.getSize();
        final ClassSpec spec = new ClassSpec();
        final InputStream is = file.openStream();
        try {
            if (size <= (long) Integer.MAX_VALUE) {
                final int castSize = (int) size;
                byte[] bytes = new byte[castSize];
                int a = 0, res;
View Full Code Here

        final List<String> index = new ArrayList<String>();
        // First check for an index file
        final VirtualFile indexFile = VFS.getChild(root.getPathName() + ".index");
        if (indexFile.exists()) {
            try {
                final BufferedReader r = new BufferedReader(new InputStreamReader(indexFile.openStream()));
                try {
                    String s;
                    while ((s = r.readLine()) != null) {
                        index.add(s.trim());
                    }
View Full Code Here

            }

            VirtualFile indexFile = resourceRoot.getRoot().getChild(ModuleIndexBuilder.INDEX_LOCATION);
            if (indexFile.exists()) {
                try {
                    IndexReader reader = new IndexReader(indexFile.openStream());
                    resourceRoot.putAttachment(Attachments.ANNOTATION_INDEX, reader.read());
                    logger.tracef("Found and read index at: %s", indexFile);
                    continue;
                } catch (Exception e) {
                    logger.debugf("Could not read provided index: %s", indexFile, e);
View Full Code Here

        // get the XMLStreamReader and parse the ejb-jar.xml
        MetaDataElementParser.DTDInfo dtdInfo = new MetaDataElementParser.DTDInfo();
        InputStream stream = null;
        try {
            stream = ejbJarXml.openStream();

            XMLStreamReader reader = this.getXMLStreamReader(stream,ejbJarXml, dtdInfo);

            EjbJarMetaData ejbJarMetaData = EjbJarMetaDataParser.parse(reader, dtdInfo);
                // attach the ejbjar metadata
View Full Code Here

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

        try {
            metadata = OSGiMetaDataBuilder.load(xserviceFile.openStream());
            depUnit.putAttachment(OSGiConstants.OSGI_METADATA_KEY, metadata);
        } catch (IOException ex) {
            throw MESSAGES.cannotParseOSGiMetadata(ex, xserviceFile);
        }
    }
View Full Code Here

        if (!file.exists()) {
            return null;
        }
        final long size = file.getSize();
        final ClassSpec spec = new ClassSpec();
        final InputStream is = file.openStream();
        try {
            if (size <= (long) Integer.MAX_VALUE) {
                final int castSize = (int) size;
                byte[] bytes = new byte[castSize];
                int a = 0, res;
View Full Code Here

        final List<String> index = new ArrayList<String>();
        // First check for an index file
        final VirtualFile indexFile = VFS.getChild(root.getPathName() + ".index");
        if (indexFile.exists()) {
            try {
                final BufferedReader r = new BufferedReader(new InputStreamReader(indexFile.openStream()));
                try {
                    String s;
                    while ((s = r.readLine()) != null) {
                        index.add(s.trim());
                    }
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.