public class ClasspathResourceFinderBasic extends ClasspathResourceFinderSimple
Same as ClasspathResourceFinderSimple
, but if the resource cannot be found in the classpath, then an attempt
is made to look in the JVM working directory.
Path traversals outside the working directory are not allowed for security reasons.
ClasspathResourceFinder.Null
Constructor and Description |
---|
ClasspathResourceFinderBasic() |
Modifier and Type | Method and Description |
---|---|
protected InputStream |
findFileSystemResource(String name,
Locale locale)
Workhorse method for retrieving a resource from the file system.
|
InputStream |
findResource(Class<?> baseClass,
String name,
Locale locale)
Returns the contents of the resource with the specified name.
|
findClasspathResource, getCandidateFileNames
public ClasspathResourceFinderBasic()
public InputStream findResource(Class<?> baseClass, String name, Locale locale) throws IOException
ClasspathResourceFinder
findResource
in interface ClasspathResourceFinder
findResource
in class ClasspathResourceFinderSimple
baseClass
- The class to use to retrieve the resource.name
- The resource name.
See Class.getResource(String)
for format.locale
- The locale of the resource to retrieve.
IOException
protected InputStream findFileSystemResource(String name, Locale locale) throws IOException
This method can be overridden by subclasses to provide customized handling of resource retrieval from file systems.
name
- The resource name.locale
- The resource locale.
IOException
Copyright © 2018 Apache. All rights reserved.