|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bristle.javalib.net.ftp.Ftp
public class Ftp
This class supports the ability to transfer files via FTP.
Usage: - The typical scenario for using this class is: Ftp ftp = new Ftp(); ftp.connect(strServer, strUsername, strPassword); ftp.putAsciiFile(strFilename, strContent); ftp.disconnect(); - See the source code of the inner Tester class for more examples. Assumptions: Effects: - Transfers files via FTP. Anticipated Changes: - Add more FTP features. Currently, it supports only FTP PUT of ASCII files. Notes: Implementation Notes: Portability Issues: Revision History: $Log$
Nested Class Summary | |
---|---|
static class |
Ftp.FtpException
This exception is thrown when something goes wrong during the FTP transfer. |
static class |
Ftp.Tester
Each class contains a Tester inner class with a main() for easier unit testing. |
Constructor Summary | |
---|---|
Ftp()
|
Method Summary | |
---|---|
void |
connect(String strServer,
String strUsername,
String strPassword)
Connect to the FTP server and login. |
void |
disconnect()
Disconnect from the FTP server. |
void |
putAsciiFile(String strFilename,
Reader readerContent)
PUT an ASCII file to the FTP server. |
void |
putAsciiFile(String strFilename,
String strContent)
PUT an ASCII file to the FTP server. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Ftp()
Method Detail |
---|
public void connect(String strServer, String strUsername, String strPassword) throws Ftp.FtpException, IOException
strServer
- DNS name or IP address of FTP server.strUsername
- Username for logging in to server.strPassword
- Password for logging in to server.
Ftp.FtpException
- When an FTP error, like login failure, occurs.
IOException
- When an I/O error occurs.public void disconnect() throws Ftp.FtpException, IOException
Ftp.FtpException
- When an FTP error occurs.
IOException
- When an I/O error occurs.public void putAsciiFile(String strFilename, Reader readerContent) throws Ftp.FtpException, IOException
strFilename
- Name of file to create on server.readerContent
- Reader containing content to write to the
file.
Ftp.FtpException
- When an FTP error, like permission denied,
occurs.
IOException
- When an I/O error occurs.public void putAsciiFile(String strFilename, String strContent) throws Ftp.FtpException, IOException
strFilename
- Name of file to create on server.strContent
- String to write to the file.
Ftp.FtpException
- When an FTP error, like permission denied,
occurs.
IOException
- When an I/O error occurs.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |