tribble.search.disk
Class FDirectory

java.lang.Object
  extended bytribble.search.disk.FDirectory
All Implemented Interfaces:
DocumentSearcherI

public class FDirectory
extends java.lang.Object
implements DocumentSearcherI

File directory searcher.

Since:
2001-03-02
Version:
$Revision: 1.3 $ $Date: 2001/06/18 03:01:54 $
Author:
David R. Tribble (david@tribble.com).
Copyright 2001 by David R. Tribble, all rights reserved.
See Also:
FFile

Field Summary
protected  java.io.File m_path
          Directory pathname.
static int SERIES
          Series number.
 
Constructor Summary
FDirectory()
          Default constructor.
 
Method Summary
 void close()
          Close this directory searcher.
 DocumentI create(java.lang.String name, boolean append)
          Create a new file entry for this directory searcher.
 boolean createSupported()
          Determine if new file entries can be created by this searcher.
 java.util.Enumeration find(DocumentFilterI filt)
          Retrieve file entries from this directory matching given search criteria.
 void initialize(java.util.Hashtable parms)
          Initialize this directory searcher.
 void open(java.lang.String path)
          Open a given pathname for this directory searcher.
 void open(java.net.URL path)
          Open a given URL for this directory searcher.
 boolean outputSupported()
          Determine if file entries can be written to this searcher.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERIES

public static final int SERIES
Series number.

See Also:
Constant Field Values

m_path

protected java.io.File m_path
Directory pathname.

Constructor Detail

FDirectory

public FDirectory()
Default constructor.

Since:
1.1, 2001-05-17
Method Detail

initialize

public void initialize(java.util.Hashtable parms)
Initialize this directory searcher.

Note: This method does not actually do anything.

Specified by:
initialize in interface DocumentSearcherI
Parameters:
parms - A table containing name/value pairs with which to initialize this directory searcher. This can be null.
Since:
1.1, 2001-05-10
See Also:
DocumentSearcherI.open(java.lang.String)

open

public void open(java.lang.String path)
          throws java.io.IOException
Open a given pathname for this directory searcher.

Specified by:
open in interface DocumentSearcherI
Parameters:
path - A pathname specifying the location of a directory to open and search. This name must specify a directory filename on the local machine.
Throws:
java.io.IOException - Thrown if the specified path does not exist or is not accessible, or if it is not a directory, or if it is malformed, or if some other error occurs.
Since:
1.1, 2001-05-05
See Also:
DocumentSearcherI.close(), DocumentSearcherI.initialize(java.util.Hashtable)

open

public void open(java.net.URL path)
          throws java.io.IOException
Open a given URL for this directory searcher.

Parameters:
path - A URL specifying the location of the directory to open and search. This URL must specify a directory filename on the local machine, and must begin with the substring "file://".
Throws:
java.net.MalformedURLException - Thrown if the specified URL is malformed.
java.io.IOException - Thrown if the specified URL does not exist or is not accessible, or if it is malformed, or if some other error occurs.
Since:
1.1, 2001-03-02

close

public void close()
           throws java.io.IOException
Close this directory searcher.

Specified by:
close in interface DocumentSearcherI
Throws:
java.io.IOException - Thrown if an error occurs.
Since:
1.1, 2001-03-02
See Also:
DocumentSearcherI.open(java.lang.String)

find

public java.util.Enumeration find(DocumentFilterI filt)
                           throws java.io.IOException,
                                  java.lang.Exception
Retrieve file entries from this directory matching given search criteria.

Specified by:
find in interface DocumentSearcherI
Parameters:
filt - A filter specifying file searching criteria. This can be null, in which case all possible file entries for this searcher are returned.
Returns:
An FIterator object containing an enumeration of FFile objects representing the list of directory files found by this searcher, or null if there are no matching files to be found.
Throws:
java.io.IOException - Thrown if the specified criteria are malformed, or if some other error occurs.
java.lang.Exception - Thrown if the specified criteria are malformed, or if some other error occurs.
Since:
1.2, 2001-06-15

create

public DocumentI create(java.lang.String name,
                        boolean append)
                 throws java.io.IOException
Create a new file entry for this directory searcher.

Parameters:
name - The name of the new file entry to create in this directory.
append - Specifies whether or not to append written data to the end of the file.
Returns:
A new file entry corresponding to the newly created file entry.
Throws:
java.lang.Exception - Thrown if the file name is malformed, or if the file already exists, or if some other error occurs.
java.io.IOException
Since:
1.2, 2001-06-15

createSupported

public boolean createSupported()
Determine if new file entries can be created by this searcher.

Returns:
True, always.
Since:
1.1, 2001-06-02

outputSupported

public boolean outputSupported()
Determine if file entries can be written to this searcher.

Specified by:
outputSupported in interface DocumentSearcherI
Returns:
True, always.
Since:
1.1, 2001-06-02