org.infinispan.util
Class FileLookup

java.lang.Object
  extended by org.infinispan.util.FileLookup

public class FileLookup
extends Object

Holds the logic of looking up a file, in the following sequence:

  1. try to load it with the current thread's context ClassLoader
  2. if fails, the system ClassLoader
  3. if fails, try to load it as a file from the disk

Since:
4.0
Author:
Mircea.Markus@jboss.com

Constructor Summary
FileLookup()
           
 
Method Summary
protected  InputStream getAsInputStreamFromClassLoader(String filename)
           
 InputStream lookupFile(String filename)
          Looks up the file, see : FileLookup.
 URL lookupFileLocation(String filename)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileLookup

public FileLookup()
Method Detail

lookupFile

public InputStream lookupFile(String filename)
Looks up the file, see : 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 InputStream getAsInputStreamFromClassLoader(String filename)

lookupFileLocation

public URL lookupFileLocation(String filename)

Google Analytics

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