if (content.hasLocale(contentLocale)) {
content.removeLocale(contentLocale);
}
content.addLocale(cms, contentLocale);
addEntityAttributes(cms, content, "", entity, contentLocale);
<BUG>writeContent(cms, file, content, getFileEncoding(cms, file));
} catch (Exception e) {</BUG>
error(e);
}
}

if (content.hasLocale(contentLocale)) {
content.removeLocale(contentLocale);
}
content.addLocale(cms, contentLocale);
addEntityAttributes(cms, content, "", entity, contentLocale);
writeContent(cms, file, content, getFileEncoding(cms, file));
tryUnlock(resource);
} catch (Exception e) {
error(e);
}
}
