Examples of FileSystemResource


Examples of org.springframework.core.io.FileSystemResource

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

Examples of org.springframework.core.io.FileSystemResource

        for (File file : returnedFiles){
          if (file.isDirectory()){
            continue;
          }
          if (file.getName().toLowerCase().endsWith(".shp")){
            fileResources.add(new FileSystemResource(file.getAbsolutePath()));
            totalSize += file.length();
          } else if (file.getName().toLowerCase().endsWith(".shx")){
            fileResources.add(new FileSystemResource(file.getAbsolutePath()));
            totalSize += file.length();
          } else if (file.getName().toLowerCase().endsWith(".dbf")){
            fileResources.add(new FileSystemResource(file.getAbsolutePath()));
            totalSize += file.length();
          }
        }
        logger.info("Total file size (in MB) equals: " + Double.toString(totalSize/1048576.0));
View Full Code Here

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

Examples of org.springframework.core.io.FileSystemResource

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

Examples of org.springframework.core.io.FileSystemResource

    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

Examples of org.springframework.core.io.FileSystemResource

    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

Examples of org.springframework.core.io.FileSystemResource

    });
    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

Examples of org.springframework.core.io.FileSystemResource

                "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

Examples of org.springframework.core.io.FileSystemResource

    }

    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

Examples of org.springframework.core.io.FileSystemResource

     * @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
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.