String uuid = uuidObj.toString();
File tempFolder = new File(tempBaseFolder.getAbsolutePath() + "/" + dossier.getId().toString() + "/" + uuid);
if (tempFolder.exists()) deleteFolder(tempFolder);
tempFolder.mkdirs();
File template = new File(tempFolder.getAbsolutePath() + "/" + TEMPLATE_FILE_NAME);
ObjTemplate objTemplate = dossier.getActiveTemplate();
if (objTemplate != null) {
byte[] bytes = objTemplate.getContent();
FileOutputStream fos = new FileOutputStream(template);
fos.write(bytes);
fos.flush();
fos.close();
bytes = null;