Class WebAppPropertyConverter


  • public class WebAppPropertyConverter
    extends java.lang.Object
    WebAppPropertyConverter Converts a webapp's configuration to a properties file, and vice versa.
    • Field Detail

      • WEB_XML

        public static java.lang.String WEB_XML
      • QUICKSTART_WEB_XML

        public static java.lang.String QUICKSTART_WEB_XML
      • CONTEXT_XML

        public static java.lang.String CONTEXT_XML
      • CONTEXT_PATH

        public static java.lang.String CONTEXT_PATH
      • TMP_DIR

        public static java.lang.String TMP_DIR
      • TMP_DIR_PERSIST

        public static java.lang.String TMP_DIR_PERSIST
      • BASE_DIRS

        public static java.lang.String BASE_DIRS
      • WAR_FILE

        public static java.lang.String WAR_FILE
      • CLASSES_DIR

        public static java.lang.String CLASSES_DIR
      • TEST_CLASSES_DIR

        public static java.lang.String TEST_CLASSES_DIR
      • LIB_JARS

        public static java.lang.String LIB_JARS
      • DEFAULTS_DESCRIPTOR

        public static java.lang.String DEFAULTS_DESCRIPTOR
      • OVERRIDE_DESCRIPTORS

        public static java.lang.String OVERRIDE_DESCRIPTORS
    • Constructor Detail

      • WebAppPropertyConverter

        public WebAppPropertyConverter()
    • Method Detail

      • toProperties

        public static void toProperties​(MavenWebAppContext webApp,
                                        java.io.File propsFile,
                                        java.lang.String contextXml)
                                 throws java.lang.Exception
        Convert a webapp to properties stored in a file.
        Parameters:
        webApp - the webapp to convert
        propsFile - the file to put the properties into
        contextXml - the optional context xml file related to the webApp
        Throws:
        java.lang.Exception - if any I/O exception occurs
      • fromProperties

        public static void fromProperties​(MavenWebAppContext webApp,
                                          java.lang.String resource,
                                          Server server,
                                          java.util.Map<java.lang.String,​java.lang.String> jettyProperties)
                                   throws java.lang.Exception
        Configure a webapp from a properties file.
        Parameters:
        webApp - the webapp to configure
        resource - the properties file to apply
        server - the Server instance to use
        jettyProperties - jetty properties to use if there is a context xml file to apply
        Throws:
        java.lang.Exception
      • fromProperties

        public static void fromProperties​(MavenWebAppContext webApp,
                                          java.util.Properties webAppProperties,
                                          Server server,
                                          java.util.Map<java.lang.String,​java.lang.String> jettyProperties)
                                   throws java.lang.Exception
        Configure a webapp from properties.
        Parameters:
        webApp - the webapp to configure
        webAppProperties - properties that describe the configuration of the webapp
        server - the jetty Server instance
        jettyProperties - jetty properties
        Throws:
        java.lang.Exception
      • fromProperties

        public static void fromProperties​(MavenWebAppContext webApp,
                                          java.io.File propsFile,
                                          Server server,
                                          java.util.Map<java.lang.String,​java.lang.String> jettyProperties)
                                   throws java.lang.Exception
        Configure a webapp from a properties file
        Parameters:
        webApp - the webapp to configure
        propsFile - the properties to apply
        server - the Server instance to use if there is a context xml file to apply
        jettyProperties - jetty properties to use if there is a context xml file to apply
        Throws:
        java.lang.Exception