Package org.springframework.core.io

Examples of org.springframework.core.io.FileSystemResource


       
        try {
            List<Resource> resources = new ArrayList<Resource>();
            for (File file : getDistributionBundles()) {
                if (!frameworkBundleNames.contains(file.getName())) {
                    resources.add(new FileSystemResource(file));
                }
            }
           
            resources.addAll(Arrays.asList(super.getTestBundles()));
            return resources.toArray(new Resource[resources.size()]);
View Full Code Here


       
        try {
            List<Resource> resources = new ArrayList<Resource>();
            for (File file : getDistributionBundles()) {
                if (!frameworkBundleNames.contains(file.getName())) {
                    resources.add(new FileSystemResource(file));
                }
            }
           
            resources.addAll(Arrays.asList(super.getTestBundles()));
            return resources.toArray(new Resource[resources.size()]);
View Full Code Here

*
*/
public class SpringConfigTest extends TestCase {

    public void test() throws Throwable {
        XmlBeanFactory factory = new XmlBeanFactory(new FileSystemResource(
                "src/test/resources/spring-config/config-spring-1.xml"));

        DefaultFtpServer server = (DefaultFtpServer) factory.getBean("server");

        assertEquals(500, server.getConnectionConfig().getMaxLogins());
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

        recursiveDelete(derbyFile);

        final int MAX_PRODUCERS = 5;
        final int MAX_CONSUMERS = 10;

        BrokerService broker = createBroker(new FileSystemResource(CONF_ROOT + "connector-properties.xml"));
        broker.start();
        try {

            assertEquals(broker.getTransportConnectorByScheme("tcp").getMaximumProducersAllowedPerConnection(), MAX_PRODUCERS);
            assertEquals(broker.getTransportConnectorByScheme("tcp").getMaximumConsumersAllowedPerConnection(), MAX_CONSUMERS);
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

        LOG.debug("Now attempting to figure out the type of resource: " + uri);

        Resource resource;
        File file = new File(uri);
        if (file.exists()) {
            resource = new FileSystemResource(uri);
        } else if (ResourceUtils.isUrl(uri)) {
            resource = new UrlResource(uri);
        } else {
            resource = new ClassPathResource(uri);
        }
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.