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 java.lang.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 java.io.InputStreamgetAsInputStreamFromClassLoader(java.lang.String filename, java.lang.ClassLoader cl)protected abstract java.net.URLgetAsURLFromClassLoader(java.lang.String filename, java.lang.ClassLoader cl)protected abstract java.util.Collection<java.net.URL>getAsURLsFromClassLoader(java.lang.String filename, java.lang.ClassLoader cl)java.io.InputStreamlookupFile(java.lang.String filename, java.lang.ClassLoader cl)Looks up the file, see :FileLookupFactory.DefaultFileLookup.java.net.URLlookupFileLocation(java.lang.String filename, java.lang.ClassLoader cl)java.util.Collection<java.net.URL>lookupFileLocations(java.lang.String filename, java.lang.ClassLoader cl)java.io.InputStreamlookupFileStrict(java.lang.String filename, java.lang.ClassLoader cl)Looks up the file, see :FileLookupFactory.DefaultFileLookup.java.io.InputStreamlookupFileStrict(java.net.URI uri, java.lang.ClassLoader cl)Looks up the file, see :FileLookupFactory.DefaultFileLookup.
-
-
-
Method Detail
-
lookupFile
public java.io.InputStream lookupFile(java.lang.String filename, java.lang.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 java.io.InputStream getAsInputStreamFromClassLoader(java.lang.String filename, java.lang.ClassLoader cl)
-
lookupFileStrict
public java.io.InputStream lookupFileStrict(java.lang.String filename, java.lang.ClassLoader cl) throws java.io.FileNotFoundExceptionLooks 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:
java.io.FileNotFoundException- if file cannot be found
-
lookupFileStrict
public java.io.InputStream lookupFileStrict(java.net.URI uri, java.lang.ClassLoader cl) throws java.io.FileNotFoundExceptionDescription 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:
java.io.FileNotFoundException- if file cannot be found
-
lookupFileLocation
public java.net.URL lookupFileLocation(java.lang.String filename, java.lang.ClassLoader cl)- Specified by:
lookupFileLocationin interfaceFileLookup
-
getAsURLFromClassLoader
protected abstract java.net.URL getAsURLFromClassLoader(java.lang.String filename, java.lang.ClassLoader cl)
-
lookupFileLocations
public java.util.Collection<java.net.URL> lookupFileLocations(java.lang.String filename, java.lang.ClassLoader cl) throws java.io.IOException- Specified by:
lookupFileLocationsin interfaceFileLookup- Throws:
java.io.IOException
-
getAsURLsFromClassLoader
protected abstract java.util.Collection<java.net.URL> getAsURLsFromClassLoader(java.lang.String filename, java.lang.ClassLoader cl) throws java.io.IOException- Throws:
java.io.IOException
-
-