org.carrot2.util.resource
Class DirLocator

java.lang.Object
  extended by org.carrot2.util.resource.DirLocator
All Implemented Interfaces:
IResourceLocator

public final class DirLocator
extends Object
implements IResourceLocator

Looks up resources in a folder.


Constructor Summary
DirLocator(File dir)
          Initializes the locator using the given directory.
DirLocator(String dirPath)
          Initializes the locator using the given path.
 
Method Summary
 boolean equals(Object target)
          Override equals to return true for locators scanning an identical set of locations.
 IResource[] getAll(String resource)
          Locate all matching resources and return their IResource handles.
 int hashCode()
          Override hash code to return consistent hash code depending on all locations scanned by this locator.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DirLocator

public DirLocator(File dir)
Initializes the locator using the given directory. If the argument is null or a non-existent folder, the locator will return an empty set of resources.


DirLocator

public DirLocator(String dirPath)
Initializes the locator using the given path. If the argument is null or a non-existent folder, the locator will return an empty set of resources.

Method Detail

getAll

public IResource[] getAll(String resource)
Description copied from interface: IResourceLocator
Locate all matching resources and return their IResource handles.

Specified by:
getAll in interface IResourceLocator

hashCode

public int hashCode()
Description copied from interface: IResourceLocator
Override hash code to return consistent hash code depending on all locations scanned by this locator.

Specified by:
hashCode in interface IResourceLocator
Overrides:
hashCode in class Object

equals

public boolean equals(Object target)
Description copied from interface: IResourceLocator
Override equals to return true for locators scanning an identical set of locations.

Specified by:
equals in interface IResourceLocator
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright (c) Dawid Weiss, Stanislaw Osinski