public class ResourceFileLoader extends Object implements ResourceLoader
ResourceFileLoader
provides resource locating and loading capabilities for File
based resources.ResourceLoader.Type
Constructor and Description |
---|
ResourceFileLoader(String searchPath)
Constructs a ResourceFileLoader instance.
|
ResourceFileLoader(String searchPath,
String[] extensions)
Constructs a ResourceFileLoader instance.
|
Modifier and Type | Method and Description |
---|---|
String[] |
getExtensions() |
InputStream |
getResourceStream(String resourceName,
ResourceLoader.Type type)
Returns an
InputStream for the requested resource. |
void |
setExtensions(String[] extensions) |
String |
toString() |
public ResourceFileLoader(String searchPath)
A list of directories to be searched when external resources are required (delimiter is File.pathSeparator) is passed in as a parameter.
searchPath
- A delimited search pathpublic ResourceFileLoader(String searchPath, String[] extensions)
A list of directories to be searched when external resources are required (delimiter is File.pathSeparator) is passed in as a parameter.
searchPath
- A delimited search pathpublic void setExtensions(String[] extensions)
public String[] getExtensions()
public InputStream getResourceStream(String resourceName, ResourceLoader.Type type) throws IOException
ResourceLoader
InputStream
for the requested resource.getResourceStream
in interface ResourceLoader
resourceName
- the name of the resource to be usedtype
- the type of resource to be returnedIOException
- if an I/O error occurred when trying to create the streamCopyright © 2024 levigo holding gmbh. All rights reserved.