tribble.search.ftp
Class FtpSearcher

java.lang.Object
  extended bytribble.search.ftp.FtpSearcher
All Implemented Interfaces:
DocumentSearcherI

public class FtpSearcher
extends java.lang.Object
implements DocumentSearcherI

FTP file searcher.

Since:
2002-06-17
Version:
$Revision: 1.1 $ $Date: 2002/06/18 03:19:19 $
Author:
David R. Tribble, david@tribble.com.
Copyright 2002 by David R. Tribble, all rights reserved.
See Also:
FtpFile

Field Summary
protected  java.lang.String m_hostName
          FTP host name.
protected  java.lang.String m_password
          FTP password.
protected  java.lang.String m_root
          Root remote directory.
protected  int m_serialNo
          Open counter.
protected  java.lang.String m_userName
          FTP user name.
static int SERIES
          Series number.
 
Constructor Summary
FtpSearcher()
          Default constructor.
 
Method Summary
 void close()
          Close this FTP file searcher.
 DocumentI create(java.lang.String name, boolean append)
          Create a new file entry in this FTP file searcher.
 boolean createSupported()
          Determine if new FTP file entries can be created by this searcher.
 java.util.Enumeration find(DocumentFilterI filt)
          Retrieve file entries from this FTP file matching given search criteria.
 void initialize(java.util.Hashtable parms)
          Initialize this searcher.
 void open(java.lang.String path)
          Open a given pathname for this FTP file searcher.
 boolean outputSupported()
          Determine if FTP 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_hostName

protected java.lang.String m_hostName
FTP host name.


m_userName

protected java.lang.String m_userName
FTP user name.


m_password

protected java.lang.String m_password
FTP password.


m_root

protected java.lang.String m_root
Root remote directory.


m_serialNo

protected int m_serialNo
Open counter. This counter is incremented every time open(java.lang.String) is called. It is used by FtpFile objects to detect whether or not they have become invalidated.

Constructor Detail

FtpSearcher

public FtpSearcher()
Default constructor.

Since:
1.1, 2002-06-17
Method Detail

initialize

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

+INCOMPLETE

Specified by:
initialize in interface DocumentSearcherI
Parameters:
parms - A table containing name/value pairs with which to initialize this FTP file searcher. This must not be null.
Since:
1.1, 2002-06-17
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 FTP file searcher.

Specified by:
open in interface DocumentSearcherI
Parameters:
path - A pathname specifying the location of a FTP file to open and search. This name must specify a 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 regular file, or if it is malformed, or if some other error occurs.
Since:
1.1, 2002-06-17
See Also:
DocumentSearcherI.close(), DocumentSearcherI.initialize(java.util.Hashtable)

close

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

Specified by:
close in interface DocumentSearcherI
Throws:
java.io.IOException - Thrown if an error occurs.
Since:
1.1, 2002-06-17
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 FTP file 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:
A FtpIterator object containing an enumeration of FtpFile objects representing the list of file entries found by this searcher, or null if there are no matching file entries 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.1, 2002-06-17

create

public DocumentI create(java.lang.String name,
                        boolean append)
                 throws java.lang.UnsupportedOperationException
Create a new file entry in this FTP file searcher.

Parameters:
name - The name of the new file entry to create in this FTP file.
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.UnsupportedOperationException - Thrown if this method is not supported for this searcher.
Since:
1.1, 2002-06-17

createSupported

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

Returns:
True, always.
Since:
1.1, 2002-06-17

outputSupported

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

Specified by:
outputSupported in interface DocumentSearcherI
Returns:
False, always.
Since:
1.1, 2002-06-17