Package org.auto.io

Examples of org.auto.io.Resource


    FileHandler handler = new FileHandler() {

      @Override
      public void handle(File t) {
        System.out.println(t);
        Resource resource = new FileResource(t);
        resource.getInputStream();
        count++;

      }
    };
    scanner.scan("F:/download/ckeditor_3.5.2.zip \r\n", handler);
View Full Code Here


    Enumeration<URL> urls;
    try {
      urls = classLoader.getResources(path);
      while (urls.hasMoreElements()) {
        URL url = urls.nextElement();
        Resource resource = new UrlResource(url);
        PropertiesLoaderUtils.fillProperties(properties, resource);
      }
    } catch (IOException e) {
      throw new IllegalArgumentException(
          "IOException load class path properties[" + path + "]!", e);
View Full Code Here

    Map<String, Resource> definitionMappings = new HashMap<String, Resource>();
    Set<Entry<Object, Object>> set = properties.entrySet();
    for (Entry<Object, Object> entry : set) {
      String key = (String) entry.getKey();
      String value = (String) entry.getValue();
      Resource resource = getResource(value);
      definitionMappings.put(key, resource);
    }
    return definitionMappings;
  };
View Full Code Here

    Enumeration<URL> urlEnumeration = gerClassPathResources(rootDirPath);
    DefaultFilePatternScanner fileScanner = new DefaultFilePatternScanner();
    FileHandler fileHandler = new FileHandler() {
      @Override
      public void handle(File file) {
        Resource resource = new FileResource(file);
        handler.handle(resource);
      }
    };
    while (urlEnumeration.hasMoreElements()) {
      URL url = (URL) urlEnumeration.nextElement();
View Full Code Here

      String entryPath = entry.getName();
      if (entryPath.startsWith(rootEntryPath)) {
        String relativePath = entryPath.substring(rootEntryPath
            .length());
        if (getPathMatcher().match(subPattern, relativePath)) {
          Resource resource = new JarEntryResource(jarFile, entry);
          handler.handle(resource);
        }
      }
    }
  }
View Full Code Here

    if (super.getPathMatcher().isPattern(locationPattern)) {
      String rootDirPath = determineRootDir(locationPattern);
      String subPattern = locationPattern.substring(rootDirPath.length());
      this.scan(rootDirPath, subPattern, handler);
    } else {
      Resource resource = new ClassPathResource(locationPattern);
      handler.handle(resource);
    }
  }
View Full Code Here

          // only returns entries for one directory level.
          doRetrieveMatchingServletContextResources(currPath,
              locationPattern, handler);
        }
        if (getPathMatcher().match(locationPattern, currPath)) {
          Resource resource = new ServletContextResource(
              servletContext, currPath);
          handler.handle(resource);
        }
      }
    }
View Full Code Here

      locationPattern = ResourcePathUtils.getReallPath(locationPattern);
      String rootDirPath = determineRootDir(locationPattern);
      doRetrieveMatchingServletContextResources(rootDirPath,
          locationPattern, handler);
    } else {
      Resource resource = new ServletContextResource(servletContext,
          locationPattern);
      handler.handle(resource);
    }

  }
View Full Code Here

      return null;
    }
    if (xmlDefinitionManager == null) {
      return null;
    }
    Resource resource = xmlDefinitionManager.getXmlDefinition(systemId);
    if (null == resource) {
      return null;
    }
    InputStream inputStream = resource.getInputStream();
    InputSource inputSource = new InputSource(inputStream);
    inputSource.setPublicId(publicId);
    inputSource.setSystemId(systemId);
    return inputSource;
View Full Code Here

  @Override
  public void scan(String locationPattern, final ResourceHandler handler) {
    fileScanner.scan(locationPattern, new FileHandler() {
      @Override
      public void handle(File file) {
        Resource resource = new FileResource(file);
        handler.handle(resource);
      }

    });
  }
View Full Code Here

TOP

Related Classes of org.auto.io.Resource

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.