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
Constructors -
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) Looks up the file and returns its URLlookupFileLocations
(String filename, ClassLoader cl) lookupFileLocationStrict
(String filename, ClassLoader cl) Same asFileLookup.lookupFileLocation(String, ClassLoader)
but throws aFileNotFoundException
if the file cannot be found.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
Description copied from interface:FileLookup
Looks up the file and returns its URL- Specified by:
lookupFileLocation
in interfaceFileLookup
- Parameters:
filename
-cl
-- Returns:
- the URL pointing to the file, null if it cannot be found
-
lookupFileLocationStrict
Description copied from interface:FileLookup
Same asFileLookup.lookupFileLocation(String, ClassLoader)
but throws aFileNotFoundException
if the file cannot be found.- Specified by:
lookupFileLocationStrict
in interfaceFileLookup
- Parameters:
filename
-cl
-- Returns:
- Throws:
FileNotFoundException
-
getAsURLFromClassLoader
-
lookupFileLocations
- Specified by:
lookupFileLocations
in interfaceFileLookup
- Throws:
IOException
-
getAsURLsFromClassLoader
protected abstract Collection<URL> getAsURLsFromClassLoader(String filename, ClassLoader cl) throws IOException - Throws:
IOException
-