congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
HttpClientUtil.responseToString
Code IndexAdd Tabnine to your IDE (free)

How to use
responseToString
method
in
org.pentaho.di.core.util.HttpClientUtil

Best Java code snippets using org.pentaho.di.core.util.HttpClientUtil.responseToString (Showing top 20 results out of 315)

origin: pentaho/pentaho-kettle

/**
 *
 * @param response the httpresponse for processing
 * @param charset the charset used for getting HttpEntity
 * @return HttpEntity in decoded String representation using provided charset
 * @throws IOException
 */
public static String responseToString( HttpResponse response, Charset charset ) throws IOException {
 return responseToString( response, charset, false );
}
origin: pentaho/pentaho-kettle

/**
 *
 * @param response the httpresponse for processing
 * @return HttpEntity in String representation using "UTF-8" encoding
 * @throws IOException
 */
public static String responseToString( HttpResponse response ) throws IOException {
 return responseToString( response, Charset.forName( StandardCharsets.UTF_8.name() ) );
}
origin: pentaho/pdi-sdk-plugins

 public static void sendExecuteRequest( String urlString, String authentication ) throws Exception {
  HttpGet method = new HttpGet( urlString );
  HttpClientContext context = HttpClientUtil.createPreemptiveBasicAuthentication( host, port, user, password );
  method.addHeader( new BasicHeader( "Content-Type", "text/xml;charset=UTF-8" ) );
  //adding authorization token
  if ( authentication != null ) {
   method.addHeader( new BasicHeader( "Authorization", authentication ) );
  }

  //executing method
  HttpClient client = HttpClientManager.getInstance().createDefaultClient();
  HttpResponse httpResponse = context != null ? client.execute( method, context ) : client.execute( method );
  int code = httpResponse.getStatusLine().getStatusCode();
  String response = HttpClientUtil.responseToString( httpResponse );
  method.releaseConnection();
  if ( code >= HttpStatus.SC_BAD_REQUEST ) {
   System.out.println( "Error occurred during transformation execution." );
  }
  System.out.println( "Server response (expected to be empty):" );
  System.out.println( response );
 }
}
origin: pentaho/pdi-sdk-plugins

public static void allocateServerSocket( String urlString, String authentication ) throws Exception {
 HttpGet method = new HttpGet( urlString );
 HttpClientContext context = HttpClientUtil.createPreemptiveBasicAuthentication( host, port, user, password );
 method.addHeader( new BasicHeader( "Content-Type", "text/xml;charset=UTF-8" ) );
 //adding authorization token
 if ( authentication != null ) {
  method.addHeader( new BasicHeader( "Authorization", authentication ) );
 }
 //executing method
 HttpClient client = HttpClientManager.getInstance().createDefaultClient();
 HttpResponse httpResponse = context != null ? client.execute( method, context ) : client.execute( method );
 int code = httpResponse.getStatusLine().getStatusCode();
 String response = HttpClientUtil.responseToString( httpResponse );
 method.releaseConnection();
 if ( code >= HttpStatus.SC_BAD_REQUEST ) {
  System.out.println( "Error occurred during ports allocation." );
 }
 System.out.println( "Server response:" );
 System.out.println( response );
}
origin: pentaho/pdi-sdk-plugins

public static String sendStartJobRequest( String urlString, String authentication ) throws Exception {
 HttpGet method = new HttpGet( urlString );
 HttpClientContext context = HttpClientUtil.createPreemptiveBasicAuthentication( host, port, user, password );
 //adding authorization token
 if ( authentication != null ) {
  method.addHeader( new BasicHeader( "Authorization", authentication ) );
 }
 //executing method
 HttpClient client = HttpClientManager.getInstance().createDefaultClient();
 HttpResponse httpResponse = context != null ? client.execute( method, context ) : client.execute( method );
 int code = httpResponse.getStatusLine().getStatusCode();
 String response = HttpClientUtil.responseToString( httpResponse );
 method.releaseConnection();
 if ( code >= HttpStatus.SC_BAD_REQUEST ) {
  System.out.println( "Error occurred during starting job." );
  return null;
 }
 return response;
}
origin: pentaho/pdi-sdk-plugins

