String pathExportFolder = ImportUtilities.getImportTempFolderPath();
File file = new File(pathExportFolder + "/" + folderName + "/" + associationFileName + ".xml");
FileInputStream fis = new FileInputStream(file);
byte[] fileAssContent = GeneralUtilities.getByteArrayFromInputStream(fis);
fis.close();
IAssociationFileDAO assfiledao = new AssociationFileDAO();
if (assfiledao.exists(assFile.getId())) {
if (overwrite) {
assfiledao.deleteAssociationFile(assFile);
assfiledao.saveAssociationFile(assFile, fileAssContent);
} else {
logger.warn("Overwrite parameter is false: association file with id=[" + assFile.getId() + "] " +
"and name=[" + assFile.getName() + "] will not be saved.");
}
} else {
assfiledao.saveAssociationFile(assFile, fileAssContent);
}
htmlResp = msgBuild.getMessage("Sbi.saved.ok", "component_impexp_messages", locale);
} catch (Exception e) {
logger.error("Error wile saving the association file, ", e);
htmlResp = msgBuild.getMessage("Sbi.saved.ko", "component_impexp_messages", locale);