@Test public void testCreateArchive_noMetaInfVault() throws Exception { final File testBase = new File(testOutDir, "testCreateArchive_noMetaInfVault"); final File archiveSrc = new File("src/test/resources/filevault/noMetaInfVault"); final File archiveRoot = new File(testBase, "noMetaInfVault"); FileUtils.deleteDirectory(archiveRoot); FileUtils.copyDirectory(archiveSrc, archiveRoot); WebsterPlan.Builder builder = new WebsterPlan.Builder(); builder.withArchiveRoot(archiveRoot); assertTrue("archiveRoot/jcr_root should exist", new File(archiveRoot, "jcr_root").exists()); assertFalse("archiveRoot/META-INF/vault should not exist", new File(archiveRoot, "META-INF/vault").exists()); builder.build().createArchive(); assertTrue("archiveRoot/META-INF/vault should exist now", new File(archiveRoot, "META-INF/vault").exists()); }
Archive createArchive() throws IOException { if (archiveRoot == null || !archiveRoot.isDirectory()) { throw new IllegalArgumentException("archiveRoot must be an existing directory"); } final FileArchive archive = new FileArchive(archiveRoot); if (!new File(archiveRoot, Constants.ROOT_DIR).exists()) { throw new IllegalArgumentException("archiveRoot must have a child jcr_root directory"); } final File archiveMetaInfVault = new File(archiveRoot, Constants.META_DIR); if (!archiveMetaInfVault.isDirectory()) { archiveMetaInfVault.mkdirs(); } archive.open(false); return archive; }
WebsterPlan { Archive createArchive() throws IOException { if (archiveRoot == null || !archiveRoot.isDirectory()) { throw new IllegalArgumentException("archiveRoot must be an existing directory"); } final FileArchive archive = new FileArchive(archiveRoot); if (!new File(archiveRoot, Constants.ROOT_DIR).exists()) { throw new IllegalArgumentException("archiveRoot must have a child jcr_root directory"); } final File archiveMetaInfVault = new File(archiveRoot, Constants.META_DIR); if (!archiveMetaInfVault.isDirectory()) { archiveMetaInfVault.mkdirs(); } archive.open(false); return archive; } }
WebsterPlan { Archive createArchive() throws IOException { if (archiveRoot == null || !archiveRoot.isDirectory()) { throw new IllegalArgumentException("archiveRoot must be an existing directory"); } final FileArchive archive = new FileArchive(archiveRoot); if (!new File(archiveRoot, Constants.ROOT_DIR).exists()) { throw new IllegalArgumentException("archiveRoot must have a child jcr_root directory"); } final File archiveMetaInfVault = new File(archiveRoot, Constants.META_DIR); if (!archiveMetaInfVault.isDirectory()) { archiveMetaInfVault.mkdirs(); } archive.open(false); return archive; } WebsterPlan(final @NotNull FixtureProvider fixtureProvider,
                final @NotNull List<WebsterTarget> targets,
                final @Nullable File globalSegmentStore,
                final @Nullable File archiveRoot); }
WebsterPlan { Archive createArchive() throws IOException { if (archiveRoot == null || !archiveRoot.isDirectory()) { throw new IllegalArgumentException("archiveRoot must be an existing directory"); } final FileArchive archive = new FileArchive(archiveRoot); if (!new File(archiveRoot, Constants.ROOT_DIR).exists()) { throw new IllegalArgumentException("archiveRoot must have a child jcr_root directory"); } final File archiveMetaInfVault = new File(archiveRoot, Constants.META_DIR); if (!archiveMetaInfVault.isDirectory()) { archiveMetaInfVault.mkdirs(); } archive.open(false); return archive; } WebsterPlan(final @NotNull FixtureProvider fixtureProvider,
                final @NotNull List<WebsterTarget> targets,
                final @Nullable File globalSegmentStore,
                final @Nullable File archiveRoot); void perform(); }
WebsterPlan { Archive createArchive() throws IOException { if (archiveRoot == null || !archiveRoot.isDirectory()) { throw new IllegalArgumentException("archiveRoot must be an existing directory"); } final FileArchive archive = new FileArchive(archiveRoot); if (!new File(archiveRoot, Constants.ROOT_DIR).exists()) { throw new IllegalArgumentException("archiveRoot must have a child jcr_root directory"); } final File archiveMetaInfVault = new File(archiveRoot, Constants.META_DIR); if (!archiveMetaInfVault.isDirectory()) { archiveMetaInfVault.mkdirs(); } archive.open(false); return archive; } WebsterPlan(final @NotNull FixtureProvider fixtureProvider,
                final @NotNull List<WebsterTarget> targets,
                final @Nullable File globalSegmentStore,
                final @Nullable File archiveRoot); void perform();  }