fix export api
@@ -68,6 +68,9 @@ public class EntityWriter {
case GlobalRule:
writeEntity((GlobalRuleEntity) entity);
break;
+ case Manifest:
+ writeEntity((ManifestEntity) entity);
+ break;
default:
throw new RuntimeException("Unhandled entity type: " + entity.getEntityType().name());
}
@@ -86,6 +89,11 @@ public class EntityWriter {
zip.closeEntry();
}
+ private void writeEntity(ManifestEntity entity) throws IOException {
+ ZipEntry mdEntry = createZipEntry(EntityType.Manifest, "manifest-" + entity.exportedOn.toInstant().toString(), "json");
+ write(mdEntry, entity, ManifestEntity.class);
+ }
+
private void writeEntity(GroupEntity entity) throws IOException {
ZipEntry mdEntry = createZipEntry(EntityType.Group, entity.groupId, "json");
write(mdEntry, entity, GroupEntity.class);
@@ -128,6 +136,9 @@ public class EntityWriter {
case Group:
path = String.format("groups/%s.%s.%s", fileName, type.name(), fileExt);
break;
+ case Manifest:
+ path = String.format("%s.%s.%s", fileName, type.name(), fileExt);
+ break;
default:
throw new RuntimeException("Unhandled entity type: " + type.name());
}
