Browse Source

Merge "Fix IllegalArgumentException in AmazonS3"

stable-4.1
Shawn Pearce 10 years ago committed by Gerrit Code Review @ Eclipse.org
parent
commit
4ac7cf003b
  1. 4
      org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java

4
org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java

@ -489,16 +489,14 @@ public class AmazonS3 {
final String md5str = Base64.encodeBytes(csum);
final long len = buf.length();
final String lenstr = String.valueOf(len);
for (int curAttempt = 0; curAttempt < maxAttempts; curAttempt++) {
final HttpURLConnection c = open("PUT", bucket, key); //$NON-NLS-1$
c.setRequestProperty("Content-Length", lenstr); //$NON-NLS-1$
c.setFixedLengthStreamingMode(len);
c.setRequestProperty("Content-MD5", md5str); //$NON-NLS-1$
c.setRequestProperty(X_AMZ_ACL, acl);
encryption.request(c, X_AMZ_META);
authorize(c);
c.setDoOutput(true);
c.setFixedLengthStreamingMode((int) len);
monitor.beginTask(monitorTask, (int) (len / 1024));
final OutputStream os = c.getOutputStream();
try {

Loading…
Cancel
Save