org.objectweb.jonas_lib.loader.locator
Class DirLocator

java.lang.Object
  extended by org.objectweb.jonas_lib.loader.locator.Locator
      extended by org.objectweb.jonas_lib.loader.locator.DirLocator

public class DirLocator
extends Locator

A DirLocator is used to look up for a file inside a directory.

Author:
Guillaume Sauthier

Constructor Summary
DirLocator(java.net.URL jar)
          Construct a new DirLocator from an URL pointing to a directory.
 
Method Summary
 boolean hasDirectory(java.lang.String path)
          Returns true when directory was found.
 boolean hasFile(java.lang.String path)
          Returns true when file was found.
 java.util.List listContent(java.lang.String path)
          Returns a list of filename stored in path.
 
Methods inherited from class org.objectweb.jonas_lib.loader.locator.Locator
getLocator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirLocator

public DirLocator(java.net.URL jar)
           throws java.io.IOException
Construct a new DirLocator from an URL pointing to a directory.

Parameters:
jar - URL pointing to a directory.
Throws:
java.io.IOException - When
Method Detail

hasFile

public boolean hasFile(java.lang.String path)
Returns true when file was found.

Specified by:
hasFile in class Locator
Parameters:
path - the path to the file to look up
Returns:
true when file was found, otherwise false.

hasDirectory

public boolean hasDirectory(java.lang.String path)
Returns true when directory was found.

Specified by:
hasDirectory in class Locator
Parameters:
path - the path to the directory to look up
Returns:
true when directory was found, otherwise false.

listContent

public java.util.List listContent(java.lang.String path)
Returns a list of filename stored in path.

Specified by:
listContent in class Locator
Parameters:
path - the path to the directory where looking for files
Returns:
a list of filename stored in path.