@Test(expected = IllegalArgumentException.class) public void testCreateArchive_nullArchiveRoot() throws Exception { WebsterPlan.Builder builder = new WebsterPlan.Builder(); builder.build().createArchive(); }
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();  }