|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--gnu.inet.ftp.FtpClientProtocol
|
+--gnu.hylafax.HylaFAXClientProtocol
|
+--gnu.hylafax.HylaFAXClient
This class implements convenience methods that wrapper the ClientProtocol methods for common functionality.
Most developers will want to use this class rather than the lower-level ClientProtocol methods directly.
ClientProtocol| Field Summary | |
protected PassiveConnection |
connection
This is a cached PassiveConnection instance. |
| Fields inherited from class gnu.hylafax.HylaFAXClientProtocol |
DEFAULT_PORT, TZONE_GMT, TZONE_LOCAL |
| Fields inherited from class gnu.inet.ftp.FtpClientProtocol |
fileType, greeting, istream, MDTM_TIME_FORMAT1, MDTM_TIME_FORMAT2, MODE_BLOCK, MODE_COMPRESSED, MODE_STREAM, MODE_ZLIB, ostream, port, sock, STRU_FILE, STRU_PAGE, STRU_RECORD, STRU_TIFF, TYPE_ASCII, TYPE_EBCDIC, TYPE_IMAGE, TYPE_LOCAL |
| Fields inherited from interface gnu.hylafax.ClientProtocol |
NOTIFY_ALL, NOTIFY_DONE, NOTIFY_NONE, NOTIFY_REQUEUE, TZONE_GMT, TZONE_LOCAL |
| Constructor Summary | |
HylaFAXClient()
default constructor. |
|
| Method Summary | |
void |
addConnectionListener(ConnectionListener listener)
Register a connection listener with the event source. |
void |
addConnectionListeners(java.util.Vector listeners)
Register a set of connection listeners with the event source. |
void |
addTransferListener(TransferListener listener)
Register a transfer listener with the event source. |
void |
addTransferListeners(java.util.Vector listeners)
Register a set of transfer listeners with the event source. |
Job |
createJob()
create a new job in the server |
void |
delete(Job job)
delete the given done or suspended job |
void |
get(java.lang.String path,
java.io.OutputStream out)
GET the named file, FTP style. |
Job |
getJob(long id)
get a Job instance for the given job id |
java.util.Vector |
getList()
get a long-style listing of files in the current directory. |
java.util.Vector |
getList(java.lang.String path)
get a long-style listing of files in the given directory. |
java.util.Vector |
getNameList()
get name list of files in the current directory. |
java.util.Vector |
getNameList(java.lang.String path)
get name list of files in the given directory. |
boolean |
getPassive()
check whether passive transfers have been enabled |
void |
interrupt(Job job)
interrupt the given job |
void |
kill(Job job)
kill the given job |
static void |
main(java.lang.String[] Arguments)
run some basic tests. |
void |
mode(char mode)
set the transfer mode. |
java.lang.String |
put(java.io.InputStream in)
put a file with a unique name. |
void |
put(java.io.InputStream in,
java.lang.String pathname)
store a file. |
java.lang.String |
putTemporary(java.io.InputStream data)
put a temp file, the data is stored in a uniquely named file on the server. |
void |
removeConnectionListener(ConnectionListener listener)
De-register a connection listener with the event source. |
void |
removeTransferListener(TransferListener listener)
De-register a transfer listener with the event source. |
void |
setPassive(boolean passive)
enable or disable passive transfers |
void |
submit(Job job)
submit the given job to the scheduler |
void |
suspend(Job job)
suspend the given job from the scheduler |
void |
wait(Job job)
wait for the given job to complete |
| Methods inherited from class gnu.hylafax.HylaFAXClientProtocol |
admin, filefmt, filefmt, idle, idle, jdele, jintr, jkill, jnew, job, job, jobfmt, jobfmt, jparm, jparm, jparm, jparm, jparm, jrest, jsubm, jsubm, jsusp, jwait, mdmfmt, mdmfmt, open, open, rcvfmt, rcvfmt, size, stot, tzone, vrfy |
| Methods inherited from class gnu.inet.ftp.FtpClientProtocol |
abor, abor, cdup, connect, cwd, dele, getDebug, getGreeting, getInetAddress, getType, list, list, mdtm, nlst, nlst, noop, open, pass, pasv, port, pwd, quit, readResponse, retr, rnfr, rnto, setDebug, stat, stat, stor, stou, stru, syst, type, user |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface gnu.hylafax.Client |
setDebug |
| Methods inherited from interface gnu.hylafax.ClientProtocol |
admin, filefmt, filefmt, idle, idle, jdele, jintr, jkill, jnew, job, job, jobfmt, jobfmt, jparm, jparm, jparm, jparm, jparm, jrest, jsubm, jsubm, jsusp, jwait, mdmfmt, mdmfmt, noop, open, open, pass, quit, rcvfmt, rcvfmt, size, stot, tzone, user, vrfy |
| Field Detail |
protected PassiveConnection connection
Whenever a successful passive transfer occurrs, this variable should be set to null, thereby invalidating the cached value.
| Constructor Detail |
public HylaFAXClient()
| Method Detail |
public void setPassive(boolean passive)
setPassive in interface Clientpassive - indicates whether passive transfers should be usedpublic boolean getPassive()
getPassive in interface Client
public void mode(char mode)
throws java.io.IOException,
ServerResponseException
mode in interface Clientmode in class FtpClientProtocolmode - the new mode settingjava.io.IOException - an io error occurred talking to the serverServerResponseException - the server replied with an error code
public java.lang.String putTemporary(java.io.InputStream data)
throws java.io.IOException,
ServerResponseException
putTemporary in interface Clientjava.io.IOException - io error occurred talking to the serverServerResponseException - server replied with error code
public java.lang.String put(java.io.InputStream in)
throws java.io.IOException,
ServerResponseException
put in interface Clientjava.io.IOException - a socket IO error occurredServerResponseException - the server responded with an error code
public void put(java.io.InputStream in,
java.lang.String pathname)
throws java.io.IOException,
ServerResponseException
put in interface Clientpathname - name of file to store on server (where to put the file on the server)java.io.IOException - a socket IO error occurredServerResponseException - the server responded with an error
public java.util.Vector getList(java.lang.String path)
throws java.io.IOException,
java.io.FileNotFoundException,
ServerResponseException
getList in interface Clientpath - the path that we're interested in finding the contents ofjava.io.IOException - an IO error occurredjava.io.FileNotFoundException - the given path doesn't existServerResponseException - the server reported an error
public java.util.Vector getList()
throws java.io.IOException,
java.io.FileNotFoundException,
ServerResponseException
getList in interface Clientjava.io.IOException - an IO error occurredjava.io.FileNotFoundException - the "." path doesn't existServerResponseException - the server reported an error
public java.util.Vector getNameList(java.lang.String path)
throws java.io.IOException,
ServerResponseException,
java.io.FileNotFoundException
getNameList in interface Clientpath - the path of the directory that we want the name list ofjava.io.IOException - an IO error occurredServerResponseException - the server reported an errorjava.io.FileNotFoundException - the requested path does not exist
public java.util.Vector getNameList()
throws java.io.IOException,
ServerResponseException,
java.io.FileNotFoundException
getNameList in interface Clientjava.io.IOException - an IO error occurredServerResponseException - the server reported an errorjava.io.FileNotFoundException - the requested path does not exist
public void get(java.lang.String path,
java.io.OutputStream out)
throws java.io.IOException,
java.io.FileNotFoundException,
ServerResponseException
get in interface Clientpath - the name of the file to GET. This can be a full or partial path.out - the OutputStream to write the file data tojava.io.IOException - an IO error occurredServerResponseException - the server reported an errorjava.io.FileNotFoundException - the given path does not exist
public Job createJob()
throws ServerResponseException,
java.io.IOException
createJob in interface ClientServerResponseException - java.io.IOException - an IO error occurred while communicating with the server
public Job getJob(long id)
throws ServerResponseException,
java.io.IOException
getJob in interface Clientid - the id of the job to getServerResponseException - java.io.IOException - an IO error occurred while communicating with the server
public void submit(Job job)
throws ServerResponseException,
java.io.IOException
submit in interface Clientjob - the Job to submitServerResponseException - java.io.IOException - an IO error occurred while communicating with the server
public void delete(Job job)
throws ServerResponseException,
java.io.IOException
delete in interface Clientjob - the (done or suspended) job to deleteServerResponseException - java.io.IOException - an IO error occurred while communicating with the server
public void suspend(Job job)
throws ServerResponseException,
java.io.IOException
suspend in interface Clientjob - the Job to suspendServerResponseException - java.io.IOException - an IO error occurred while communicating with the server
public void wait(Job job)
throws ServerResponseException,
java.io.IOException
wait in interface Clientjob - the job to wait forServerResponseException - java.io.IOException - an IO error occurred while communicating with the server
public void kill(Job job)
throws ServerResponseException,
java.io.IOException
kill in interface Clientjob - the job to killServerResponseException - java.io.IOException - an IO error occurred while communicating with the server
public void interrupt(Job job)
throws ServerResponseException,
java.io.IOException
interrupt in interface Clientjob - the job to interruptServerResponseException - java.io.IOException - an IO error occurred while communicating with the serverpublic void addConnectionListener(ConnectionListener listener)
addConnectionListener in interface ConnectionEventSourcelistener - the listener to register with the event sourcepublic void addConnectionListeners(java.util.Vector listeners)
addConnectionListeners in interface ConnectionEventSourcelisteners - the listeners to register with the event sourcepublic void removeConnectionListener(ConnectionListener listener)
removeConnectionListener in interface ConnectionEventSourcelistener - the listener to de-register with the event sourcepublic void addTransferListener(TransferListener listener)
addTransferListener in interface TransferEventSourcelistener - the listener to register with the event sourcepublic void addTransferListeners(java.util.Vector listeners)
addTransferListeners in interface TransferEventSourcelisteners - the listeners to register with the event sourcepublic void removeTransferListener(TransferListener listener)
removeTransferListener in interface TransferEventSourcelistener - the listener to de-register with the event sourcepublic static void main(java.lang.String[] Arguments)
Arguments - an array of command-line-argument Strings
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||