Update SftpHelper.java

This commit is contained in:
Zhang Xian 2021-09-09 22:59:14 +08:00 committed by GitHub
parent 908d0fda44
commit 42f125aabf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -242,5 +242,17 @@ public class SftpHelper extends FtpHelper {
throw DataXException.asDataXException(FtpReaderErrorCode.OPEN_FILE_ERROR, message);
}
}
@Override
public void deleteFile(String filePath) {
try{
channelSftp.rm(filePath);
}catch(SftpException e){
String message = String.format("删除文件 : [%s] 时出错,请确认文件:[%s]存在且配置的用户有权限读取", filePath, filePath);
LOG.error(message);
throw DataXException.asDataXException(FtpReaderErrorCode.OPEN_FILE_ERROR, message);
}
}
}