Class WebAppSettings


  • public class WebAppSettings
    extends Object
    It holds some settings regarding the WebApp execution context like, for instance, the home directory where the webapp has been deployed.
    • Method Detail

      • formatDirectory

        protected String formatDirectory​(String dir)
        Format a directory according to the file system separator
      • getRootDir

        public String getRootDir()
        Retrieve the webapp's root directory => The directory where the container deploys the WAR content.
        Returns:
        An absolute path.
      • setRootDir

        public void setRootDir​(String dir)
        Overwrites the webapp's root directory.

        This method is only intended to be called at bootstrap time by the WebAppListener. Changing the root directory may cause the webapp to severely fail.

      • getAbsolutePath

        public Path getAbsolutePath​(String... relativePath)
        Calculate the absolute path of a directory placed under the the webapp's directory structure.
        Parameters:
        relativePath - The relative path
        Returns:
        An absolute path