|
|
|
@ -11,6 +11,7 @@ import org.apache.commons.io.IOUtils;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.io.FileInputStream;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.io.InputStream;
|
|
|
|
@ -168,11 +169,14 @@ public class IecClient implements ClientEventListener {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void getFile(String remotePath, String localPath, Integer todel) throws Exception {
|
|
|
|
|
GetFileAction gfa = new GetFileAction(localPath);
|
|
|
|
|
String tmpFile = localPath + ".tmp";
|
|
|
|
|
GetFileAction gfa = new GetFileAction(tmpFile);
|
|
|
|
|
clientAssociation.getFile(remotePath, gfa);
|
|
|
|
|
if (todel != null && todel == Constants.TRUE) {
|
|
|
|
|
clientAssociation.deleteFile(remotePath);
|
|
|
|
|
}
|
|
|
|
|
File file = new File(tmpFile);
|
|
|
|
|
file.renameTo(new File(localPath));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|