LOG.debug("Loading: " + post.getURI()); int statusCode = httpClient.executeMethod(post); if (statusCode != HttpStatus.SC_CREATED) {
LOG.debug("Loading: " + post.getURI()); int statusCode = httpClient.executeMethod(post); if (statusCode != HttpStatus.SC_CREATED) {
@Override public URI getUri() throws URISyntaxException { try { return new URI(postMethod.getURI().toString()); } catch (URIException ex) { throw new URISyntaxException("", ex.getMessage()); } }
public URI getUri() throws URISyntaxException { try { return new URI(postMethod.getURI().toString()); } catch (URIException ex) { throw new URISyntaxException("", ex.getMessage()); } }
@Override public URI getUri() throws URISyntaxException { try { return new URI(postMethod.getURI().toString()); } catch (URIException ex) { throw new URISyntaxException("", ex.getMessage()); } }
@Override public URI getUri() throws URISyntaxException { try { return new URI(postMethod.getURI().toString()); } catch (URIException ex) { throw new URISyntaxException("", ex.getMessage()); } }
public HttpMethod deployPomWithRest( final String repositoryId, final File pomFile ) throws IOException { // the method we are calling final PostMethod filePost = new PostMethod( nexusRestClient.toNexusURL( "service/local/artifact/maven/content" ).toExternalForm() ); filePost.getParams().setBooleanParameter( HttpMethodParams.USE_EXPECT_CONTINUE, true ); final Part[] parts = { new StringPart( "r", repositoryId ), new StringPart( "hasPom", "true" ), new FilePart( pomFile.getName(), pomFile ) }; filePost.setRequestEntity( new MultipartRequestEntity( parts, filePost.getParams() ) ); LOG.debug( "URL: " + filePost.getURI() ); LOG.debug( "Method: Post" ); LOG.debug( "params: " ); LOG.debug( "\tr: " + repositoryId ); LOG.debug( "\thasPom: true" ); LOG.debug( "\tpom: " + pomFile ); return nexusRestClient.executeHTTPClientMethod( filePost ); }
method.setRequestEntity(requestEntity); logger.debug("Sending multipart POST message to " + method.getURI().getURI() + " with parts " + partList); int statusCode = client.executeMethod(method);
LOG.debug("Loading: " + post.getURI()); int statusCode = httpClient.executeMethod(post); if (statusCode != HttpStatus.SC_CREATED) {
method.addParameter("ts", ts); method.addParameter("hash", hash); logger.debug("Sending POST message to " + method.getURI().getURI() + " with parameters " + Arrays.toString(method.getParameters())); int statusCode = client.executeMethod(method);
LOG.debug("Loading: " + post.getURI()); int statusCode = httpClient.executeMethod(post); if (statusCode != HttpStatus.SC_CREATED) {
LOG.debug("Loading: " + post.getURI()); int statusCode = httpClient.executeMethod(post); if (statusCode != HttpStatus.SC_CREATED) {
msg.append( method.getStatusText() ); msg.append( "\n\n" ); msg.append( "request: "+method.getURI() ); handleError( new Exception( msg.toString() ) );
LOGGER.debug(targetMethod.getURI().toString()); LOGGER.debug(targetMethod.getStatusLine()); LOGGER.debug(responseBodyAsString);
protected void resetClientForRedirect() throws XmlRpcException { //get the location header to find out where to redirect to Header locationHeader = method.getResponseHeader("location"); if (locationHeader == null) { throw new XmlRpcException("Invalid redirect: Missing location header"); } String location = locationHeader.getValue(); URI redirectUri = null; URI currentUri = null; try { currentUri = method.getURI(); String charset = currentUri.getProtocolCharset(); redirectUri = new URI(location, true, charset); method.setURI(redirectUri); } catch (URIException ex) { throw new XmlRpcException(ex.getMessage(), ex); } //And finally invalidate the actual authentication scheme method.getHostAuthState().invalidate(); }
protected void resetClientForRedirect() throws XmlRpcException { //get the location header to find out where to redirect to Header locationHeader = method.getResponseHeader("location"); if (locationHeader == null) { throw new XmlRpcException("Invalid redirect: Missing location header"); } String location = locationHeader.getValue(); URI redirectUri = null; URI currentUri = null; try { currentUri = method.getURI(); String charset = currentUri.getProtocolCharset(); redirectUri = new URI(location, true, charset); method.setURI(redirectUri); } catch (URIException ex) { throw new XmlRpcException(ex.getMessage(), ex); } //And finally invalidate the actual authentication scheme method.getHostAuthState().invalidate(); }