public void upLoadFtp(){
String successFilePath = extractAxml.getResourceString("successbackup")+"\\";
String failFilePath = extractAxml.getResourceString("failbackup")+"\\";
String xmlcurrentFile = extractAxml.getResourceString("FtpFilePath").trim();
File xmlsrcFilePath = new File(xmlcurrentFile);
File[] xmlsrcFiles = xmlsrcFilePath.listFiles();
if(xmlsrcFiles.length>0){
ExceptionUtil.loggerABApp(""," ", true, true,true);
ExceptionUtil.loggerABApp("","Start Upload file to FTP ", true, true,true);
FTPClient ftpClient = new FTPClient();
boolean conFtp = toFtp.loginToFtpServer(ftpClient);
if(conFtp){
for (int iX = 0; iX < xmlsrcFiles.length; iX++){
boolean istoFtp = false;
try {
istoFtp = toFtp.upLoadFile(ftpClient, xmlsrcFiles[iX]);
ExceptionUtil.loggerABApp("","upload file [ "+xmlsrcFiles[iX].getName()+" ] Success", true, true,true);
} catch (Exception e) {
String errorInfo = new Util().getResourceErrorInfo("Ftp_Upload_File_File");
errorInfo.replace("[file]", "["+ xmlsrcFiles[iX].getName()+" ]");
ExceptionUtil.loggerABApp(errorInfo,errorInfo, true, true,false);
// TODO Auto-generated catch block
e.printStackTrace();
}
String fileName = xmlcurrentFile+"\\"+xmlsrcFiles[iX].getName();
istoFtp = extractAxml.copyFile1(fileName,successFilePath+xmlsrcFiles[iX].getName(), failFilePath+xmlsrcFiles[iX].getName(), istoFtp);
if(istoFtp) extractAxml.deleteFile(fileName, "XML");
}
}
toFtp.closeFtp(ftpClient);
}else{
}
}
String successFilePath = extractAxml.getResourceString("successbackup")+"\\";
String failFilePath = extractAxml.getResourceString("failbackup")+"\\";
String xmlcurrentFile = extractAxml.getResourceString("FtpFilePath").trim();
File xmlsrcFilePath = new File(xmlcurrentFile);
File[] xmlsrcFiles = xmlsrcFilePath.listFiles();
if(xmlsrcFiles.length>0){
ExceptionUtil.loggerABApp(""," ", true, true,true);
ExceptionUtil.loggerABApp("","Start Upload file to FTP ", true, true,true);
FTPClient ftpClient = new FTPClient();
boolean conFtp = toFtp.loginToFtpServer(ftpClient);
if(conFtp){
for (int iX = 0; iX < xmlsrcFiles.length; iX++){
boolean istoFtp = false;
try {
istoFtp = toFtp.upLoadFile(ftpClient, xmlsrcFiles[iX]);
ExceptionUtil.loggerABApp("","upload file [ "+xmlsrcFiles[iX].getName()+" ] Success", true, true,true);
} catch (Exception e) {
String errorInfo = new Util().getResourceErrorInfo("Ftp_Upload_File_File");
errorInfo.replace("[file]", "["+ xmlsrcFiles[iX].getName()+" ]");
ExceptionUtil.loggerABApp(errorInfo,errorInfo, true, true,false);
// TODO Auto-generated catch block
e.printStackTrace();
}
String fileName = xmlcurrentFile+"\\"+xmlsrcFiles[iX].getName();
istoFtp = extractAxml.copyFile1(fileName,successFilePath+xmlsrcFiles[iX].getName(), failFilePath+xmlsrcFiles[iX].getName(), istoFtp);
if(istoFtp) extractAxml.deleteFile(fileName, "XML");
}
}
toFtp.closeFtp(ftpClient);
}else{
}
}