Package fr.ifremer.isisfish.util.ftp
Class FtpManager
java.lang.Object
fr.ifremer.isisfish.util.ftp.FtpManager
It's seams that it's not possible to use mutiple ftp connection to the same server. So this manager
will handle only one connection for all application.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringL'identifiant de la session ouverte.protected org.apache.commons.net.ftp.FTPClientprotected static FtpManager -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidstatic longgetFileSize(org.apache.commons.net.ftp.FTPClient ftpClient, String remotePath) org.apache.commons.net.ftp.FTPClientgetFtpClient(String host, int port, String login, String password) static FtpManagerprotected org.apache.commons.net.ftp.FTPClientopenFtpClient(String host, int port, String login, String password)
-
Field Details
-
instance
-
currentKey
L'identifiant de la session ouverte. Forme : login:password@host:port Si l'identifiant change, la précédente session est fermé et une autre et réouverte. -
currentSession
protected org.apache.commons.net.ftp.FTPClient currentSession
-
-
Constructor Details
-
FtpManager
public FtpManager()
-
-
Method Details
-
getInstance
-
getFtpClient
public org.apache.commons.net.ftp.FTPClient getFtpClient(String host, int port, String login, String password) throws IOException - Throws:
IOException
-
openFtpClient
protected org.apache.commons.net.ftp.FTPClient openFtpClient(String host, int port, String login, String password) throws IOException - Throws:
IOException
-
closeFtpClient
- Throws:
IOException
-
getFileSize
public static long getFileSize(org.apache.commons.net.ftp.FTPClient ftpClient, String remotePath) throws IOException - Throws:
IOException
-