public class NoTmpUploadFileHandler extends Object implements UploadFileHandler
UploadFileHandler to handle no temporary files. Files are directly uploaded to targetFile.WORK_FILE_DIRECTORY| Constructor and Description |
|---|
NoTmpUploadFileHandler() |
| Modifier and Type | Method and Description |
|---|---|
String |
doExceptionHandling(com.jcraft.jsch.ChannelSftp channel,
String uploadFileName,
String targetFile,
boolean isUploadSuccessful)
do specialized ExceptionHandling depending on uploading strategy.
|
void |
doRenameToTargetFile(com.jcraft.jsch.ChannelSftp channel,
String uploadFileName,
String targetFileName)
rename uploadFileName to targetFileName, if uploadFile is a temporary file.
|
String |
getUploadFileName(String path,
String fileName)
return the temporary or not temporary uploadFileName
|
public String getUploadFileName(String path, String fileName)
UploadFileHandlergetUploadFileName in interface UploadFileHandlerpath - PathfileName - target FileNamepublic void doRenameToTargetFile(com.jcraft.jsch.ChannelSftp channel,
String uploadFileName,
String targetFileName)
throws com.jcraft.jsch.SftpException
UploadFileHandlerdoRenameToTargetFile in interface UploadFileHandlerchannel - ChannelSftpuploadFileName - temporary fileNametargetFileName - final target File Namecom.jcraft.jsch.SftpException - if renaming failspublic String doExceptionHandling(com.jcraft.jsch.ChannelSftp channel, String uploadFileName, String targetFile, boolean isUploadSuccessful)
UploadFileHandlerdoExceptionHandling in interface UploadFileHandlerchannel - ChannelSftpuploadFileName - (temporary) fileNametargetFile - target FilenameisUploadSuccessful - true if upLoad of temporary file was successful and only the renaming to final target file failsCopyright © 2017–2020. All rights reserved.