Package org.infinispan.commons.util
Class AbstractFileLookup
java.lang.Object
org.infinispan.commons.util.AbstractFileLookup
- All Implemented Interfaces:
FileLookup
- Direct Known Subclasses:
FileLookupFactory.DefaultFileLookup
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract InputStream
getAsInputStreamFromClassLoader
(String filename, ClassLoader cl) protected abstract URL
getAsURLFromClassLoader
(String filename, ClassLoader cl) protected abstract Collection
<URL> getAsURLsFromClassLoader
(String filename, ClassLoader cl) lookupFile
(String filename, ClassLoader cl) Looks up the file, see :FileLookupFactory.DefaultFileLookup
.lookupFileLocation
(String filename, ClassLoader cl) lookupFileLocations
(String filename, ClassLoader cl) lookupFileStrict
(String filename, ClassLoader cl) Looks up the file, see :FileLookupFactory.DefaultFileLookup
.lookupFileStrict
(URI uri, ClassLoader cl) Looks up the file, see :FileLookupFactory.DefaultFileLookup
.
-
Constructor Details
-
AbstractFileLookup
public AbstractFileLookup()
-
-
Method Details
-
lookupFile
Looks up the file, see :FileLookupFactory.DefaultFileLookup
.- Specified by:
lookupFile
in interfaceFileLookup
- Parameters:
filename
- might be the name of the file (too look it up in the class path) or an url to a file.- Returns:
- an input stream to the file or null if nothing found through all lookup steps.
-
getAsInputStreamFromClassLoader
-
lookupFileStrict
Looks up the file, see :FileLookupFactory.DefaultFileLookup
.- Specified by:
lookupFileStrict
in interfaceFileLookup
- Parameters:
filename
- might be the name of the file (too look it up in the class path) or an url to a file.- Returns:
- an input stream to the file or null if nothing found through all lookup steps.
- Throws:
FileNotFoundException
- if file cannot be found
-
lookupFileStrict
Description copied from interface:FileLookup
Looks up the file, see :FileLookupFactory.DefaultFileLookup
.- Specified by:
lookupFileStrict
in interfaceFileLookup
- Parameters:
uri
- An absolute, hierarchical URI with a scheme equal to "file" that represents the file to lookup- Returns:
- an input stream to the file or null if nothing found through all lookup steps.
- Throws:
FileNotFoundException
- if file cannot be found
-
lookupFileLocation
- Specified by:
lookupFileLocation
in interfaceFileLookup
-
getAsURLFromClassLoader
-
lookupFileLocations
- Specified by:
lookupFileLocations
in interfaceFileLookup
- Throws:
IOException
-
getAsURLsFromClassLoader
protected abstract Collection<URL> getAsURLsFromClassLoader(String filename, ClassLoader cl) throws IOException - Throws:
IOException
-