at.ac.tuwien.infosys.rnue.helpers.search
Class FileSystemHelperImpl

java.lang.Object
  |
  +--at.ac.tuwien.infosys.rnue.helpers.search.FileSystemHelperImpl
All Implemented Interfaces:
IFileSystemHelper

public class FileSystemHelperImpl
extends java.lang.Object
implements IFileSystemHelper

The FileSystemHelperImpl class provides the methods to define the file base on the locale filesystem and to search it. The file base is the directory that contains the files to be shared.


Constructor Summary
FileSystemHelperImpl(java.lang.String initialBase)
          Constructs a FileSystemHelperImpl object with a given initialBase.
 
Method Summary
 IFile[] searchFor(java.lang.String keyword)
          Searches the locale file base for a given keyword.
 void setSearchPathBase(java.lang.String path)
          Method to set the path to the file base.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileSystemHelperImpl

public FileSystemHelperImpl(java.lang.String initialBase)
                     throws ShareMeException
Constructs a FileSystemHelperImpl object with a given initialBase.

Parameters:
initialBase - java.lang.String representing the path to the directory that contains the files to be shared (the so-called 'file base').
Throws:
ShareMeException - If the path does not point to an existing directory.
Method Detail

setSearchPathBase

public void setSearchPathBase(java.lang.String path)
                       throws ShareMeException
Method to set the path to the file base. The file base is the directory that contains the files to be shared.

Specified by:
setSearchPathBase in interface IFileSystemHelper
Parameters:
path - path to the file base on the locale filesystem
Throws:
ShareMeException - If the path does not point to an existing directory.

searchFor

public IFile[] searchFor(java.lang.String keyword)
                  throws ShareMeException
Searches the locale file base for a given keyword.

Specified by:
searchFor in interface IFileSystemHelper
Parameters:
keyword - term to search for in the locale file base.
Returns:
An array of FileImpl files matching the keyword.
Throws:
ShareMeException - If some error occurs.