<html dir="ltr"><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style title="owaParaStyle"><!--P {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
--></style>
</head>
<body ocsi="x">
<div dir="ltr"><font color="#000000" size="2" face="Tahoma">I am writing this after going through all the archived lists.</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font>&nbsp;</div>
<div dir="ltr"><font size="2" face="tahoma">&nbsp;My input will be the&nbsp;repository.xml file created from the Guvnor(and stored in SVN), and I have to export it to another(production)&nbsp;guvnor instance.&nbsp; I am trying to automate the process of &quot;Exporting&quot; the&nbsp;repository.xml
 file to the Guvnor. </font></div>
<div dir="ltr"><font size="2" face="tahoma"></font>&nbsp;</div>
<div dir="ltr"><font size="2" face="tahoma">I tried using the Browser testing tools like HttpUnit, Selenium but since the front-end is&nbsp;gwt based, I am not successful.&nbsp;&nbsp; Now I am trying to use HttpURLConnection, but the server is just returning me a status of
 &quot;500&quot; when I am trying to hit &quot;<font color="#2a00ff" size="1"><font color="#2a00ff" size="1"></div>
<div dir="ltr">
<p><a href="http://localhost:12212/drools-guvnor/org.drools.guvnor.Guvnor/backup">http://localhost:12212/drools-guvnor/org.drools.guvnor.Guvnor/backup</a>&quot;</p>
</font></font></font></div>
<div dir="ltr"><font size="2" face="tahoma"></font>&nbsp;</div>
<div dir="ltr"><font size="2" face="tahoma">I would like to know if anyone did something similar to this?&nbsp;
</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font>&nbsp;</div>
<div dir="ltr"><font size="2" face="tahoma">This is what I am having right now.&nbsp; </font>
</div>
<div dir="ltr"><font size="2" face="tahoma"></font>&nbsp;</div>
<div dir="ltr"><font size="1">String&nbsp;urlString = &quot;<a href="http://localhost:12212/drools-guvnor/org.drools.guvnor.Guvnor/backup">http://localhost:12212/drools-guvnor/org.drools.guvnor.Guvnor/backup</a>&quot;;</font></div>
<div dir="ltr"><font size="1">try{</font></div>
<div dir="ltr"><font size="1">URL&nbsp;url = new URL(urlString);</font></div>
<div dir="ltr"><font size="1">&nbsp;conn = (HttpURLConnection) url.openConnection();<br>
&nbsp;conn.setDoOutput(true);</font></div>
<div dir="ltr"><font size="1">&nbsp;conn.setDoInput(true);<br>
&nbsp;conn.setRequestMethod(&quot;POST&quot;);<br>
&nbsp;conn.setRequestProperty(&quot;Content-Type&quot;, &quot;text/html,application/xhtml&#43;xml,application/xml&quot;);<br>
&nbsp;conn.setRequestProperty(&quot;packageImport&quot;, &quot;true&quot;);<br>
&nbsp;conn.setRequestProperty(&quot;importAsNew&quot;, &quot;true&quot;);</font></div>
<div dir="ltr"><font size="1">&nbsp;String&nbsp;proxyCredentials = username &#43; &quot;:&quot; &#43; password;<br>
&nbsp;// Configure the connection object to <br>
&nbsp;String&nbsp;encodedCredentials = new String(new Base64().encode(proxyCredentials.getBytes()), &quot;ASCII&quot;);<br>
&nbsp;encodedCredentials = encodedCredentials.replaceAll(&quot;\n&quot;, &quot;&quot;);<br>
&nbsp;conn.setRequestProperty(&quot;Authorization&quot;, &quot;Basic &quot; &#43; encodedCredentials);<br>
&nbsp;int&nbsp;responseCode = conn.getResponseCode();<br>
&nbsp;InputStream in = conn.getErrorStream();<br>
}</div>
</font>
<div dir="ltr"><font size="2" face="tahoma"></font>&nbsp;</div>
<div dir="ltr"><font size="2" face="tahoma"></font>&nbsp;</div>
<div dir="ltr"><font size="2" face="tahoma">Or do we have any Drools API for deployment of&nbsp;repository.xml to the repository?&nbsp;</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font>&nbsp;</div>
<div dir="ltr">&nbsp;</div>
<div dir="ltr"><font size="2" face="tahoma">Thank you.</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font>&nbsp;</div>
<div class="BodyFragment"><font size="2">
<div class="PlainText">SRINIVAS<br>
</div>
</font></div>
</body>
</html>