Class WAR

    • Constructor Detail

      • WAR

        public WAR​(String war)
        Parameters:
        war - the location of the WAR being wrapped. This must point to either a WAR file or an expanded WAR directory.
    • Method Detail

      • setContext

        public void setContext​(String context)
        Parameters:
        context - the context name to use when deploying this WAR. If not specified by the user, then the default context name is computed from the name of WAR itself (without the file extension).
      • getContext

        public String getContext()
        Returns:
        the context name, either the computed name derived from the WAR file name or the name defined by the user. Note that this method doesn't return any leading "/" before the context name.
      • getType

        public DeployableType getType()
        Returns:
        the deployable's type (war, ear, etc)
      • setExtraClasspath

        public void setExtraClasspath​(String[] classpath)
        Sets additional classpath entries for the web application that usually reside outside of the WAR file to facilitate rapid development without fully assembling the WAR file. In general, this feature is meant for use with exploded WARs and as such is usually not supported for non-expanded WARs. If this method is use with tomcat container, the configuration must set TomcatPropertySet#COPY_WARS to false
        Parameters:
        classpath - The additional classpath entries for the web application, may be null.
      • getExtraClasspath

        public String[] getExtraClasspath()
        Gets additional classpath entries for the web application that usually reside outside of the WAR file to facilitate rapid development without fully assembling the WAR file.
        Returns:
        The additional classpath entries for the web application, never null.
      • getBaseFilename

        public String getBaseFilename()
        Similar to getFilename(), without the .war extension.
        Returns:
        The file or directory name for this WAR, taking into account the context.
      • getFilename

        public String getFilename()
        Deployable file name, taking into account the Deployable.getName(), including any deployable-specific aspects of it, and the escaping in order to avoid unwanted file system actions (for example, ensuring the file name contains no slashes).

        Default value is the Deployable file name.

        Value is calculated based on the WAR context and whether it is expanded or not.
        Specified by:
        getFilename in interface Deployable
        Overrides:
        getFilename in class AbstractDeployable
        Returns:
        The file or directory name for this deployable.