public static String sendPauseTransRequest( String urlString, String authentication ) throws Exception {
 HttpGet method = new HttpGet( urlString );
 HttpClientContext context = HttpClientUtil.createPreemptiveBasicAuthentication( host, port, user, password );
 //adding authorization token
 if ( authentication != null ) {
  method.addHeader( new BasicHeader( "Authorization", authentication ) );
 }
 //executing method
 HttpClient client = HttpClientManager.getInstance().createDefaultClient();
 HttpResponse httpResponse = context != null ? client.execute( method, context ) : client.execute( method );
 int code = httpResponse.getStatusLine().getStatusCode();
 String response = HttpClientUtil.responseToString( httpResponse );
 method.releaseConnection();
 if ( code >= HttpStatus.SC_BAD_REQUEST ) {
  System.out.println( "Error occurred during pausing transformation." );
  return null;
 }
 return response;
}
origin: pentaho/pdi-sdk-plugins

 public static void sendGetTransStatusRequest( String urlString, String authentication ) throws Exception {
  HttpGet method = new HttpGet( urlString );
  HttpClientContext context = HttpClientUtil.createPreemptiveBasicAuthentication( host, port, user, password );
  //adding authorization token
  if ( authentication != null ) {
   method.addHeader( new BasicHeader( "Authorization", authentication ) );
  }

  //executing method
  HttpClient client = HttpClientManager.getInstance().createDefaultClient();
  HttpResponse httpResponse = context != null ? client.execute( method, context ) : client.execute( method );
  int code = httpResponse.getStatusLine().getStatusCode();
  String response = HttpClientUtil.responseToString( httpResponse );
  method.releaseConnection();
  if ( code >= HttpStatus.SC_BAD_REQUEST ) {
   System.out.println( "Error occurred during getting job status." );
  }
  System.out.println( "Server response:" );
  System.out.println( response );
 }
}
origin: pentaho/pdi-sdk-plugins

public static void sendGetSlavesRequest( String urlString, String authentication ) throws Exception {
 HttpGet method = new HttpGet( urlString );
 HttpClientContext context = HttpClientUtil.createPreemptiveBasicAuthentication( host, port, user, password );
 //adding authorization token
 if ( authentication != null ) {
  method.addHeader( new BasicHeader( "Authorization", authentication ) );
 }
 //executing method
 HttpClient client = HttpClientManager.getInstance().createDefaultClient();
 HttpResponse httpResponse = context != null ? client.execute( method, context ) : client.execute( method );
 int code = httpResponse.getStatusLine().getStatusCode();
 String response = HttpClientUtil.responseToString( httpResponse );
 method.releaseConnection();
 if ( code >= HttpStatus.SC_BAD_REQUEST ) {
  System.out.println( "Error occurred during getting slave servers." );
 }
 System.out.println( "Server response:" );
 System.out.println( response );
}
origin: pentaho/pdi-sdk-plugins

public static String sendStopJobRequest( String urlString, String authentication ) throws Exception {
 HttpGet method = new HttpGet( urlString );
 HttpClientContext context = HttpClientUtil.createPreemptiveBasicAuthentication( host, port, user, password );
 //adding authorization token
 if ( authentication != null ) {
  method.addHeader( new BasicHeader( "Authorization", authentication ) );
 }
 //executing method
 HttpClient client = HttpClientManager.getInstance().createDefaultClient();
 HttpResponse httpResponse = context != null ? client.execute( method, context ) : client.execute( method );
 int code = httpResponse.getStatusLine().getStatusCode();
 String response = HttpClientUtil.responseToString( httpResponse );
 method.releaseConnection();
 if ( code >= HttpStatus.SC_BAD_REQUEST ) {
  System.out.println( "Error occurred during stopping job." );
  return null;
 }
 return response;
}
origin: pentaho/pdi-sdk-plugins

public static String sendGetJobStatusRequest( String urlString, String authentication ) throws Exception {
 HttpGet method = new HttpGet( urlString );
 HttpClientContext context = HttpClientUtil.createPreemptiveBasicAuthentication( host, port, user, password );
 //adding authorization token
 if ( authentication != null ) {
  method.addHeader( new BasicHeader( "Authorization", authentication ) );
 }
 //executing method
 HttpClient client = HttpClientManager.getInstance().createDefaultClient();
 HttpResponse httpResponse = context != null ? client.execute( method, context ) : client.execute( method );
 int code = httpResponse.getStatusLine().getStatusCode();
 String response = HttpClientUtil.responseToString( httpResponse );
 method.releaseConnection();
 if ( code >= HttpStatus.SC_BAD_REQUEST ) {
  System.out.println( "Error occurred during getting job status." );
  return null;
 }
 return response;
}
origin: pentaho/pdi-sdk-plugins

