use of org.apache.commons.httpclient.methods.PutMethod in project sling by apache.
the class SlingIntegrationTestClient method upload.
/** Upload a file to the Sling repository
* @return the HTTP status code
*/
public int upload(String toUrl, InputStream is) throws IOException {
final PutMethod put = new PutMethod(toUrl);
put.setRequestEntity(new InputStreamRequestEntity(is));
return httpClient.executeMethod(put);
}
use of org.apache.commons.httpclient.methods.PutMethod in project sling by apache.
the class PutMethodServletTest method testPutMethodServletSpecificRT.
public void testPutMethodServletSpecificRT() throws Exception {
final PutMethod put = new PutMethod(testNodeRT.nodeUrl);
final int status = httpClient.executeMethod(put);
assertEquals("PUT to testNodeRT should return 200", 200, status);
final String content = put.getResponseBodyAsString();
assertServlet(content, PUT_SERVLET_SUFFIX);
}
Aggregations