Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.infinispan.commons.util;
 
 import java.net.URI;
 import java.net.URL;

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

Use FileLookupFactory to obtain an instance of FileLookup. This will result in an extended version of FileLookup being used if in an OSGI environment.

Author(s):
Mircea.Markus@jboss.com
Pete Muir
Since:
4.0
public interface FileLookup {

   
Looks up the file, see : FileLookupFactory.DefaultFileLookup.

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.
   InputStream lookupFile(String filenameClassLoader cl);

   
Looks up the file, see : FileLookupFactory.DefaultFileLookup.

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
Looks up the file, see : FileLookupFactory.DefaultFileLookup.

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
   URL lookupFileLocation(String filenameClassLoader cl);
New to GrepCode? Check out our FAQ X