public class ResourceUtil extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
ResourceUtil.OnEntry
Interface to implement for iteration of a collection of resources.
|
| Constructor and Description |
|---|
ResourceUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
forAllEntries(String root,
String fileSuffix,
ResourceUtil.OnEntry toDo)
Iterate over all non-directory resources from a given resource directory root.
|
protected static String[] |
getResourceListing(String path)
Assume a given path is a directory and retrieve it's children.
|
protected static String[] getResourceListing(String path) throws URISyntaxException, IOException
path - resource pathURISyntaxException - if an error occurs handling a file URIIOException - if an IO error occurs while reading children listpublic static void forAllEntries(String root, String fileSuffix, ResourceUtil.OnEntry toDo) throws IOException, URISyntaxException
root - root resource directory. This must always be the name of a directory.fileSuffix - unique suffix indicating a file instead of a directory.toDo - callback to invoke on each non-directory resource.IOException - if an error occurs while reading resourcesURISyntaxException - if an error occurs attempting to construct the path for the resource listing root (this should never happen).Copyright © 2018 Orbital Enterprises. All rights reserved.