Package org.springframework.core.io

Examples of org.springframework.core.io.FileSystemResource


                plugins.add(new Plugin(symbolicName, version, resource, isExploded));
        }
    }

    private Resource getJARPluginResource(Plugin aPlugin) throws IOException {
        return new FileSystemResource(aPlugin.getPath().getFile());
    }
View Full Code Here


            cpr = new UrlResource(url);
            if (cpr.exists()) {
                return cpr;
            }
        }
        cpr = new FileSystemResource(cfgFile);
        if (cpr.exists()) {
            return cpr;
        }
        return null;
    }
View Full Code Here

        Set<Resource> eclipseProjects = new HashSet<Resource>();

        // Scan plugins exploded as unpacked JAR directories
        for (File projectFolder : folder.listFiles(m_DirectoryFilter)) {
            eclipseProjects.add(new FileSystemResource(projectFolder));
        }

        for (Resource resource : eclipseProjects) {
            Manifest man = getManifestFromProject(resource);
            if (man != null) {
                addPlugin(plugins, resource, man, true);
            } else {
                // this is not a project folder, so descend to find potential nested modules
                List<String> list = Arrays.asList( ((FileSystemResource)resource).getFile().list() );
                for ( String str : list ) {
                    // do not process eclipse proejcts at the moment
                    if ( str.contains( "drools-eclipse" ) ||  str.contains( "osgi-bundles" ) ) {
                        list = null;
                    }
                }
                if ( list != null && list.contains("pom.xml")) {
                    importPluginFromFolder(((FileSystemResource)resource).getFile(), plugins);
                }
            }
        }

        Set<Resource> packagedBundles = new HashSet<Resource>();

        // Scan plugins provided as JAR files
        for (File jarFile : folder.listFiles(m_JARFileFilter))
            packagedBundles.add(new FileSystemResource(jarFile));

        for (Resource resource : packagedBundles) {
            Manifest man = getManifestFromJAR(resource);
            if (man != null)
                addPlugin(plugins, resource, man, false);
View Full Code Here

                plugins.add(new Plugin(symbolicName, version, resource, isExploded));
        }
    }

    private Resource getJARPluginResource(Plugin aPlugin) throws IOException {
        return new FileSystemResource(aPlugin.getPath().getFile());
    }
View Full Code Here

            reader.loadBeanDefinitions(new UrlResource(url));
        }
       
        for (String pathname : additionalFilePathnames) {
            try {
                reader.loadBeanDefinitions(new FileSystemResource(pathname));
            } catch (BeanDefinitionStoreException bdse) {
                throw new ToolException("Unable to open bean definition file " + pathname, bdse.getCause());
            }
        }
        appContext.refresh();
View Full Code Here

                                                                                    // derby
                                                                                    // name
        recursiveDelete(derbyFile);

        BrokerService broker;
        broker = createBroker(new FileSystemResource(CONF_ROOT + "journaledjdbc-example.xml"));
        try {
            assertEquals("Broker Config Error (brokerName)", "brokerJournaledJDBCConfigTest", broker.getBrokerName());

            PersistenceAdapter adapter = broker.getPersistenceAdapter();
View Full Code Here

                                                                            // derby
                                                                            // name
        recursiveDelete(derbyFile);

        BrokerService broker;
        broker = createBroker(new FileSystemResource(CONF_ROOT + "jdbc-example.xml"));
        try {
            assertEquals("Broker Config Error (brokerName)", "brokerJdbcConfigTest", broker.getBrokerName());

            PersistenceAdapter adapter = broker.getPersistenceAdapter();
View Full Code Here

        File journalFile = new File(JOURNAL_ROOT + "testJournalConfig/journal");
        recursiveDelete(journalFile);

        BrokerService broker;
        broker = createBroker(new FileSystemResource(CONF_ROOT + "journal-example.xml"));
        try {
            assertEquals("Broker Config Error (brokerName)", "brokerJournalConfigTest", broker.getBrokerName());

            PersistenceAdapter adapter = broker.getPersistenceAdapter();
View Full Code Here

        File derbyFile = new File(DERBY_ROOT + "testMemoryConfig");
        recursiveDelete(derbyFile);

        BrokerService broker;
        broker = createBroker(new FileSystemResource(CONF_ROOT + "memory-example.xml"));

        try {
            assertEquals("Broker Config Error (brokerName)", "brokerMemoryConfigTest", broker.getBrokerName());

            PersistenceAdapter adapter = broker.getPersistenceAdapter();
View Full Code Here

    }

    public void testXmlConfigHelper() throws Exception {
        BrokerService broker;

        broker = createBroker(new FileSystemResource(CONF_ROOT + "memory-example.xml"));
        try {
            assertEquals("Broker Config Error (brokerName)", "brokerMemoryConfigTest", broker.getBrokerName());
        } finally {
            if (broker != null) {
                broker.stop();
View Full Code Here

TOP

Related Classes of org.springframework.core.io.FileSystemResource

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.