Version 4.5.0
[nikiroo-utils.git] / src / be / nikiroo / utils / serial / Importer.java
index 8fba42d7e78e112ddc85b017904ec21510abfe5a..84fb5aae5742f49bcf68cd915906a2b7322a399b 100644 (file)
@@ -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 {