Package org.infinispan.commons.util
Class AbstractFileLookup
- java.lang.Object
-
- org.infinispan.commons.util.AbstractFileLookup
-
- All Implemented Interfaces:
FileLookup
- Direct Known Subclasses:
FileLookupFactory.DefaultFileLookup
public abstract class AbstractFileLookup extends Object implements FileLookup
-
-
Constructor Summary
Constructors Constructor Description AbstractFileLookup()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract InputStreamgetAsInputStreamFromClassLoader(String filename, ClassLoader cl)protected abstract URLgetAsURLFromClassLoader(String filename, ClassLoader cl)protected abstract Collection<URL>getAsURLsFromClassLoader(String filename, ClassLoader cl)InputStreamlookupFile(String filename, ClassLoader cl)Looks up the file, see :FileLookupFactory.DefaultFileLookup.URLlookupFileLocation(String filename, ClassLoader cl)Collection<URL>lookupFileLocations(String filename, ClassLoader cl)InputStreamlookupFileStrict(String filename, ClassLoader cl)Looks up the file, see :FileLookupFactory.DefaultFileLookup.InputStreamlookupFileStrict(URI uri, ClassLoader cl)Looks up the file, see :FileLookupFactory.DefaultFileLookup.
-
-
-
Method Detail
-
lookupFile
public InputStream lookupFile(String filename, ClassLoader cl)
Looks up the file, see :FileLookupFactory.DefaultFileLookup.- Specified by:
lookupFilein 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
protected abstract InputStream getAsInputStreamFromClassLoader(String filename, ClassLoader cl)
-
lookupFileStrict
public InputStream lookupFileStrict(String filename, ClassLoader cl) throws FileNotFoundException
Looks up the file, see :FileLookupFactory.DefaultFileLookup.- Specified by:
lookupFileStrictin 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
public InputStream lookupFileStrict(URI uri, ClassLoader cl) throws FileNotFoundException
Description copied from interface:FileLookupLooks up the file, see :FileLookupFactory.DefaultFileLookup.- Specified by:
lookupFileStrictin 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
public URL lookupFileLocation(String filename, ClassLoader cl)
- Specified by:
lookupFileLocationin interfaceFileLookup
-
getAsURLFromClassLoader
protected abstract URL getAsURLFromClassLoader(String filename, ClassLoader cl)
-
lookupFileLocations
public Collection<URL> lookupFileLocations(String filename, ClassLoader cl) throws IOException
- Specified by:
lookupFileLocationsin interfaceFileLookup- Throws:
IOException
-
getAsURLsFromClassLoader
protected abstract Collection<URL> getAsURLsFromClassLoader(String filename, ClassLoader cl) throws IOException
- Throws:
IOException
-
-