Class TomcatUtils


  • public final class TomcatUtils
    extends Object
    Utility methods for Tomcat.
    • Method Detail

      • containsContextFile

        public static boolean containsContextFile​(Deployable deployable)
        Tests whether the specified deployable is a Tomcat WAR and contains a META-INF/context.xml file.
        Parameters:
        deployable - The deployable to test, may be null.
        Returns:
        true if the deployable is a Tomcat WAR with a context file, false otherwise.
      • getExtraClasspath

        public static String getExtraClasspath​(WAR war,
                                               boolean xml)
        Gets the extra classpath for the WAR as a single string suitable for use within the context.xml.
        Parameters:
        war - The WAR being deployed, must not be null.
        xml - true to escape XML markup in the result, false to return a plain string.
        Returns:
        The WAR's extra classpath or null if none.
      • getExtraClasspath

        public static String[] getExtraClasspath​(WAR war)
        Gets the extra classpath for the WAR as a string array
        Parameters:
        war - The WAR being deployed, must not be null.
        Returns:
        The WAR's extra classpath or null if none.