if (smbShare.isUseTempFile()) {
String tempFileName = _path + smbShare.newTempFileSuffix();
SmbFile tempFile = createSmbFileObject(tempFileName);
tempFile.createNewFile();
Assert.isTrue(tempFile.canWrite(), "Temporary file [" + tempFileName + "] is not writable.");
FileCopyUtils.copy(_inputStream, tempFile.getOutputStream());
if (targetFile.exists() && smbShare.isReplaceFile()) {
targetFile.delete();