Package org.apache.http.client.utils

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


      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


      return new Callable<Response>() {
        @Override
        public Response call() throws Exception {
          URIBuilder uri = uri( Hdfs.SERVICE_PATH, from );
          addQueryParam( uri, "op", "OPEN" );
          HttpGet request = new HttpGet( uri.build() );
          return new Response( execute( request ), to );
        }
      };
    }
View Full Code Here

      return new Callable<Response>() {
        @Override
        public Response call() throws Exception {
          URIBuilder uri = uri( Hdfs.SERVICE_PATH, dir );
          addQueryParam( uri, "op", "LISTSTATUS" );
          HttpGet get = new HttpGet( uri.build() );
          return new Response( execute( get ) );
        }
      };
    }
View Full Code Here

          URIBuilder uri = uri( Job.SERVICE_PATH, "/hive" );
          addParam( params, "group", group );
          addParam( params, "file", file );
          addParam( params, "statusdir", statusDir );
          UrlEncodedFormEntity form = new UrlEncodedFormEntity( params );
          HttpPost request = new HttpPost( uri.build() );
          request.setEntity( form );
          return new Response( execute( request ) );
        }
      };
    }
View Full Code Here

        @Override
        public Response call() throws Exception {
          URIBuilder uri = uri( Hdfs.SERVICE_PATH, file );
          addQueryParam( uri, "op", "DELETE" );
          addQueryParam( uri, "recursive", recursive );
          HttpDelete request = new HttpDelete( uri.build() );
          return new Response( execute( request ) );
        }
      };
    }
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

    protected Callable<Response> callable() {
      return new Callable<Response>() {
        @Override
        public Response call() throws Exception {
          URIBuilder uri = uri( Job.SERVICE_PATH, "/queue/", jobId );
          HttpGet request = new HttpGet( 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( Workflow.SERVICE_PATH, "/job/", jobId );
          HttpGet request = new HttpGet( uri.build() );
          return new Response( execute( request ) );
        }
      };
    }
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

    protected Callable<Response> callable() {
      return new Callable<Response>() {
        @Override
        public Response call() throws Exception {
          URIBuilder uri = uri( Job.SERVICE_PATH, "/queue" );
          HttpGet request = new HttpGet( uri.build() );
          return new Response( execute( request ) );
        }
      };
    }
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.