FileAccessor fac = new FileAccessorContainer();
for (String field : fieldKeyLocaleValueMap.keySet()) {
LanguageFile lf = lfById.get(field);
Path path = lf.getPath();
String basePathId = path.getBasePathId();
Map<String, String> propsOfPath = getPropertiesOfPath(path,
basePaths.get(basePathId));
for (Locale targetLocale : localeMapping.values()) {
try {
fac.addFile(new FileAccessorProperties(propsOfPath, path
.getType(), targetLocale));
} catch (InvalidStateException e) {
// Should never happen
e.printStackTrace();
}
}
}
Map<FileAccessorProperties, OutputStream> outStreamMap = fac
.getOutputStreams();
for (String field : fieldKeyLocaleValueMap.keySet()) {
LanguageFile lf = lfById.get(field);
Path path = lf.getPath();
String basePathId = path.getBasePathId();
Map<String, String> propsOfPath = getPropertiesOfPath(path,
basePaths.get(basePathId));
Map<Locale, Map<String, String>> localeKeyValueMap = fieldKeyLocaleValueMap
.get(field);
for (Locale sourceLocale : localeMapping.keySet()) {
Map<String, String> keyValueMap = localeKeyValueMap
.get(sourceLocale);
FileAccessorProperties fap = new FileAccessorProperties(
propsOfPath, path.getType(), localeMapping
.get(sourceLocale));
Bundle bundle = BundleFactory.createEmptyBundle(
new BundleProps(fap), lf.getType().value());
for (String key : keyValueMap.keySet()) {