|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Interface for an FTPConnection received from a FTPConnectionFactory.
A FTPConnection will be in a logged in state when returned from the factory. There is however no guarantee that it will stay in that mode due to FTP server timeout or socket timeout. A connection that is no longer in alive mode should be closed and a new connection must be retrived from the factory.
See FTPConnectionFactory for some examples.
| Method Summary | |
void |
cd(java.lang.String dir)
Change dir. |
void |
close()
Close the connection, effectively leaving it back to the factory. |
void |
deleteFile(java.lang.String pathname)
Delete specifyed file, pathname may contains directory path. |
java.io.InputStream |
get(java.lang.String url)
Get the specifyed file from the server. |
java.lang.String |
getWorkingDirectory()
Get the name of the working directory. |
boolean |
isAlive()
Check if connection is alive. |
java.util.List |
list(java.lang.String url)
List files in dir url or if single file list that file, to list files in the current directory use a . |
void |
mkdir(java.lang.String pathname)
Create a directory specifyed by pathname. |
void |
put(java.lang.String url,
java.io.InputStream localStream)
Put stream on server in file named by url, the url may denote a file with a directory path. |
void |
setBinaryMode(boolean binaryMode)
Set mode of connection, false means ascii mode. |
void |
setPassiveMode(boolean passiveMode)
Set passive mode. |
| Method Detail |
public void close()
public void setBinaryMode(boolean binaryMode)
throws FTPException
FTPException
public void setPassiveMode(boolean passiveMode)
throws FTPException
FTPExceptionpublic boolean isAlive()
This will also work as a ping, and may thefore be called from a ping thtread to keep the connection alive.
public java.util.List list(java.lang.String url)
throws FTPException
FTPFiles.
FTPException
public java.io.InputStream get(java.lang.String url)
throws FTPException
The input will be cached locally, and it is the callers responisbility to close the stream when used.
FTPException
public void put(java.lang.String url,
java.io.InputStream localStream)
throws FTPException
It is the resonibility of the caller to close the stream when the method return.
FTPException
public void deleteFile(java.lang.String pathname)
throws FTPException
FTPException
public void mkdir(java.lang.String pathname)
throws FTPException
FTPException
public java.lang.String getWorkingDirectory()
throws FTPException
FTPException
public void cd(java.lang.String dir)
throws FTPException
FTPException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||