Package org.apache.commons.httpclient.methods

Examples of org.apache.commons.httpclient.methods.PostMethod.releaseConnection()


       
        return resultForResponseStatus(responseStatus);
      } catch(Exception e){
        return AbstractResult.failure(new RepositoryException(e));
      }finally{
        post.releaseConnection();
      }
    }

    @Override
    public String toString() {
View Full Code Here


       
        return resultForResponseStatus(responseStatus);
      } catch(Exception e){
        return AbstractResult.failure(new RepositoryException(e));
      }finally{
        post.releaseConnection();
      }
    }

    @Override
    public String toString() {
View Full Code Here

                throw new OsgiClientException("Method execution returned status " + status);
            }
        } catch (IOException e) {
            throw new OsgiClientException(e);
        } finally {
            filePost.releaseConnection();
        }
    }

    @Override
    public void installLocalBundle(final String explodedBundleLocation) throws OsgiClientException {
View Full Code Here

            } catch (JSONException e) {
                throw new OsgiClientException(
                        "Response is not valid JSON. The InstallServlet is probably not installed at the expected location",
                        e);
            } finally {
                method.releaseConnection();
            }
        }

        private JSONObject parseResult(PostMethod method) throws IOException, JSONException {
            ByteArrayOutputStream out = new ByteArrayOutputStream();
View Full Code Here

            }
        } catch (Exception ex) {
            throw new MojoExecutionException("Installation on " + targetURL
                + " failed, cause: " + ex.getMessage(), ex);
        } finally {
            filePost.releaseConnection();
        }
    }

    protected void put(String targetURL, File file) throws MojoExecutionException {
View Full Code Here

                    + " failed, cause: " + ex.getMessage(), ex);
        } catch (IOException ex) {
            throw new MojoExecutionException("Removing configuration at " + postUrl
                    + " failed, cause: " + ex.getMessage(), ex);
        } finally {
            post.releaseConnection();
        }
    }

    /**
     * Add a new configuration for the file system provider
View Full Code Here

                    + " failed, cause: " + ex.getMessage(), ex);
        } catch (IOException ex) {
            throw new MojoExecutionException("Configuration on " + postUrl
                    + " failed, cause: " + ex.getMessage(), ex);
        } finally {
            post.releaseConnection();
        }
    }

    /**
     * Return all file provider configs for this project
View Full Code Here

            }
        } catch (Exception ex) {
            throw new MojoExecutionException("Deployment on " + targetURL
                + " failed, cause: " + ex.getMessage(), ex);
        } finally {
            filePost.releaseConnection();
        }
    }

    /**
     * Change the version in jar
View Full Code Here

        final int status = httpClient.executeMethod(post);
        if(status!=expected) {
            throw new HttpStatusCodeException(expected, status, "POST", url, HttpTestBase.getResponseBodyAsStream(post, 0));
        }
        String location = post.getResponseHeader("Location").getValue();
        post.releaseConnection();
        // simple check if host is missing
        if (!location.startsWith("http://")) {
            String host = HttpTestBase.HTTP_BASE_URL;
            int idx = host.indexOf('/', 8);
            if (idx > 0) {
View Full Code Here

        method.setRequestBody(params);
        logPostRequest(method);
        client.executeMethod(method);
        String responseStr = readInputStream(method.getResponseBodyAsStream());
        logPostResponse(method, responseStr);
        method.releaseConnection();
        if (method.getResponseHeader("Location") != null) {
            if (method.getResponseHeader("Location").getValue().startsWith(
                    "http")) {
                return doGet(method.getResponseHeader("Location").getValue());
            } else {
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.