Class WAR


  • public final class WAR
    extends java.lang.Object
    Represents an exploded WAR file on a file system. This class primarily contains operations that generate various files that constitute a war file.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.io.File classDir
      "build/classes" directory under the work directory.
      java.io.File libDir
      "WEB-INF/lib" directory.
      java.io.File root
      The root directory of the war image.
      DeployedService service
      This war file is created for this service.
      java.io.File srcDir
      Directory to put additional generated source files.
      java.io.File webInfDir
      "WEB-INF" directory under the work directory.
    • Constructor Summary

      Constructors 
      Constructor Description
      WAR​(DeployedService service)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void copyClasspath​(Realm classpath)
      Copies the classpath specified by the given Path into WEB-INF/lib and WEB-INF/classes
      void copyResources​(java.io.File resourcesDir)
      Copies resources under the directory in to WEB-INF/classes
      void copyToClasses​(java.io.File... handlerConfigs)
      Copies handler files in to WEB-INF/classes
      void copyToWEBINF​(java.io.File file)
      Copies web.xml to WEB-INF/
      void copyWsit​(java.io.File wsitConf)  
      java.util.List<EndpointInfoBean> getEndpointsInfos()
      This method collects info about endpoints; it's being used for generating server side descriptors.
      java.util.List<java.io.File> getWSDL()
      Gets the path of the WSDL.
      void zipTo​(java.io.File archive)
      Creates a war archive from the exploded image at root.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • root

        public final java.io.File root
        The root directory of the war image.
      • classDir

        public final java.io.File classDir
        "build/classes" directory under the work directory. It is used often enough that it is created here to avoid typo errors.
      • webInfDir

        public final java.io.File webInfDir
        "WEB-INF" directory under the work directory. It is used often enough that it is created here to avoid typo errors.
      • libDir

        public final java.io.File libDir
        "WEB-INF/lib" directory.
      • srcDir

        public final java.io.File srcDir
        Directory to put additional generated source files.
      • service

        public final DeployedService service
        This war file is created for this service.
    • Method Detail

      • getEndpointsInfos

        public java.util.List<EndpointInfoBean> getEndpointsInfos()
                                                           throws java.lang.Exception
        This method collects info about endpoints; it's being used for generating server side descriptors.
        Returns:
        Throws:
        java.lang.Exception
      • zipTo

        public void zipTo​(java.io.File archive)
                   throws java.lang.Exception
        Creates a war archive from the exploded image at root.
        Throws:
        java.lang.Exception
      • copyClasspath

        public void copyClasspath​(Realm classpath)
                           throws java.lang.Exception
        Copies the classpath specified by the given Path into WEB-INF/lib and WEB-INF/classes
        Throws:
        java.lang.Exception
      • copyToClasses

        public void copyToClasses​(java.io.File... handlerConfigs)
        Copies handler files in to WEB-INF/classes
      • copyToWEBINF

        public void copyToWEBINF​(java.io.File file)
        Copies web.xml to WEB-INF/
      • copyResources

        public void copyResources​(java.io.File resourcesDir)
        Copies resources under the directory in to WEB-INF/classes
      • copyWsit

        public void copyWsit​(java.io.File wsitConf)
      • getWSDL

        @NotNull
        public java.util.List<java.io.File> getWSDL()
        Gets the path of the WSDL.

        This is either copied from the test data (for "fromwsdl" tests), or generated (for "fromjava" tests.) For fromjava tests with multiple WebService classes, you may get more than one WSDLs.

        In a situation where there's no WSDL and just provider service, the list may be empty.