Author: keith Date: Tue Jul 29 01:59:34 2008 New Revision: 20087 URL: http://wso2.org/svn/browse/wso2?view=rev&revision=20087
Log: Fixing Mashup-1020 Modified: trunk/mashup/java/modules/admin/service/src/org/wso2/mashup/admin/service/MashupDataServiceAdmin.java Modified: trunk/mashup/java/modules/admin/service/src/org/wso2/mashup/admin/service/MashupDataServiceAdmin.java URL: http://wso2.org/svn/browse/wso2/trunk/mashup/java/modules/admin/service/src/org/wso2/mashup/admin/service/MashupDataServiceAdmin.java?rev=20087&r1=20086&r2=20087&view=diff ============================================================================== --- trunk/mashup/java/modules/admin/service/src/org/wso2/mashup/admin/service/MashupDataServiceAdmin.java (original) +++ trunk/mashup/java/modules/admin/service/src/org/wso2/mashup/admin/service/MashupDataServiceAdmin.java Tue Jul 29 01:59:34 2008 @@ -22,6 +22,7 @@ import org.apache.axiom.om.impl.builder.StAXOMBuilder; import org.apache.axiom.om.util.StAXUtils; import org.apache.axis2.AxisFault; +import org.apache.axis2.util.XMLPrettyPrinter; import org.apache.axis2.context.MessageContext; import org.apache.axis2.context.ServiceGroupContext; import org.apache.axis2.context.ConfigurationContext; @@ -39,7 +40,6 @@ import org.wso2.registry.RegistryConstants; import org.wso2.registry.exceptions.RegistryException; import org.wso2.registry.session.UserRegistry; -import org.wso2.javascript.rhino.JavaScriptEngineConstants; import org.wso2.utils.ServerConfiguration; import javax.xml.namespace.QName; @@ -48,11 +48,10 @@ import java.util.Iterator; import java.io.File; import java.io.IOException; -import java.io.BufferedWriter; -import java.io.FileWriter; import java.io.BufferedReader; import java.io.FileReader; import java.io.ByteArrayInputStream; +import java.io.FileOutputStream; public class MashupDataServiceAdmin extends org.wso2.wsas.admin.service.DataServiceAdmin { @@ -138,8 +137,8 @@ } try { - BufferedWriter out = new BufferedWriter(new FileWriter(dataServiceFilePath)); - configEle.serialize(out); + FileOutputStream out = new FileOutputStream(dataServiceFilePath); + XMLPrettyPrinter.prettify(configEle, out); out.close(); } catch (IOException e) { throw new AxisFault( @@ -150,6 +149,9 @@ throw new AxisFault("Error while serializing the config OMElement for the service " + serviceId, e); + } catch (Exception e) { + throw new AxisFault("Error while serializing the config OMElement for the service " + + serviceId, e); } } _______________________________________________ Mashup-dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/mashup-dev
