ArtificerArchive implements Serializable { public static void closeQuietly(ArtificerArchive archive) { try { if (archive != null) archive.close(); } catch (IOException e) { } } ArtificerArchive();  ArtificerArchive(File file);  ArtificerArchive(InputStream input); void close(); static void closeQuietly(ArtificerArchive archive); Collection<ArtificerArchiveEntry> getEntries(); InputStream getInputStream(ArtificerArchiveEntry entry); void addEntry(String path, BaseArtifactType metaData, InputStream content); void updateEntry(ArtificerArchiveEntry entry, InputStream content); File pack(); ArtificerArchiveEntry getEntry(String archivePath); boolean containsEntry(String archivePath); boolean removeEntry(String archivePath);  }
@Test public void testSrampArchiveFile() throws Exception { InputStream resourceAsStream = null; File tempFile = null; FileOutputStream tempFileStream = null; ArtificerArchive archive = null; try { resourceAsStream = ArtificerArchiveTest.class.getResourceAsStream("simple-sramp-archive.zip"); tempFile = File.createTempFile("sramp_test", "ar"); tempFileStream = new FileOutputStream(tempFile); IOUtils.copy(resourceAsStream, tempFileStream); } finally { IOUtils.closeQuietly(resourceAsStream); IOUtils.closeQuietly(tempFileStream); } try { archive = new ArtificerArchive(tempFile); File workDir = AtomTestUtils.getArchiveWorkDir(archive); Assert.assertNotNull(workDir); Assert.assertTrue(workDir.isDirectory()); Collection<File> files = FileUtils.listFiles(workDir, new String[] {"xsd", "atom"}, true); Assert.assertEquals(2, files.size()); Set<String> fnames = new HashSet<String>(); for (File f : files) { fnames.add(f.getName()); } Assert.assertTrue(fnames.contains("sample.xsd")); Assert.assertTrue(fnames.contains("sample.xsd.atom")); } finally { FileUtils.deleteQuietly(tempFile); ArtificerArchive.closeQuietly(archive); } }