X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Futils%2Fserial%2FImporter.java;h=84fb5aae5742f49bcf68cd915906a2b7322a399b;hb=3f27754118de06bdfedce5574957a9bc9557a8dc;hp=8fba42d7e78e112ddc85b017904ec21510abfe5a;hpb=452f38c8b9e98215f4ed6def6f3f8fd5dfa75daa;p=nikiroo-utils.git diff --git a/src/be/nikiroo/utils/serial/Importer.java b/src/be/nikiroo/utils/serial/Importer.java index 8fba42d..84fb5aa 100644 --- a/src/be/nikiroo/utils/serial/Importer.java +++ b/src/be/nikiroo/utils/serial/Importer.java @@ -70,13 +70,22 @@ public class Importer { if (line.startsWith("ZIP:")) { try { - line = StringUtils.unzip64(line.substring("ZIP:" - .length())); + line = StringUtils.unbase64s( + line.substring("ZIP:".length()), true); } catch (IOException e) { throw new IOException( "Internal error when decoding ZIP content: input may be corrupt"); } read(line); + } else if (line.startsWith("B64:")) { + try { + line = StringUtils.unbase64s( + line.substring("B64:".length()), false); + } catch (IOException e) { + throw new IOException( + "Internal error when decoding B64 content: input may be corrupt"); + } + read(line); } else { processLine(line); } @@ -154,7 +163,8 @@ public class Importer { if (line.endsWith(":")) { // field value is compound currentFieldName = line.substring(0, line.length() - 1); - } else if (line.startsWith(":") || !line.contains(":")) { + } else if (line.startsWith(":") || !line.contains(":") + || line.startsWith("\"") || CustomSerializer.isCustom(line)) { // not a field value but a direct value me = SerialUtils.decode(line); } else {