mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
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:
@@ -492,13 +492,12 @@ public abstract class AbstractContentWriter extends AbstractContentAccessor impl
|
|||||||
* <p/>
|
* <p/>
|
||||||
* Both streams are closed but any IOExceptions are thrown
|
* Both streams are closed but any IOExceptions are thrown
|
||||||
*/
|
*/
|
||||||
private final int copyStreams(InputStream in, OutputStream out) throws IOException
|
private final long copyStreams(InputStream in, OutputStream out) throws IOException
|
||||||
{
|
{
|
||||||
ContentLimitProvider contentLimitProvider = getContentLimitProvider();
|
ContentLimitProvider contentLimitProvider = getContentLimitProvider();
|
||||||
final long sizeLimit = contentLimitProvider.getSizeLimit();
|
final long sizeLimit = contentLimitProvider.getSizeLimit();
|
||||||
|
|
||||||
int byteCount = sizeLimitedStreamCopier.copyStreams(in, out, sizeLimit);
|
long byteCount = sizeLimitedStreamCopier.copyStreamsLong(in, out, sizeLimit);
|
||||||
|
|
||||||
return byteCount;
|
return byteCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -51,7 +51,18 @@ public final class LimitedStreamCopier
|
|||||||
*/
|
*/
|
||||||
public final int copyStreams(InputStream in, OutputStream out, long sizeLimit) throws IOException
|
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;
|
IOException error = null;
|
||||||
|
|
||||||
long totalBytesRead = 0;
|
long totalBytesRead = 0;
|
||||||
|
Reference in New Issue
Block a user