}
final String currentAssetId = assetForm.getId();
final Asset asset = productMarketingService.getProductMarketingAssetById(currentAssetId);
MultipartFile multipartFile = assetForm.getFile();
if(multipartFile != null){
long size = multipartFile.getSize();
asset.setFileSize(size);
}
try {
if (multipartFile.getSize() > 0) {
String pathProductMarketingImage = multipartFile.getOriginalFilename();
String assetFileRootPath = engineSettingService.getSettingAssetFileRootPath().getDefaultValue();
assetFileRootPath.replaceAll("\\\\", "/");
if(assetFileRootPath.endsWith("/")){
assetFileRootPath = assetFileRootPath.substring(0, assetFileRootPath.length() - 1);
}
String assetProductMarketingFilePath = engineSettingService.getSettingAssetProductMarketingFilePath().getDefaultValue();
assetProductMarketingFilePath.replaceAll("\\\\", "/");
if(assetProductMarketingFilePath.endsWith("/")){
assetProductMarketingFilePath = assetProductMarketingFilePath.substring(0, assetProductMarketingFilePath.length() - 1);
}
if(!assetProductMarketingFilePath.startsWith("/")){
assetProductMarketingFilePath = "/" + assetProductMarketingFilePath;
}
String absoluteFilePath = assetFileRootPath + assetProductMarketingFilePath + "/" + asset.getType().toLowerCase() + "/" + pathProductMarketingImage;
InputStream inputStream = multipartFile.getInputStream();
URI url = new URI(absoluteFilePath);
File fileAsset;
try {
fileAsset = new File(url);
} catch(IllegalArgumentException e) {