@Test public void testDefaultContextRoot() throws Exception { WARArchive archive = DefaultWarDeploymentFactory.archiveFromCurrentApp(); assertThat(archive.getContextRoot()).isNull(); ContextPathArchivePreparer processor = new ContextPathArchivePreparer(archive); processor.process(); assertThat(archive.getContextRoot()).isNotNull(); assertThat(archive.getContextRoot()).isEqualTo("/"); }
@Override public void process() { WARArchive warArchive = archive.as(WARArchive.class); if (warArchive.getContextRoot() == null) { warArchive.setContextRoot(contextPath.get()); } UndertowExternalMountsAsset ut = null; if (mounts != null) { for (String mountPath : mounts) { Path staticPath = Paths.get(mountPath); if (!staticPath.isAbsolute()) { staticPath = Paths.get(System.getProperty("user.dir"), staticPath.toString()).normalize(); } if (ut == null) { ut = new UndertowExternalMountsAsset(); } ut.externalMount(staticPath.toString()); } } if (ut != null) { warArchive.add(ut, WARArchive.EXTERNAL_MOUNT_PATH); } }
ContextPathArchivePreparer implements DeploymentProcessor { @Override public void process() { WARArchive warArchive = archive.as(WARArchive.class); if (warArchive.getContextRoot() == null) { warArchive.setContextRoot(contextPath.get()); } UndertowExternalMountsAsset ut = null; if (mounts != null) { for (String mountPath : mounts) { Path staticPath = Paths.get(mountPath); if (!staticPath.isAbsolute()) { staticPath = Paths.get(System.getProperty("user.dir"), staticPath.toString()).normalize(); } if (ut == null) { ut = new UndertowExternalMountsAsset(); } ut.externalMount(staticPath.toString()); } } if (ut != null) { warArchive.add(ut, WARArchive.EXTERNAL_MOUNT_PATH); } } }
ContextPathArchivePreparer implements DeploymentProcessor { @Override public void process() { WARArchive warArchive = archive.as(WARArchive.class); if (warArchive.getContextRoot() == null) { warArchive.setContextRoot(contextPath.get()); } UndertowExternalMountsAsset ut = null; if (mounts != null) { for (String mountPath : mounts) { Path staticPath = Paths.get(mountPath); if (!staticPath.isAbsolute()) { staticPath = Paths.get(System.getProperty("user.dir"), staticPath.toString()).normalize(); } if (ut == null) { ut = new UndertowExternalMountsAsset(); } ut.externalMount(staticPath.toString()); } } if (ut != null) { warArchive.add(ut, WARArchive.EXTERNAL_MOUNT_PATH); } } @Inject  ContextPathArchivePreparer(Archive archive); }
ContextPathArchivePreparer implements DeploymentProcessor { @Override public void process() { WARArchive warArchive = archive.as(WARArchive.class); if (warArchive.getContextRoot() == null) { warArchive.setContextRoot(contextPath.get()); } UndertowExternalMountsAsset ut = null; if (mounts != null) { for (String mountPath : mounts) { Path staticPath = Paths.get(mountPath); if (!staticPath.isAbsolute()) { staticPath = Paths.get(System.getProperty("user.dir"), staticPath.toString()).normalize(); } if (ut == null) { ut = new UndertowExternalMountsAsset(); } ut.externalMount(staticPath.toString()); } } if (ut != null) { warArchive.add(ut, WARArchive.EXTERNAL_MOUNT_PATH); } } @Inject  ContextPathArchivePreparer(Archive archive); @Override void process(); }
ContextPathArchivePreparer implements DeploymentProcessor { @Override public void process() { WARArchive warArchive = archive.as(WARArchive.class); if (warArchive.getContextRoot() == null) { warArchive.setContextRoot(contextPath.get()); } UndertowExternalMountsAsset ut = null; if (mounts != null) { for (String mountPath : mounts) { Path staticPath = Paths.get(mountPath); if (!staticPath.isAbsolute()) { staticPath = Paths.get(System.getProperty("user.dir"), staticPath.toString()).normalize(); } if (ut == null) { ut = new UndertowExternalMountsAsset(); } ut.externalMount(staticPath.toString()); } } if (ut != null) { warArchive.add(ut, WARArchive.EXTERNAL_MOUNT_PATH); } } @Inject  ContextPathArchivePreparer(Archive archive); @Override void process();  }