Пример #1
0
 @SuppressWarnings("unused")
 public HttpCommandResponse execute(String url, HttpParameters parameters, String charsetName)
     throws IOException {
   HttpPost httpPut = new HttpPost(url);
   httpPut.setEntity(new UrlEncodedFormEntity(parameters, Charset.forName(charsetName)));
   return new HttpCommandResponse(shellHttpClient.getHttpClient().execute(httpPut));
 }
Пример #2
0
 @SuppressWarnings("unused")
 public HttpCommandResponse execute(String url, String body, String mimeType, String charsetName)
     throws IOException {
   HttpPost httpPut = new HttpPost(url);
   httpPut.setEntity(
       new StringEntity(body, ContentType.create(mimeType, Charset.forName(charsetName))));
   return new HttpCommandResponse(shellHttpClient.getHttpClient().execute(httpPut));
 }
Пример #3
0
  @Override
  public void shutdown() {
    if (closed.compareAndSet(false, true)) {
      if (scheduler != null) {
        logger.debug("Shutting down the scheduler");
        scheduler.shutdown();
      }
      shellScope.closeAllResources();

      shellHttpClient.shutdown();

      console.println();
      console.println(MessagesProvider.getMessage(ShellSettings.BYE_MESSAGE));

      console.shutdown();
    }
  }
Пример #4
0
 @SuppressWarnings("unused")
 public HttpCommandResponse execute(String url, String body) throws IOException {
   HttpPost httpPut = new HttpPost(url);
   httpPut.setEntity(new StringEntity(body, ContentType.DEFAULT_TEXT));
   return new HttpCommandResponse(shellHttpClient.getHttpClient().execute(httpPut));
 }
Пример #5
0
 @SuppressWarnings("unused")
 public HttpCommandResponse execute(String url) throws IOException {
   return new HttpCommandResponse(shellHttpClient.getHttpClient().execute(new HttpPost(url)));
 }