public static Bulletin loadFromFileAsNewDraft(MartusCrypto security, File inputFile) throws Exception { Bulletin original = new Bulletin(security); BulletinZipImporter.loadFromFile(original, inputFile, security); Bulletin imported = new Bulletin( security, original.getTopSectionFieldSpecs(), original.getBottomSectionFieldSpecs()); imported.createDraftCopyOf(original, null); return imported; }
public static void loadFromZipString(Bulletin b, String zipString, MartusCrypto sigVerifier) throws IOException, StreamableBase64.InvalidBase64Exception { File tempFile = null; try { tempFile = StreamableBase64.decodeToTempFile(zipString); BulletinZipImporter.loadFromFile(b, tempFile, sigVerifier); } finally { if (tempFile != null) tempFile.delete(); } }