Package org.springframework.core.io

Examples of org.springframework.core.io.FileSystemResource


   *
   * @param pathname
   *          path of the file to create a TextWordList from
   */
  public TreeWordList(String pathname) throws IOException {
    this(new FileSystemResource(pathname));
  }
View Full Code Here


public class SaxUtilsTest {

    @Test
    public void testGetSystemId() throws Exception {
        Resource resource = new FileSystemResource("/path with spaces/file with spaces.txt");
        String systemId = SaxUtils.getSystemId(resource);
        Assert.assertNotNull("No systemId returned", systemId);
        Assert.assertTrue("Invalid system id", systemId.endsWith("path%20with%20spaces/file%20with%20spaces.txt"));
    }
View Full Code Here

    Map<String, Object> variables = new HashMap<String, Object>();
    variables.put("payload", order.getItems().get(0));
    variables.put("timeToPrepare", 1L);

    Object obj = executor.executeScript(
        new ResourceScriptSource(new FileSystemResource("scripts/ruby/barista.rb")), variables);
    assertNotNull(obj);
    assertTrue(obj instanceof Drink);

  }
View Full Code Here

    Map<String, Object> variables = new HashMap<String, Object>();
    variables.put("payload", order.getItems().get(0));
    variables.put("timeToPrepare", "1");

    Object obj = executor.executeScript(new ResourceScriptSource(
        new FileSystemResource("scripts/python/barista.py")), variables);
    assertNotNull(obj);
    assertTrue(obj instanceof Drink);

  }
View Full Code Here

    });
    this.server.setPort(this.port);
    this.server.setKeyPairProvider(new SimpleGeneratorHostKeyProvider("hostkey.ser"));
    this.server.setSubsystemFactories(Collections.<NamedFactory<Command>>singletonList(new SftpSubsystem.Factory()));
    final String virtualDir = new FileSystemResource("").getFile().getAbsolutePath();
    this.server.setFileSystemFactory(new NativeFileSystemFactory() {

      @Override
      public FileSystemView createFileSystemView(org.apache.sshd.common.Session session) {
        return new NativeFileSystemView(session.getUsername(), false) {
View Full Code Here

                "file:src/main/webapp/WEB-INF/deployerConfigContext.xml",
        "file:src/main/webapp/WEB-INF/spring-configuration/*.xml"});
        applicationContext.setServletContext(new MockServletContext(new ResourceLoader() {
            @Override
            public Resource getResource(final String location) {
                return new FileSystemResource("src/main/webapp" + location);
            }

            @Override
            public ClassLoader getClassLoader() {
                return getClassLoader();
View Full Code Here

    }

    if (homeDir == null) {
      if (log.isDebugEnabled())
        log.debug("no repository home dir specified, using the default one:" + DEFAULT_REP_DIR);
      homeDir = new FileSystemResource(DEFAULT_REP_DIR);
    }

    repositoryConfig = RepositoryConfig.create(new InputSource(configuration.getInputStream()),
        homeDir.getFile().getAbsolutePath());
  }
View Full Code Here

     * @param dbConfigFilename
     * @param dbConnectionName
     * @return instance of database configuration
     */
    public static DatabaseConfig getInstance (String dbConfigFilename, String dbConnectionName) {
        XmlBeanFactory configFactory = new XmlBeanFactory(new FileSystemResource(dbConfigFilename));
        return (DatabaseConfig)configFactory.getBean(dbConnectionName);
    }
View Full Code Here

    }

    public static synchronized XmlBeanFactory getBeanFactory() {
        if (configFactory == null) {
            logger.info(Messages.getFormattedString("ProcessConfig.loadingConfig", getConfigFileLocation()));
            configFactory = new XmlBeanFactory(new FileSystemResource(getConfigFileLocation()));
        }
        return configFactory;
    }
View Full Code Here

            }
        };
        List resources = new ArrayList();
        for (Iterator files = new FileIterator(dirName, filter); files.hasNext();) {
            File file = (File)files.next();
            resources.add(new FileSystemResource(file));
        }
        return resources;
    }
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.