Package org.apache.http.client.utils

Examples of org.apache.http.client.utils.URIBuilder.build()


    protected Callable<Response> callable() {
      return new Callable<Response>() {
        @Override
        public Response call() throws Exception {
          URIBuilder uri = uri( Workflow.SERVICE_PATH, "/job/", jobId );
          HttpGet request = new HttpGet( uri.build() );
          return new Response( execute( request ) );
        }
      };
    }
View Full Code Here


        @Override
        public Response call() throws Exception {
          URIBuilder uri = uri( Hdfs.SERVICE_PATH, dir );
          addQueryParam( uri, "op", "MKDIRS" );
          addQueryParam( uri, "permissions", perm );
          HttpPut request = new HttpPut( uri.build() );
          return new Response( execute( request ) );
        }
      };
    }
View Full Code Here

          StreamResult result = new StreamResult( writer );
          DOMSource source = new DOMSource( document );
          transformer.transform( source, result );

          URIBuilder uri = uri( HBase.SERVICE_PATH, "/", tableName, "/scanner" );
          HttpPut request = new HttpPut( uri.build() );
          HttpEntity entity = new StringEntity( writer.toString(), ContentType.create( "text/xml", "UTF-8" ) );
          request.setEntity( entity );

          return new Response( execute( request ) );
        }
View Full Code Here

    protected Callable<Response> callable() {
      return new Callable<Response>() {
        @Override
        public Response call() throws Exception {
          URIBuilder uri = uri( HBase.SERVICE_PATH, "/", tableName, "/scanner/", scannerId );
          HttpDelete request = new HttpDelete( uri.build() );
          return new Response( execute( request ) );
        }
      };
    }
  }
View Full Code Here

    protected Callable<Response> callable() {
      return new Callable<Response>() {
        @Override
        public Response call() throws Exception {
          URIBuilder uri = uri( HBase.SERVICE_PATH, "/", tableName, "/scanner/", scannerId );
          HttpGet get = new HttpGet( uri.build() );
          get.setHeader( "Accept", "application/json" );
          return new Response( execute( get ) );
        }
      };
    }
View Full Code Here

      return new Callable<Response>() {
        @Override
        public Response call() throws Exception {
          URIBuilder uri = uri( Workflow.SERVICE_PATH, "/jobs" );
          addQueryParam( uri, "action", action );
          HttpPost request = new HttpPost( uri.build() );
          HttpEntity entity = null;
          if( text != null ) {
            entity = new StringEntity( text, ContentType.create( "application/xml", "UTF-8" ) );
          } else if( file != null ) {
            entity = new FileEntity( new File( file ), ContentType.create( "application/xml" ) );
View Full Code Here

          params.add( new BasicNameValuePair( "jar", jar ) );
          params.add( new BasicNameValuePair( "class", app ) );
          params.add( new BasicNameValuePair( "arg", input ) );
          params.add( new BasicNameValuePair( "arg", output ) );
          UrlEncodedFormEntity form = new UrlEncodedFormEntity( params );
          HttpPost request = new HttpPost( uri.build() );
          request.setEntity( form );
          return new Response( execute( request ) );
        }
      };
    }
View Full Code Here

      return new Callable<Response>() {
        @Override
        public Response call() throws Exception {
          URIBuilder uri = uri( Hdfs.SERVICE_PATH, to );
          addQueryParam( uri, "op", "CREATE" );
          HttpPut nn = new HttpPut( uri.build() );
          HttpResponse r = execute( nn );
          if( r.getStatusLine().getStatusCode() != HttpStatus.SC_TEMPORARY_REDIRECT ) {
            throw new HadoopException( r.getStatusLine().toString() );
          }
          EntityUtils.consumeQuietly( r.getEntity() );
View Full Code Here

    protected Callable<Response> callable() {
      return new Callable<Response>() {
        @Override
        public Response call() throws Exception {
          URIBuilder uri = uri( HBase.SERVICE_PATH, "/status/cluster" );
          HttpGet get = new HttpGet( uri.build() );
          get.setHeader( "Accept", "application/json" );
          return new Response( execute( get ) );
        }
      };
    }
View Full Code Here

    protected Callable<Response> callable() {
      return new Callable<Response>() {
        @Override
        public Response call() throws Exception {
          URIBuilder uri = uri( HBase.SERVICE_PATH, "/version/cluster" );
          HttpGet get = new HttpGet( uri.build() );
          get.setHeader( "Accept", "text/plain" );
          return new Response( execute( get ) );
        }
      };
    }
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.