org.ow2.jonas.lib.loader.locator
Class DirLocator

java.lang.Object
  extended by org.ow2.jonas.lib.loader.locator.Locator
      extended by org.ow2.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(URL jar)
          Construct a new DirLocator from an URL pointing to a directory.
 
Method Summary
 boolean hasDirectory(String path)
          Returns true when directory was found.
 boolean hasFile(String path)
          Returns true when file was found.
 List listContent(String path)
          Returns a list of filename stored in path.
 
Methods inherited from class org.ow2.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(URL jar)
           throws IOException
Construct a new DirLocator from an URL pointing to a directory.

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

hasFile

public boolean hasFile(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(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 List listContent(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.


Copyright © 2010 OW2 Consortium. All Rights Reserved.