Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)

57701: Merged V4.2-BUG-FIX (4.2.1) to HEAD-BUG-FIX (Cloud/4.3)
      57648: Merged V4.1-BUG-FIX (4.1.8) to V4.2-BUG-FIX (4.2.1)
         57594: MNT-9770 : Merged from DEV to V4.1-BUG-FIX
          57002: MNT-9770 : WebDAV uploads over 2gb in size fails.
          Change int type to long, as content length from http request more than Integer.MAX_VALUE . 


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@61869 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2014-02-11 21:25:14 +00:00
parent c791da212f
commit 84a951b647
2 changed files with 14 additions and 4 deletions

View File

@@ -51,7 +51,18 @@ public final class LimitedStreamCopier
*/
public final int copyStreams(InputStream in, OutputStream out, long sizeLimit) throws IOException
{
int byteCount = 0;
long bytes = copyStreamsLong(in, out, sizeLimit);
if (bytes > Integer.MAX_VALUE)
{
throw new IllegalArgumentException(bytes + " cannot be cast to int.");
}
return (int) bytes;
}
public final long copyStreamsLong(InputStream in, OutputStream out, long sizeLimit) throws IOException
{
long byteCount = 0;
IOException error = null;
long totalBytesRead = 0;