public class ResourceFinder extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static ICache<String,List<URL>> |
cache
Cache of resources.
|
static String |
FEATURE_COMPARATOR
Comparator feature.
|
| Constructor and Description |
|---|
ResourceFinder() |
| Modifier and Type | Method and Description |
|---|---|
List<URL> |
filter(List<URL> resources)
Filter resources.
|
List<URL> |
getAllResources(String resource)
List of all resource URLs associated to a given file, including its
suffix '_default' corresponding version.
|
Comparator<URL> |
getComparator()
Get the resources comparator.
|
List<String> |
getDefault(String resource)
Get default name for resource files.
|
List<URL> |
getResources(String... resources)
Find a given file in classloader.
|
URL |
getSpecific(String resource)
Get the most specific file.
|
ResourceFinder |
initilize()
Initialize comparator, if required.
|
protected void |
log(String msg,
List<URL> files)
Print load information.
|
void |
setComparator(Comparator<URL> comparator)
Set the comparator.
|
List<URL> |
sort(List<URL> resources)
Sort the resources using reverse order.
|
public static final String FEATURE_COMPARATOR
public Comparator<URL> getComparator()
public void setComparator(Comparator<URL> comparator)
comparator - Comparator.public List<String> getDefault(String resource)
resource - The resource name.public ResourceFinder initilize()
public URL getSpecific(String resource) throws IOException
resource - The resource.IOException - On lookup errors.public List<URL> getAllResources(String resource) throws IOException
resource - The resource file.IOException - On lookup error.protected void log(String msg, List<URL> files)
msg - A message.files - The resource list.public List<URL> getResources(String... resources) throws IOException
resource - The resource name.IOException - On loading list errors.public List<URL> filter(List<URL> resources)
resources - The resources.Copyright © 2016. All rights reserved.