fr.paris.lutece.plugins.ods.utils.commons
Class FTPUtils

java.lang.Object
  extended by fr.paris.lutece.plugins.ods.utils.commons.FTPUtils

public final class FTPUtils
extends java.lang.Object


Method Summary
static boolean allFtpParametersRequiered(java.lang.String strHost, java.lang.String strUserName, java.lang.String strPassword, java.lang.String strCurentDirectory, java.lang.String strLockFilePublication, java.lang.String strLockFileTransfert, java.lang.String strLocalDirectory)
          Test si l'ensemble des parametres de configarations nécessaires au transfert vers ODS CP(parametres FTP,configuration du repertoire locale...)
static org.apache.commons.net.ftp.FTPClient ftpConnexion(java.lang.String strHost, java.lang.String strUserName, java.lang.String strPassword)
           
static boolean isLockPublication(org.apache.commons.net.ftp.FTPClient ftpClient, java.lang.String strDirLock, java.lang.String strFileLock)
          Test si un verrou empechant le transfert est present dans le repertoire strDirLock
static boolean removeLockOds(org.apache.commons.net.ftp.FTPClient ftpClient, java.lang.String strDirLock, java.lang.String strFileLock, java.lang.String strHost, java.lang.String strUserName, java.lang.String strPassword)
          Supprime le verrou ods dans le repertoire strDirLock
static boolean setLockOds(org.apache.commons.net.ftp.FTPClient ftpClient, java.lang.String strDirLock, java.lang.String strFileLock)
          Positionne le verrou ods dans le repertoire strDirLock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

allFtpParametersRequiered

public static boolean allFtpParametersRequiered(java.lang.String strHost,
                                                java.lang.String strUserName,
                                                java.lang.String strPassword,
                                                java.lang.String strCurentDirectory,
                                                java.lang.String strLockFilePublication,
                                                java.lang.String strLockFileTransfert,
                                                java.lang.String strLocalDirectory)
Test si l'ensemble des parametres de configarations nécessaires au transfert vers ODS CP(parametres FTP,configuration du repertoire locale...) ont été renseignés dans le fichier ods-ma.properties

Parameters:
strHost - strHost
strUserName - strUserName
strPassword - strPassword
strCurentDirectory - strCurentDirectory
strLockDirectory - strLockDirectory
strLockFilePublication - strLockFilePublication
strLockFileTransfert - strLockFileTransfert
strLocalDirectory - strLocalDirectory
Returns:
true si l'ensemble des parametres ont été renseigné, false sinon

ftpConnexion

public static org.apache.commons.net.ftp.FTPClient ftpConnexion(java.lang.String strHost,
                                                                java.lang.String strUserName,
                                                                java.lang.String strPassword)
                                                         throws java.net.SocketException,
                                                                java.io.IOException
Parameters:
strHost - strHost
strUserName - strUserName
strPassword - strPassword
Returns:
FTPClient
Throws:
java.net.SocketException - socketException
java.io.IOException - iOException

isLockPublication

public static boolean isLockPublication(org.apache.commons.net.ftp.FTPClient ftpClient,
                                        java.lang.String strDirLock,
                                        java.lang.String strFileLock)
                                 throws java.io.IOException
Test si un verrou empechant le transfert est present dans le repertoire strDirLock

Parameters:
ftpClient - ftpClient
strDirLock - le chemin pour acceder du fichier verrou
strFileLock - le nom du fichier verrou
Returns:
true si un verrou a été posé, false sinon
Throws:
java.io.IOException - iOException

setLockOds

public static boolean setLockOds(org.apache.commons.net.ftp.FTPClient ftpClient,
                                 java.lang.String strDirLock,
                                 java.lang.String strFileLock)
                          throws java.io.IOException
Positionne le verrou ods dans le repertoire strDirLock

Parameters:
ftpClient - ftpClient
strDirLock - le chemin pour acceder du fichier verrou
strFileLock - le nom du fichier verrou
Throws:
java.io.IOException - IOException

removeLockOds

public static boolean removeLockOds(org.apache.commons.net.ftp.FTPClient ftpClient,
                                    java.lang.String strDirLock,
                                    java.lang.String strFileLock,
                                    java.lang.String strHost,
                                    java.lang.String strUserName,
                                    java.lang.String strPassword)
                             throws java.net.SocketException,
                                    java.io.IOException
Supprime le verrou ods dans le repertoire strDirLock

Parameters:
ftpClient - ftpClient
strDirLock - le chemin pour acceder du fichier verrou
strFileLock - le nom du fichier verrou
Returns:
true si la suppression du verrou a bien été effectué, false sinon
Throws:
java.io.IOException
java.net.SocketException
java.io.IOException


Copyright © 2010 Mairie de Paris. All Rights Reserved.