Package org.apache.http.client.methods

Examples of org.apache.http.client.methods.HttpPost.releaseConnection()


            e.printStackTrace();
            //throw new ServletException("Some unexpected error occurred. Error text was: " + e.getMessage());
            returnExceptionMessage(response, HttpStatus.SC_INTERNAL_SERVER_ERROR,
                    "Some unexpected error occurred. Error text was: " + e.getMessage());
        } finally {
            if (httpPost != null) httpPost.releaseConnection();
        }
    }
   
    /**
     * Gets the contentType for response
View Full Code Here


            } catch (IOException x) {
                // never mind, just log it
                Log.warning(Geonet.CSW_HARVEST, "WARNING: " + x.getMessage() + " (this exception is swallowed)");
                x.printStackTrace();
            } finally {
                method.releaseConnection();
            }
        }
        /**
         * Sends a HarvestResponse to the destination specified in responseHandler. Supports http, email and ftp.
         *
 
View Full Code Here

                    log.error("error updating configuration {}: {} {}",new Object[] {key,response.getStatusLine().getStatusCode(),response.getStatusLine().getReasonPhrase()});
                    throw new MarmottaClientException("error updating configuration "+key+": "+response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase());
            }

        } finally {
            post.releaseConnection();
        }       
    }

    /**
     * Remove the configuration with the given key.
View Full Code Here

            httpClient.execute(post, handler);
        } catch(IOException ex) {
            post.abort();
            throw ex;
        } finally {
            post.releaseConnection();
        }

    }

    /**
 
View Full Code Here

           
        } catch (UnsupportedEncodingException e) {
            log.error("could not encode URI parameter",e);
            return false;
        } finally {
            post.releaseConnection();
        }
    }

    /**
     * Test whether the resource with the provided URI exists.
View Full Code Here

      throw new HttpResponseIndicatesErrorException(String.format("Login response indicates error! Status line: %s", responseStatusLine.toString()));
    }
   
    this.writeHtmlToFile(Util.filePathCombine("log", "LoginPageResponse.html"), this.getResponseAllHeadersAndContentAsString(response));

    request.releaseConnection();
    logger.info("Login successful.");
  }
 
  private void sendCheckinRequest(String checkinUrl) throws URISyntaxException, ClientProtocolException, IOException, HttpResponseIndicatesErrorException
  {
View Full Code Here

      }
    } catch (Exception e) {
      logger.log(Level.SEVERE, "fetch ki4so key from server error, the url is ["+ki4soServerFetchKeyUrl+"]", e);
    } finally {
      if (httpPost != null) {
        httpPost.releaseConnection();
      }
    }
    return null;
  }
View Full Code Here

        if( message != null && message.content != null ) {
            request.setEntity(new StringEntity(message.content, ContentType.create(message.contentType.toString(), "UTF-8")));
        }
        HttpResponse httpResponse = httpClient.execute(request);
        ApiResponse apiResponse = readResponse(httpResponse);
        request.releaseConnection();
        return apiResponse;
    }
}
View Full Code Here

                    log.error("error updating configuration {}: {} {}",new Object[] {key,response.getStatusLine().getStatusCode(),response.getStatusLine().getReasonPhrase()});
                    throw new MarmottaClientException("error updating configuration "+key+": "+response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase());
            }

        } finally {
            post.releaseConnection();
        }       
    }

    /**
     * Remove the configuration with the given key.
View Full Code Here

            httpClient.execute(post, handler);
        } catch(IOException ex) {
            post.abort();
            throw ex;
        } finally {
            post.releaseConnection();
        }

    }

    /**
 
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.