Class ServerConfigUtils

  • public final class ServerConfigUtils
    extends Object
    A utility class holding useful methods for writing WebSphere Liberty server config files.
    • Method Detail

      • open

        public static PrintStream open​(File xmlFile)
                                throws IOException
        Opens a new server.xml for writing and writes the opening server element
        xmlFile - the file to write into
        a print stream for writing into
        IOException - if an exception occurred
      • close

        public static void close​(PrintStream writer)
        Closes a server.xml and writes the closing server element.
        writer - the print stream to close
      • writeLibrary

        public static void writeLibrary​(PrintStream writer,
                                        String id,
                                        String[] cp)
        Write a library.
        writer - the writer to write the library to
        id - the id for the library, if null no id is written.
        cp - the classpath, must be non null
      • writeDataSource

        public static void writeDataSource​(PrintStream writer,
                                           DataSource ds)
        Writes a datasource to the write.
        writer - the writer.
        ds - the datasource.