You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ga...@apache.org on 2006/03/25 06:56:10 UTC

svn commit: r388710 - /webservices/axis/trunk/java/src/org/apache/axis/utils/Admin.java

Author: gawor
Date: Fri Mar 24 21:56:09 2006
New Revision: 388710

URL: http://svn.apache.org/viewcvs?rev=388710&view=rev
Log:
restore pretty for wsdd and separate function for writting engine config directly to a specific writer

Modified:
    webservices/axis/trunk/java/src/org/apache/axis/utils/Admin.java

Modified: webservices/axis/trunk/java/src/org/apache/axis/utils/Admin.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/src/org/apache/axis/utils/Admin.java?rev=388710&r1=388709&r2=388710&view=diff
==============================================================================
--- webservices/axis/trunk/java/src/org/apache/axis/utils/Admin.java (original)
+++ webservices/axis/trunk/java/src/org/apache/axis/utils/Admin.java Fri Mar 24 21:56:09 2006
@@ -39,6 +39,7 @@
 import java.io.FileInputStream;
 import java.io.StringReader;
 import java.io.StringWriter;
+import java.io.Writer;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 
@@ -206,20 +207,23 @@
         }
     }
 
-    /** Get an XML document representing this engine's configuration.
-     *
-     * This document is suitable for saving and reloading into the
-     * engine.
+    /** 
+     * Outputs XML document representing this engine's configuration
+     * to the specified writer. 
      *
      * @param engine the AxisEngine to work with
-     * @return an XML document holding the engine config
+     * @param writer the writer to which write the engine configuration.
+     *               This function does not close the writer.
      * @exception AxisFault
      */
-    public static Document listConfig(AxisEngine engine)
+    public static void listConfig(AxisEngine engine, Writer writer)
         throws AxisFault
     {
-        StringWriter writer = new StringWriter();
+        if (writer == null) {
+            return;
+        }
         SerializationContext context = new SerializationContext(writer);
+        context.setDisablePrettyXML(false);
         context.setPretty(true);
         try {
             EngineConfiguration config = engine.getConfig();
@@ -235,7 +239,22 @@
 
             throw new AxisFault(Messages.getMessage("noEngineWSDD"));
         }
+    }
 
+    /** Get an XML document representing this engine's configuration.
+     *
+     * This document is suitable for saving and reloading into the
+     * engine.
+     *
+     * @param engine the AxisEngine to work with
+     * @return an XML document holding the engine config
+     * @exception AxisFault
+     */
+    public static Document listConfig(AxisEngine engine)
+        throws AxisFault
+    {
+        StringWriter writer = new StringWriter();
+        listConfig(engine, writer);
         try {
             writer.close();
             return XMLUtils.newDocument(new InputSource(new StringReader(writer.getBuffer().toString())));