public static String sendStartTransRequest( String urlString, String authentication ) throws Exception {
 HttpGet method = new HttpGet( urlString );
 HttpClientContext context = HttpClientUtil.createPreemptiveBasicAuthentication( host, port, user, password );
 //adding authorization token
 if ( authentication != null ) {
  method.addHeader( new BasicHeader( "Authorization", authentication ) );
 }
 //executing method
 HttpClient client = HttpClientManager.getInstance().createDefaultClient();
 HttpResponse httpResponse = context != null ? client.execute( method, context ) : client.execute( method );
 int code = httpResponse.getStatusLine().getStatusCode();
 String response = HttpClientUtil.responseToString( httpResponse );
 method.releaseConnection();
 if ( code >= HttpStatus.SC_BAD_REQUEST ) {
  System.out.println( "Error occurred during starting transformation." );
  return null;
 }
 return response;
}
origin: pentaho/pdi-sdk-plugins

public static String sendPrepareExecutionTransRequest( String urlString, String authentication ) throws Exception {
 HttpGet method = new HttpGet( urlString );
 HttpClientContext context = HttpClientUtil.createPreemptiveBasicAuthentication( host, port, user, password );
 //adding authorization token
 if ( authentication != null ) {
  method.addHeader( new BasicHeader( "Authorization", authentication ) );
 }
 //executing method
 HttpClient client = HttpClientManager.getInstance().createDefaultClient();
 HttpResponse httpResponse = context != null ? client.execute( method, context ) : client.execute( method );
 int code = httpResponse.getStatusLine().getStatusCode();
 String response = HttpClientUtil.responseToString( httpResponse );
 method.releaseConnection();
 if ( code >= HttpStatus.SC_BAD_REQUEST ) {
  System.out.println( "Error occurred during preparing transformation execution." );
  return null;
 }
 return response;
}
origin: pentaho/pdi-sdk-plugins

public static String sendRemoveTransRequest( String urlString, String authentication ) throws Exception {
 HttpGet method = new HttpGet( urlString );
 HttpClientContext context = HttpClientUtil.createPreemptiveBasicAuthentication( host, port, user, password );
 //adding authorization token
 if ( authentication != null ) {
  method.addHeader( new BasicHeader( "Authorization", authentication ) );
 }
 //executing method
 HttpClient client = HttpClientManager.getInstance().createDefaultClient();
 HttpResponse httpResponse = context != null ? client.execute( method, context ) : client.execute( method );
 int code = httpResponse.getStatusLine().getStatusCode();
 String response = HttpClientUtil.responseToString( httpResponse );
 method.releaseConnection();
 if ( code >= HttpStatus.SC_BAD_REQUEST ) {
  System.out.println( "Error occurred during removing transformation." );
  return null;
 }
 return response;
}
origin: pentaho/pdi-sdk-plugins

public static String sendStopTransRequest( String urlString, String authentication ) throws Exception {
 HttpGet method = new HttpGet( urlString );
 HttpClientContext context = HttpClientUtil.createPreemptiveBasicAuthentication( host, port, user, password );
 //adding authorization token
 if ( authentication != null ) {
  method.addHeader( new BasicHeader( "Authorization", authentication ) );
 }
 //executing method
 HttpClient client = HttpClientManager.getInstance().createDefaultClient();
 HttpResponse httpResponse = context != null ? client.execute( method, context ) : client.execute( method );
 int code = httpResponse.getStatusLine().getStatusCode();
 String response = HttpClientUtil.responseToString( httpResponse );
 method.releaseConnection();
 if ( code >= HttpStatus.SC_BAD_REQUEST ) {
  System.out.println( "Error occurred during stopping transformation." );
  return null;
 }
 return response;
}
origin: pentaho/pdi-sdk-plugins

public static String sendSniffStepRequest( String urlString, String authentication ) throws Exception {
 HttpGet method = new HttpGet( urlString );
 HttpClientContext context = HttpClientUtil.createPreemptiveBasicAuthentication( host, port, user, password );
 //adding authorization token
 if ( authentication != null ) {
  method.addHeader( new BasicHeader( "Authorization", authentication ) );
 }
 //executing method
 HttpClient client = HttpClientManager.getInstance().createDefaultClient();
 HttpResponse httpResponse = context != null ? client.execute( method, context ) : client.execute( method );
 int code = httpResponse.getStatusLine().getStatusCode();
 String response = HttpClientUtil.responseToString( httpResponse );
 method.releaseConnection();
 if ( code >= HttpStatus.SC_BAD_REQUEST ) {
  System.out.println( "Error occurred during starting job." );
  return null;
 }
 return response;
}
origin: pentaho/pdi-sdk-plugins

