Package org.apache.commons.httpclient.methods

Examples of org.apache.commons.httpclient.methods.PutMethod.sendData()


    try {
//          client.setDebug(1);
      client.startSession("localhost", portNumber);
      client.setCredentials(new Credentials("guest", "guest"));
      pm.setPath( resourceName );
      pm.sendData( new StringBufferInputStream(fileContent));
      client.executeMethod( pm );
     
      System.out.println( "PUT  to " + resourceName + " : " + pm.getStatusCode() +
                "  " + pm.getStatusText() +
                " (time: " + (System.currentTimeMillis() - startTime) + " ms)" );
View Full Code Here


        throws HttpException, IOException {

        setClient();
        PutMethod method = new PutMethod(HttpURL.getPathQuery(path));
        generateIfHeader(method);
        method.sendData(data);
        method.setDebug(debug);
        client.executeMethod(method);

        int statusCode = method.getStatusCode();
        setStatusCode(statusCode);
View Full Code Here

        throws HttpException, IOException {

        setClient();
        PutMethod method = new PutMethod(HttpURL.getPathQuery(path));
        generateIfHeader(method);
        method.sendData(is);
        method.setDebug(debug);
        client.executeMethod(method);

        int statusCode = method.getStatusCode();
        setStatusCode(statusCode);
View Full Code Here

        throws HttpException, IOException {

        setClient();
        PutMethod method = new PutMethod(HttpURL.getPath(path));
        generateIfHeader(method);
        method.sendData(data);
        method.setDebug(debug);
        client.executeMethod(method);

        int statusCode = method.getStatusCode();
        setStatusCode(statusCode);
View Full Code Here

        throws HttpException, IOException {

        setClient();
        PutMethod method = new PutMethod(HttpURL.getPath(path));
        generateIfHeader(method);
        method.sendData(file);
        method.setDebug(debug);
        client.executeMethod(method);

        int statusCode = method.getStatusCode();
        setStatusCode(statusCode);
View Full Code Here

        throws HttpException, IOException {

        setClient();
        PutMethod method = new PutMethod(HttpURL.getPath(path));
        generateIfHeader(method);
        method.sendData(url);
        method.setDebug(debug);
        client.executeMethod(method);

        int statusCode = method.getStatusCode();
        setStatusCode(statusCode);
View Full Code Here

    try {
//          client.setDebug(1);
      client.startSession("localhost", portNumber);
      client.setCredentials(new Credentials("guest", "guest"));
      pm.setPath( resourceName );
      pm.sendData( new ByteArrayInputStream(fileContent.getBytes()));
      client.executeMethod( pm );
     
      System.out.println( "PUT  to " + resourceName + " : " + pm.getStatusCode() +
                "  " + pm.getStatusText() +
                " (time: " + (System.currentTimeMillis() - startTime) + " ms)" );
View Full Code Here

            URLConnection connection = url.openConnection();

            method.setPath(concatenate(urlFile, path, "/"));
            method.setHeader("content-type", connection.getContentType());
            method.sendData(connection.getInputStream());
            client.executeMethod(method);
            int status = method.getStatusCode();
            if ((status != HttpStatus.SC_OK) &&
                (status != HttpStatus.SC_CREATED) &&
                (status != HttpStatus.SC_ACCEPTED) &&
View Full Code Here

        throws HttpException, IOException {

        setClient();
        PutMethod method = new PutMethod(HttpURL.getPath(path));
        generateIfHeader(method);
        method.sendData(url);
        method.setDebug(debug);
        client.executeMethod(method);

        int statusCode = method.getStatusCode();
        setStatusCode(statusCode);
View Full Code Here

        throws HttpException, IOException {

        setClient();
        PutMethod method = new PutMethod(HttpURL.getPathQuery(path));
        generateIfHeader(method);
        method.sendData(data);
        method.setDebug(debug);
        client.executeMethod(method);

        int statusCode = method.getStatusCode();
        setStatusCode(statusCode);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.