org.apache.excalibur.source.impl
Class FTPSource
java.lang.Object
org.apache.excalibur.source.impl.AbstractSource
org.apache.excalibur.source.impl.URLSource
org.apache.excalibur.source.impl.FTPSource
- All Implemented Interfaces:
- ModifiableSource, Source
- public class FTPSource
- extends URLSource
- implements ModifiableSource
Source implementation for the File Transfer Protocol.
- Author:
| Nested Class Summary |
private static class |
FTPSource.EnhancedFtpClient
Need to extend FtpClient in order to get to protected issueCommand and implement additional functionality. |
private static class |
FTPSource.FTPSourceOutputStream
Buffers the output in a byte array and only writes to the remote FTP location at closing time. |
| Fields inherited from class org.apache.excalibur.source.impl.AbstractSource |
|
| Method Summary |
boolean |
canCancel(java.io.OutputStream stream)
Can the data sent to an OutputStream returned by getOutputStream() be cancelled ? |
void |
cancel(java.io.OutputStream stream)
Cancel the data sent to an OutputStream returned by getOutputStream(). |
void |
delete()
Delete the source. |
private FTPSource.EnhancedFtpClient |
getFtpClient()
Creates an FtpClient and logs in the current user. |
protected void |
getInfos()
Get the last modification date and content length of the source. |
java.io.OutputStream |
getOutputStream()
Return an OutputStream to write to. |
private java.lang.String |
getPassword()
|
private java.lang.String |
getUser()
|
void |
init(java.net.URL url, java.util.Map parameters)
Initialize a new object from a URL. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
m_isAscii
private boolean m_isAscii
-
FTPSource
public FTPSource()
init
public void init(java.net.URL url,
java.util.Map parameters)
throws java.io.IOException
-
Initialize a new object from a
URL.
-
- Overrides:
init in class URLSource
-
- Parameters:
parameters - This is optional
- Throws:
java.io.IOException
canCancel
public boolean canCancel(java.io.OutputStream stream)
-
Can the data sent to an
OutputStream returned by getOutputStream() be cancelled ?
-
- Specified by:
canCancel in interface ModifiableSource
-
- Returns:
true if the stream can be cancelled
cancel
public void cancel(java.io.OutputStream stream)
throws java.io.IOException
-
Cancel the data sent to an
OutputStream returned by getOutputStream().
After cancel, the stream should not be used.
-
- Specified by:
cancel in interface ModifiableSource
-
- Throws:
java.io.IOException
delete
public void delete()
throws SourceException
-
Delete the source.
-
- Specified by:
delete in interface ModifiableSource
-
- Throws:
SourceException
getInfos
protected void getInfos()
-
Get the last modification date and content length of the source. Any exceptions are ignored.
-
- Overrides:
getInfos in class URLSource
-
getOutputStream
public java.io.OutputStream getOutputStream()
throws java.io.IOException
-
Return an
OutputStream to write to.
-
- Specified by:
getOutputStream in interface ModifiableSource
-
- Throws:
java.io.IOException
getFtpClient
private final FTPSource.EnhancedFtpClient getFtpClient()
throws java.io.IOException
-
Creates an FtpClient and logs in the current user.
-
-
- Throws:
java.io.IOException
getUser
private final java.lang.String getUser()
-
-
- Returns:
- the user part of the user info string,
null if there is no user info.
getPassword
private final java.lang.String getPassword()
-
-
- Returns:
- the password part of the user info string,
null if there is no user info.
Please see keelframework.org for information about new Keel releases.