You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2020/03/19 08:14:20 UTC

[maven-wagon] branch WAGON-584_streaming created (now 241af6e)

This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a change to branch WAGON-584_streaming
in repository https://gitbox.apache.org/repos/asf/maven-wagon.git.


      at 241af6e  Add code for streaming failures

This branch includes the following new commits:

     new 241af6e  Add code for streaming failures

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven-wagon] 01/01: Add code for streaming failures

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch WAGON-584_streaming
in repository https://gitbox.apache.org/repos/asf/maven-wagon.git

commit 241af6e14b412c4a3c7b9db5313a6f81426bbd7c
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Thu Mar 19 09:13:56 2020 +0100

    Add code for streaming failures
---
 .../maven/wagon/providers/http/LightweightHttpWagon.java       | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/wagon-providers/wagon-http-lightweight/src/main/java/org/apache/maven/wagon/providers/http/LightweightHttpWagon.java b/wagon-providers/wagon-http-lightweight/src/main/java/org/apache/maven/wagon/providers/http/LightweightHttpWagon.java
index 82981c9..c4341bc 100644
--- a/wagon-providers/wagon-http-lightweight/src/main/java/org/apache/maven/wagon/providers/http/LightweightHttpWagon.java
+++ b/wagon-providers/wagon-http-lightweight/src/main/java/org/apache/maven/wagon/providers/http/LightweightHttpWagon.java
@@ -249,9 +249,19 @@ public class LightweightHttpWagon
             putConnection = (HttpURLConnection) url.openConnection( this.proxy );
 
             addHeaders( putConnection );
+            putConnection.setRequestProperty( "Expect", "100-continue" );
 
             putConnection.setRequestMethod( "PUT" );
             putConnection.setDoOutput( true );
+
+            if ( resource.getContentLength() != -1 )
+            {
+                putConnection.setFixedLengthStreamingMode( resource.getContentLength() );
+            }
+            else
+            {
+                putConnection.setChunkedStreamingMode( 0 );
+            }
             outputData.setOutputStream( putConnection.getOutputStream() );
         }
         catch ( IOException e )