FileUtils.getFileUtils().copyFile(destFile, backup);
}
if (overwrite || !destFile.isFile()) {
//copy template to destination, using filtering
FilterSetCollection filterset = new FilterSetCollection();
final FilterSet set = new FilterSet();
set.setFiltersfile(preferences);
filterset.addFilterSet(set);
FileUtils.getFileUtils().copyFile(templFile,destFile,filterset,true);
if(restrictedPermTemplates.contains(filename)) {
//remove write permissions of target file