public static String sendStartExecutionTransRequest( String urlString, String authentication ) throws Exception {
 HttpGet method = new HttpGet( urlString );
 HttpClientContext context = HttpClientUtil.createPreemptiveBasicAuthentication( host, port, user, password );
 //adding authorization token
 if ( authentication != null ) {
  method.addHeader( new BasicHeader( "Authorization", authentication ) );
 }
 //executing method
 HttpClient client = HttpClientManager.getInstance().createDefaultClient();
 HttpResponse httpResponse = context != null ? client.execute( method, context ) : client.execute( method );
 int code = httpResponse.getStatusLine().getStatusCode();
 String response = HttpClientUtil.responseToString( httpResponse );
 method.releaseConnection();
 if ( code >= HttpStatus.SC_BAD_REQUEST ) {
  System.out.println( "Error occurred during starting transformation execution." );
  return null;
 }
 return response;
}
origin: pentaho/pdi-sdk-plugins

public static String sendCleanupTransRequest( String urlString, String authentication ) throws Exception {
 HttpGet method = new HttpGet( urlString );
 HttpClientContext context = HttpClientUtil.createPreemptiveBasicAuthentication( host, port, user, password );
 //adding authorization token
 if ( authentication != null ) {
  method.addHeader( new BasicHeader( "Authorization", authentication ) );
 }
 //executing method
 HttpClient client = HttpClientManager.getInstance().createDefaultClient();
 HttpResponse httpResponse = context != null ? client.execute( method, context ) : client.execute( method );
 int code = httpResponse.getStatusLine().getStatusCode();
 String response = HttpClientUtil.responseToString( httpResponse );
 method.releaseConnection();
 if ( code >= HttpStatus.SC_BAD_REQUEST ) {
  System.out.println( "Error occurred during transformation preparation for execution." );
  return null;
 }
 return response;
}
origin: pentaho/pdi-sdk-plugins

public static String sendRunTransRequest( String urlString, String authentication ) throws Exception {
 HttpGet method = new HttpGet( urlString );
 HttpClientContext context = HttpClientUtil.createPreemptiveBasicAuthentication( host, port, user, password );
 //adding authorization token
 if ( authentication != null ) {
  method.addHeader( new BasicHeader( "Authorization", authentication ) );
 }
 //executing method
 HttpClient client = HttpClientManager.getInstance().createDefaultClient();
 HttpResponse httpResponse = context != null ? client.execute( method, context ) : client.execute( method );
 int code = httpResponse.getStatusLine().getStatusCode();
 String response = HttpClientUtil.responseToString( httpResponse );
 method.releaseConnection();
 if ( code >= HttpStatus.SC_BAD_REQUEST ) {
  System.out.println( "Error occurred during stopping transformation." );
  return null;
 }
 return response;
}
origin: pentaho/pdi-sdk-plugins

public static String sendRemoveJobRequest( String urlString, String authentication ) throws Exception {
 HttpGet method = new HttpGet( urlString );
 HttpClientContext context = HttpClientUtil.createPreemptiveBasicAuthentication( host, port, user, password );
 //adding authorization token
 if ( authentication != null ) {
  method.addHeader( new BasicHeader( "Authorization", authentication ) );
 }
 //executing method
 HttpClient client = HttpClientManager.getInstance().createDefaultClient();
 HttpResponse httpResponse = context != null ? client.execute( method, context ) : client.execute( method );
 int code = httpResponse.getStatusLine().getStatusCode();
 String response = HttpClientUtil.responseToString( httpResponse );
 method.releaseConnection();
 if ( code >= HttpStatus.SC_BAD_REQUEST ) {
  System.out.println( "Error occurred during removing job." );
  return null;
 }
 return response;
}
origin: pentaho/pdi-sdk-plugins

public static String sendRunJobRequest( String urlString, String authentication ) throws Exception {
 HttpGet method = new HttpGet( urlString );
 HttpClientContext context = HttpClientUtil.createPreemptiveBasicAuthentication( host, port, user, password );
 //adding authorization token
 if ( authentication != null ) {
  method.addHeader( new BasicHeader( "Authorization", authentication ) );
 }
 //executing method
 HttpClient client = HttpClientManager.getInstance().createDefaultClient();
 HttpResponse httpResponse = context != null ? client.execute( method, context ) : client.execute( method );
 int code = httpResponse.getStatusLine().getStatusCode();
 String response = HttpClientUtil.responseToString( httpResponse );
 method.releaseConnection();
 if ( code >= HttpStatus.SC_BAD_REQUEST ) {
  System.out.println( "Error occurred during stopping transformation." );
  return null;
 }
 return response;
}
org.pentaho.di.core.utilHttpClientUtilresponseToString

Popular methods of HttpClientUtil

  • createPreemptiveBasicAuthentication
    Returns context with AuthCache or null in case of any exception was thrown.
  • responseToByteArray

Popular in Java

  • Reactive rest calls using spring rest template
  • getExternalFilesDir (Context)
  • getSharedPreferences (Context)
  • onCreateOptionsMenu (Activity)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • JFileChooser (javax.swing)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now