getParams().setBooleanParameter(HttpMethodParams.USE_EXPECT_CONTINUE, value);
getParams().setBooleanParameter(HttpMethodParams.USE_EXPECT_CONTINUE, value);
getParams().setBooleanParameter(HttpMethodParams.USE_EXPECT_CONTINUE, value);
getParams().setBooleanParameter(HttpMethodParams.USE_EXPECT_CONTINUE, value);
getParams().setBooleanParameter(HttpMethodParams.USE_EXPECT_CONTINUE, value);
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 ); }
public static HttpMethod deployUsingPomWithRestReturnResult( String restServiceURL, String repositoryId, File fileToDeploy, File pomFile, String classifier, String extention ) throws HttpException, IOException { // the method we are calling PostMethod filePost = new PostMethod( restServiceURL ); filePost.getParams().setBooleanParameter( HttpMethodParams.USE_EXPECT_CONTINUE, true ); classifier = ( classifier == null ) ? "" : classifier; extention = ( extention == null ) ? "" : extention; Part[] parts = { new StringPart( "r", repositoryId ), new StringPart( "e", extention ), new StringPart( "c", classifier ), new StringPart( "hasPom", "true" ), new FilePart( pomFile.getName(), pomFile ), new FilePart( fileToDeploy.getName(), fileToDeploy ) }; filePost.setRequestEntity( new MultipartRequestEntity( parts, filePost.getParams() ) ); LOG.debug( "URL: " + restServiceURL ); LOG.debug( "Method: Post" ); LOG.debug( "params: " ); LOG.debug( "\tr: " + repositoryId ); LOG.debug( "\thasPom: true" ); LOG.debug( "\tpom: " + pomFile ); LOG.debug( "\tfileToDeploy: " + fileToDeploy ); return RequestFacade.executeHTTPClientMethod( new URL( restServiceURL ), filePost ); }
filePost.getParams().setBooleanParameter( HttpMethodParams.USE_EXPECT_CONTINUE, true );
if (body.toString().length() > DEFAULT_SAVEPOST_BUFFER) post.getParams().setBooleanParameter(HttpMethodParams.USE_EXPECT_CONTINUE, true);
if (body.toString().length() > DEFAULT_SAVEPOST_BUFFER) post.getParams().setBooleanParameter(HttpMethodParams.USE_EXPECT_CONTINUE, true);
if (req.getBody().length > DEFAULT_SAVEPOST_BUFFER) post.getParams().setBooleanParameter(HttpMethodParams.USE_EXPECT_CONTINUE, true);
if (req.getBody().length > DEFAULT_SAVEPOST_BUFFER) post.getParams().setBooleanParameter(HttpMethodParams.USE_EXPECT_CONTINUE, true);
public void upload(File src, URL dest, CopyProgressListener l) throws IOException { HttpClient client = getClient(); PutMethod put = new PutMethod(normalizeToString(dest)); put.setDoAuthentication(useAuthentication(dest) || useProxyAuthentication()); put.getParams().setBooleanParameter("http.protocol.expect-continue", true); try { put.setRequestEntity(new FileRequestEntity(src)); int statusCode = client.executeMethod(put); validatePutStatusCode(dest, statusCode, null); } finally { put.releaseConnection(); } }
public static int deployUsingGavWithRest( String restServiceURL, String repositoryId, Gav gav, File fileToDeploy ) throws HttpException, IOException { // the method we are calling PostMethod filePost = new PostMethod( restServiceURL ); filePost.getParams().setBooleanParameter( HttpMethodParams.USE_EXPECT_CONTINUE, true ); Part[] parts = { new StringPart( "r", repositoryId ), new StringPart( "g", gav.getGroupId() ), new StringPart( "a", gav.getArtifactId() ), new StringPart( "v", gav.getVersion() ), new StringPart( "p", gav.getExtension() ), new StringPart( "c", "" ), new FilePart( fileToDeploy.getName(), fileToDeploy ), }; filePost.setRequestEntity( new MultipartRequestEntity( parts, filePost.getParams() ) ); return RequestFacade.executeHTTPClientMethod( new URL( restServiceURL ), filePost ).getStatusCode(); }
protected HttpMethod createMethod(Request req) throws IOException { byte[] message = null; HttpMethod method = super.createMethod(req); if(req.getMethod().equalsIgnoreCase("POST")) { message = req.getBody(); // encrypt body Pair<byte[], AlgorithmParameters> encrypted = encryptor.encrypt(KeyProvider.ALIAS_SOLR, null, message); encryptionUtils.setRequestAlgorithmParameters(method, encrypted.getSecond()); ((PostMethod)method).getParams().setBooleanParameter(HttpMethodParams.USE_EXPECT_CONTINUE, encrypted.getFirst().length > DEFAULT_SAVEPOST_BUFFER); ByteArrayRequestEntity requestEntity = new ByteArrayRequestEntity(encrypted.getFirst(), "application/octet-stream"); ((PostMethod)method).setRequestEntity(requestEntity); } encryptionUtils.setRequestAuthentication(method, message); return method; }
public int deployUsingGavWithRest( final String restServiceURL, final String repositoryId, final Gav gav, final File fileToDeploy ) throws IOException { // the method we are calling final PostMethod filePost = new PostMethod( restServiceURL ); filePost.getParams().setBooleanParameter( HttpMethodParams.USE_EXPECT_CONTINUE, true ); final String extension = gav.getExtension() != null ? gav.getExtension() : ""; final String classifier = gav.getClassifier() != null ? gav.getClassifier() : ""; final Part[] parts = { new StringPart( "r", repositoryId ), new StringPart( "g", gav.getGroupId() ), new StringPart( "a", gav.getArtifactId() ), new StringPart( "v", gav.getVersion() ), new StringPart( "p", extension ), new StringPart( "c", classifier ), new FilePart( fileToDeploy.getName(), fileToDeploy ) }; filePost.setRequestEntity( new MultipartRequestEntity( parts, filePost.getParams() ) ); return nexusRestClient.executeHTTPClientMethod( filePost ).getStatusCode(); }
httpMethod.getParams().setBooleanParameter(HttpMethodParams.USE_EXPECT_CONTINUE, false);
httpMethod.getParams().setBooleanParameter(HttpMethodParams.SINGLE_COOKIE_HEADER, true); httpMethod.getParams().setCookiePolicy(CookieManager.HTMLUNIT_COOKIE_POLICY);
httpMethod.getParams().setBooleanParameter(HttpMethodParams.SINGLE_COOKIE_HEADER, true); httpMethod.getParams().setCookiePolicy(CookieManager.HTMLUNIT_COOKIE_POLICY);
httpMethod.getParams().setBooleanParameter(HttpMethodParams.SINGLE_COOKIE_HEADER, true); httpMethod.getParams().setCookiePolicy(CookieManager.HTMLUNIT_COOKIE_POLICY);