/** * Create a {@link ZipInputStream} for the entries defined in this * archive. * @return The {@link ZipInputStream} for the entries in this archive. * @throws java.io.IOException Failed to create stream. */ public ZipInputStream toInputStream() throws IOException { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); toOutputStream(new ZipOutputStream(outputStream)); return new ZipInputStream(new ByteArrayInputStream(outputStream.toByteArray())); }
/** * Create a {@link ZipInputStream} for the entries defined in this * archive. * @return The {@link ZipInputStream} for the entries in this archive. * @throws java.io.IOException Failed to create stream. */ public ZipInputStream toInputStream() throws IOException { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); toOutputStream(new ZipOutputStream(outputStream)); return new ZipInputStream(new ByteArrayInputStream(outputStream.toByteArray())); }
/** * Create a {@link ZipInputStream} for the entries defined in this * archive. * @return The {@link ZipInputStream} for the entries in this archive. * @throws java.io.IOException Failed to create stream. */ public ZipInputStream toInputStream() throws IOException { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); toOutputStream(new ZipOutputStream(outputStream)); return new ZipInputStream(new ByteArrayInputStream(outputStream.toByteArray())); }
/** * Create an archive in the specified File containing entries * for the data contained in the streams supplied entries arg. * specifying the entry name and the value is a InputStream containing * the entry data. * @param file The archive file. * @throws java.io.IOException Write failure. */ public void toFile(File file) throws IOException { FileOutputStream fileOutputStream = new FileOutputStream(file); try { toOutputStream(new ZipOutputStream(fileOutputStream)); } finally { try { fileOutputStream.flush(); } finally { fileOutputStream.close(); } } }
/** * Create an archive in the specified File containing entries * for the data contained in the streams supplied entries arg. * specifying the entry name and the value is a InputStream containing * the entry data. * @param file The archive file. * @throws java.io.IOException Write failure. */ public void toFile(File file) throws IOException { FileOutputStream fileOutputStream = new FileOutputStream(file); try { toOutputStream(new ZipOutputStream(fileOutputStream)); } finally { try { fileOutputStream.flush(); } finally { fileOutputStream.close(); } } }
/** * Create an archive in the specified File containing entries * for the data contained in the streams supplied entries arg. * specifying the entry name and the value is a InputStream containing * the entry data. * @param file The archive file. * @throws java.io.IOException Write failure. */ public void toFile(File file) throws IOException { FileOutputStream fileOutputStream = new FileOutputStream(file); try { toOutputStream(new ZipOutputStream(fileOutputStream)); } finally { try { fileOutputStream.flush(); } finally { fileOutputStream.close(); } } }
/** * Write an EDI Mapping Model configuration set from the specified EDI Specification Reader. * @param ediSpecificationReader The configuration reader for the EDI interchange configuration set. * @param modelSetOutStream The EDI Mapping Model output Stream. * @param urn The URN for the EDI Mapping model configuration set. * @throws IOException Error writing Mapping Model configuration set. */ public static void fromSpec(EdiSpecificationReader ediSpecificationReader, ZipOutputStream modelSetOutStream, String urn) throws IOException { AssertArgument.isNotNull(ediSpecificationReader, "ediSpecificationReader"); AssertArgument.isNotNull(modelSetOutStream, "modelSetOutStream"); try { Archive archive = createArchive(ediSpecificationReader, urn); // Now output the generated archive... archive.toOutputStream(modelSetOutStream); } catch (Throwable t) { logger.fatal("Error while generating EDI Mapping Model archive for '" + urn + "'.", t); } finally { modelSetOutStream.close(); } }