You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
870 B
Java

package com.engine.custom.hg.util;
import com.dcfs.fts.client.FtpClientConfig;
import com.dcfs.fts.client.upload.FtpPut;
import com.dcfs.fts.common.error.FtpException;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
public class HgUtils {
static String tranCode = "025801";
public static String putFile(String localFileName, String remoteFileName) throws FtpException, IOException, FtpException {
FtpClientConfig config = FtpClientConfig.getInstance("/opt/weaver/ecology/WEB-INF/prop/FtpClientConfig.properties");
FtpPut ftpPut = new FtpPut(localFileName, remoteFileName, tranCode, true, true, config);
String filePath = ftpPut.doPutFile();
return filePath;
}
}