org.infinispan.util
Class AbstractFileLookup

java.lang.Object
  extended by org.infinispan.util.AbstractFileLookup
All Implemented Interfaces:
FileLookup
Direct Known Subclasses:
FileLookupFactory.DefaultFileLookup

public abstract class AbstractFileLookup
extends Object
implements FileLookup


Constructor Summary
AbstractFileLookup()
           
 
Method Summary
protected abstract  InputStream getAsInputStreamFromClassLoader(String filename, ClassLoader cl)
           
protected abstract  URL getAsURLFromClassLoader(String filename, ClassLoader cl)
           
protected abstract  Collection<URL> getAsURLsFromClassLoader(String filename, ClassLoader cl)
           
 InputStream lookupFile(String filename, ClassLoader cl)
          Looks up the file, see : FileLookupFactory.DefaultFileLookup.
 URL lookupFileLocation(String filename, ClassLoader cl)
           
 Collection<URL> lookupFileLocations(String filename, ClassLoader cl)
           
 InputStream lookupFileStrict(String filename, ClassLoader cl)
          Looks up the file, see : FileLookupFactory.DefaultFileLookup.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractFileLookup

public AbstractFileLookup()
Method Detail

lookupFile

public InputStream lookupFile(String filename,
                              ClassLoader cl)
Looks up the file, see : FileLookupFactory.DefaultFileLookup.

Specified by:
lookupFile in interface FileLookup
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:
lookupFileStrict in interface FileLookup
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

lookupFileLocation

public URL lookupFileLocation(String filename,
                              ClassLoader cl)
Specified by:
lookupFileLocation in interface FileLookup

getAsURLFromClassLoader

protected abstract URL getAsURLFromClassLoader(String filename,
                                               ClassLoader cl)

lookupFileLocations

public Collection<URL> lookupFileLocations(String filename,
                                           ClassLoader cl)
                                    throws IOException
Specified by:
lookupFileLocations in interface FileLookup
Throws:
IOException

getAsURLsFromClassLoader

protected abstract Collection<URL> getAsURLsFromClassLoader(String filename,
                                                            ClassLoader cl)
                                                     throws IOException
Throws:
IOException

-->

Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.