X-Git-Url: http://git.nikiroo.be/?p=jvcard.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Fjvcard%2Fresources%2FBundles.java;h=ef6e0d750ec2e9b80f518d3f756eab04787e114c;hp=b83b1b050d93fa3c56304f90f7138afc2fb28533;hb=47d06cf312c7f7a86b5861bb9a762c8856c4f58e;hpb=a1783d00d03245556a833bc02fbe2865225c2501 diff --git a/src/be/nikiroo/jvcard/resources/Bundles.java b/src/be/nikiroo/jvcard/resources/Bundles.java index b83b1b0..ef6e0d7 100644 --- a/src/be/nikiroo/jvcard/resources/Bundles.java +++ b/src/be/nikiroo/jvcard/resources/Bundles.java @@ -313,11 +313,29 @@ public class Bundles { * in case of IO error */ protected void writeValue(Writer writer, E id) throws IOException { - writer.write(id.name()); + writeValue(writer, id.name(), getString(id)); + } + + /** + * Write the given data to the config file, i.e., + * "MY_ID = my_curent_value" followed by a new line + * + * @param writer + * the {@link Writer} to write into + * @param id + * the id to write + * @param value + * the id's value + * + * @throws IOException + * in case of IO error + */ + protected void writeValue(Writer writer, String id, String value) + throws IOException { + writer.write(id); writer.write(" = "); - String[] lines = getString(id).replaceAll("\\\t", "\\\\\\t").split( - "\n"); + String[] lines = value.replaceAll("\\\t", "\\\\\\t").split("\n"); for (int i = 0; i < lines.length; i++) { writer.write(lines[i]); if (i < lines.length - 1) {