Package ubic.gemma.core.loader.util.ftp
Interface FTPClientFactory
- All Known Implementing Classes:
FTPClientFactoryImpl
public interface FTPClientFactory
Factory and pool for
FTPClient
.
You must make sure that the client is either recycled with recycleClient(URL, FTPClient)
or destroyed with
destroyClient(URL, FTPClient)
using a try-finally block.
Alternatively, one may abandon a client with abandonClient(URL, FTPClient)
with the benefit of not having to
wait for any pending reply by the FTP server.
- Author:
- poirigui
-
Method Summary
Modifier and TypeMethodDescriptionvoid
abandonClient
(URL url, org.apache.commons.net.ftp.FTPClient client) Abandon an FTP client.void
destroyClient
(URL url, org.apache.commons.net.ftp.FTPClient client) Destroy an FTP client that is known to be no-longer valid.org.apache.commons.net.ftp.FTPClient
getFtpClient
(URL url) Create an FTP client for the given URL.openStream
(URL url) Open an input stream for the given FTP URL.void
recycleClient
(URL url, org.apache.commons.net.ftp.FTPClient client) Recycle the FTP client so that it might be reused in the future.
-
Method Details
-
getFtpClient
Create an FTP client for the given URL.Once you're done with the client, you should consider recycling it with
recycleClient(URL, FTPClient)
. However, if you do so, make sure that all pending commands have completed withFTPClient.completePendingCommand()
.- Throws:
IOException
-
recycleClient
Recycle the FTP client so that it might be reused in the future. -
destroyClient
Destroy an FTP client that is known to be no-longer valid. -
abandonClient
Abandon an FTP client.Unlike
destroyClient(URL, FTPClient)
, no attempt will be made to gracefully logout. -
openStream
Open an input stream for the given FTP URL.The FTP client will be recycled once the stream is closed.
- Throws:
IOException
-