[java-shib-profile] branch dev/IDP-2297 updated: IDP-2297 Explore extending the Plugin and Module Infrastructure to allow Jetty installation

Rod Widdowson rdw at steadingsoftware.com
Mon Jul 29 15:56:05 UTC 2024


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch dev/IDP-2297
in repository java-shib-profile.

View the commit online:
http://git.shibboleth.net/view/?p=java-shib-profile.git;a=commit;h=b8095756acee1f6553b3d436f2515517b173eb9d

The following commit(s) were added to refs/heads/dev/IDP-2297 by this push:
     new b809575  IDP-2297 Explore extending the Plugin and Module Infrastructure to allow Jetty installation
b809575 is described below

commit b8095756acee1f6553b3d436f2515517b173eb9d
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Mon Jul 29 16:55:13 2024 +0100

    IDP-2297 Explore extending the Plugin and Module Infrastructure to allow Jetty installation
    
    https://shibboleth.atlassian.net/browse/IDP-2297
    
    Add support for packages to have meaningful top level contents
---
 .../java/net/shibboleth/profile/plugin/Plugin.java |  3 +++
 .../profile/plugin/PropertyDrivenPlugin.java       | 31 ++++++++++++++++------
 2 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/shib-profile-api/src/main/java/net/shibboleth/profile/plugin/Plugin.java b/shib-profile-api/src/main/java/net/shibboleth/profile/plugin/Plugin.java
index 4bc697d..5a3bd18 100644
--- a/shib-profile-api/src/main/java/net/shibboleth/profile/plugin/Plugin.java
+++ b/shib-profile-api/src/main/java/net/shibboleth/profile/plugin/Plugin.java
@@ -137,5 +137,8 @@ public interface Plugin<T extends Module> {
     	 * @return
     	 */
     	boolean isNonWindows();
+
+        /** Is there a meaningless top level directory? */
+        boolean isStripTopLevelDir();
     }
 }
\ No newline at end of file
diff --git a/shib-profile-api/src/main/java/net/shibboleth/profile/plugin/PropertyDrivenPlugin.java b/shib-profile-api/src/main/java/net/shibboleth/profile/plugin/PropertyDrivenPlugin.java
index a783d81..c8f8137 100644
--- a/shib-profile-api/src/main/java/net/shibboleth/profile/plugin/PropertyDrivenPlugin.java
+++ b/shib-profile-api/src/main/java/net/shibboleth/profile/plugin/PropertyDrivenPlugin.java
@@ -76,12 +76,15 @@ public abstract class PropertyDrivenPlugin<T extends Module> extends AbstractPlu
     /** Postfix for the destination package properties. */
     @Nonnull @NotEmpty public static final String PLUGIN_PACKAGE_DESTNATION_PROPERTY = ".destination";
 
-    /** Postfix for the windows package properties. */
+    /** Postfix for the windows package properties. Default true.  */
     @Nonnull @NotEmpty public static final String PLUGIN_PACKAGE_WINDOWS_PROPERTY = ".windows";
 
-    /** Postfix for the non-windows package properties. */
+    /** Postfix for the non-windows package properties. Default true. */
     @Nonnull @NotEmpty public static final String PLUGIN_PACKAGE_NONWINDOWS_PROPERTY = ".nonwindows";
 
+    /** Postfix for the non-windows package properties. Default true. */
+    @Nonnull @NotEmpty public static final String PLUGIN_PACKAGE_STRIP_TLD_PROPERTY = ".stripTopLevelDir";
+
     /** Class logger. */
     @Nonnull private Logger log = LoggerFactory.getLogger(PropertyDrivenPlugin.class);
 
@@ -199,11 +202,13 @@ public abstract class PropertyDrivenPlugin<T extends Module> extends AbstractPlu
                 break;
             }
             final boolean nonWin =  Boolean.valueOf(
-                 pluginProperties.getProperty(PLUGIN_PACKAGE_PROPERTY  + packageNumStr + PLUGIN_PACKAGE_NONWINDOWS_PROPERTY, "false"));
+                 pluginProperties.getProperty(PLUGIN_PACKAGE_PROPERTY  + packageNumStr + PLUGIN_PACKAGE_NONWINDOWS_PROPERTY, "true"));
             final boolean win =  Boolean.valueOf(
-                 pluginProperties.getProperty(PLUGIN_PACKAGE_PROPERTY  + packageNumStr + PLUGIN_PACKAGE_WINDOWS_PROPERTY, "false"));
+                 pluginProperties.getProperty(PLUGIN_PACKAGE_PROPERTY  + packageNumStr + PLUGIN_PACKAGE_WINDOWS_PROPERTY, "true"));
+            final boolean stripTld =  Boolean.valueOf(
+                    pluginProperties.getProperty(PLUGIN_PACKAGE_PROPERTY  + packageNumStr + PLUGIN_PACKAGE_STRIP_TLD_PROPERTY, "true"));
 
-            packages.add(new PackageDescriptor(srcStr, destStr, nonWin, win));
+            packages.add(new PackageDescriptor(srcStr, destStr, nonWin, win, stripTld));
         }
         setPackages(packages);
 
@@ -284,6 +289,9 @@ public abstract class PropertyDrivenPlugin<T extends Module> extends AbstractPlu
         /** What to return to {@link Plugin.Package#isWindows()}. */
         private final boolean windows;
 
+        /** What to return to {@link Plugin.Package#isStripTopLevelDir()}. */
+        private final boolean stripToplLevelDir;
+
         /**
          * Constructor.
          *
@@ -292,11 +300,12 @@ public abstract class PropertyDrivenPlugin<T extends Module> extends AbstractPlu
          * @param nonWin for{@link #isNonWindows()}
          * @param win for {@link #isWindows()}
          */
-        private PackageDescriptor(@Nonnull final String src, @Nonnull final String dest, final boolean nonWin, final boolean win) {
+        private PackageDescriptor(@Nonnull final String src, @Nonnull final String dest, final boolean nonWin, final boolean win, final boolean stripTld) {
             source = src;
             destination = dest;
             nonWindows = nonWin;
             windows = win;
+            stripToplLevelDir = stripTld;
         }
 
         /** {@inheritDoc} */
@@ -325,7 +334,13 @@ public abstract class PropertyDrivenPlugin<T extends Module> extends AbstractPlu
             return nonWindows;
         }
 
-        /** {@inheritDoc}.  Hashing and equality os slightly weird because we want to deduplicate on {{@link #destination} only */
+        /** {@inheritDoc} */
+        @Override
+        public boolean isStripTopLevelDir() {
+            return stripToplLevelDir;
+        }
+
+        /** {@inheritDoc}.  Hashing and equality is slightly weird because we want to deduplicate on {{@link #destination} only */
         @Override
         public boolean equals(Object obj) {
             if (obj == null) {
@@ -337,7 +352,7 @@ public abstract class PropertyDrivenPlugin<T extends Module> extends AbstractPlu
             return false;
         }
 
-        /** {@inheritDoc}.  Hashing and equality os slightly weird because we want to deduplicate on {{@link #destination} only */
+        /** {@inheritDoc}.  Hashing and equality is slightly weird because we want to deduplicate on {{@link #destination} only */
         @Override
         public int hashCode() {
             return destination.hashCode();

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list