Class ServerConfigUtils
- java.lang.Object
-
- org.codehaus.cargo.container.liberty.internal.ServerConfigUtils
-
public final class ServerConfigUtils extends Object
A utility class holding useful methods for writing WebSphere Liberty server config files.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
close(PrintStream writer)
Closes aserver.xml
and writes the closingserver
element.static PrintStream
open(File xmlFile)
Opens a newserver.xml
for writing and writes the opening server elementstatic void
writeDataSource(PrintStream writer, DataSource ds)
Writes a datasource to the write.static void
writeLibrary(PrintStream writer, String id, String[] cp)
Write a library.
-
-
-
Method Detail
-
open
public static PrintStream open(File xmlFile) throws IOException
Opens a newserver.xml
for writing and writes the opening server element- Parameters:
xmlFile
- the file to write into- Returns:
- a print stream for writing into
- Throws:
IOException
- if an exception occurred
-
close
public static void close(PrintStream writer)
Closes aserver.xml
and writes the closingserver
element.- Parameters:
writer
- the print stream to close
-
writeLibrary
public static void writeLibrary(PrintStream writer, String id, String[] cp)
Write a library.- Parameters:
writer
- the writer to write the library toid
- 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.- Parameters:
writer
- the writer.ds
- the datasource.
-
-