ch.elca.el4j.core.io.support
Class OrderedPathMatchingResourcePatternResolver

java.lang.Object
  extended by org.springframework.core.io.support.PathMatchingResourcePatternResolver
      extended by ch.elca.el4j.core.io.support.OrderedPathMatchingResourcePatternResolver
All Implemented Interfaces:
ResourceLoader, ResourcePatternResolver

public class OrderedPathMatchingResourcePatternResolver
extends PathMatchingResourcePatternResolver

This class extends PathMatchingResourcePatternResolver in the way that it sorts the files in a folder alphabetically.

Author:
Stefan Wismer (SWI)
File-location:
OrderedPathMatchingResourcePatternResolver
Last check-in date:
2010-01-15 12:21:07 +0100 (Fr, 15. Jan 2010) by jonasha for revision 4091

Field Summary
protected  boolean m_ascending
          Is order ascending?
protected  Comparator<Resource> m_resourceComparator
          The resource comparator.
 
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
 
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
 
Constructor Summary
OrderedPathMatchingResourcePatternResolver()
          Create a PathMatchingResourcePatternResolver using a DefaultResourceLoader that sorts the files in a folder alphabetically.
OrderedPathMatchingResourcePatternResolver(ClassLoader classLoader)
          Create a new PathMatchingResourcePatternResolver with a DefaultResourceLoader that sorts the files in a folder alphabetically.
OrderedPathMatchingResourcePatternResolver(ResourceLoader resourceLoader)
          Create a new PathMatchingResourcePatternResolver that sorts the files in a folder alphabetically.
 
Method Summary
protected  Set doFindPathMatchingFileResources(Resource rootDirResource, String subPattern)
          
protected  Set doFindPathMatchingJarResources(Resource rootDirResource, String subPattern)
          
 boolean isAscending()
           
 void setAscending(boolean ascending)
           
 
Methods inherited from class org.springframework.core.io.support.PathMatchingResourcePatternResolver
convertClassLoaderURL, determineRootDir, doFindMatchingFileSystemResources, doRetrieveMatchingFiles, findAllClassPathResources, findPathMatchingResources, getClassLoader, getJarFile, getPathMatcher, getResource, getResourceLoader, getResources, isJarResource, resolveRootDirResource, retrieveMatchingFiles, setPathMatcher
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_ascending

protected boolean m_ascending
Is order ascending?


m_resourceComparator

protected final Comparator<Resource> m_resourceComparator
The resource comparator.

Constructor Detail

OrderedPathMatchingResourcePatternResolver

public OrderedPathMatchingResourcePatternResolver()
Create a PathMatchingResourcePatternResolver using a DefaultResourceLoader that sorts the files in a folder alphabetically.

ClassLoader access will happen via the thread context class loader.

See Also:
DefaultResourceLoader

OrderedPathMatchingResourcePatternResolver

public OrderedPathMatchingResourcePatternResolver(ClassLoader classLoader)
Create a new PathMatchingResourcePatternResolver with a DefaultResourceLoader that sorts the files in a folder alphabetically.

Parameters:
classLoader - the ClassLoader to load classpath resources with, or null for using the thread context class loader
See Also:
DefaultResourceLoader

OrderedPathMatchingResourcePatternResolver

public OrderedPathMatchingResourcePatternResolver(ResourceLoader resourceLoader)
Create a new PathMatchingResourcePatternResolver that sorts the files in a folder alphabetically.

ClassLoader access will happen via the thread context class loader.

Parameters:
resourceLoader - the ResourceLoader to load root directories and actual resources with
Method Detail

isAscending

public boolean isAscending()
Returns:
whether order is ascending or not

setAscending

public void setAscending(boolean ascending)
Parameters:
ascending - is order ascending?

doFindPathMatchingFileResources

protected Set doFindPathMatchingFileResources(Resource rootDirResource,
                                              String subPattern)
                                       throws IOException

Overrides:
doFindPathMatchingFileResources in class PathMatchingResourcePatternResolver
Throws:
IOException

doFindPathMatchingJarResources

protected Set doFindPathMatchingJarResources(Resource rootDirResource,
                                             String subPattern)
                                      throws IOException

Overrides:
doFindPathMatchingJarResources in class PathMatchingResourcePatternResolver
Throws:
IOException


Copyright © 2005-2011 ELCA. All Rights Reserved.