From 923aeb0cf52333deb6288aca554e239cb07f31ee Mon Sep 17 00:00:00 2001 From: Kristo Prifti Date: Tue, 24 May 2016 22:22:06 +0300 Subject: [PATCH] Removed file size check, Parse Android SDK --- Parse/src/main/java/com/parse/ParseFile.java | 11 ----------- Parse/src/test/java/com/parse/ParseFileTest.java | 6 ------ 2 files changed, 17 deletions(-) diff --git a/Parse/src/main/java/com/parse/ParseFile.java b/Parse/src/main/java/com/parse/ParseFile.java index 9a5167795..c7399cbec 100644 --- a/Parse/src/main/java/com/parse/ParseFile.java +++ b/Parse/src/main/java/com/parse/ParseFile.java @@ -42,9 +42,6 @@ */ public class ParseFile { - // We limit the size of ParseFile data to be 10mb. - /* package */ static final int MAX_FILE_SIZE = 10 * 1048576; - /* package for tests */ static ParseFileController getFileController() { return ParseCorePlugins.getInstance().getFileController(); } @@ -164,10 +161,6 @@ public ParseFile(File file) { */ public ParseFile(File file, String contentType) { this(new State.Builder().name(file.getName()).mimeType(contentType).build()); - if (file.length() > MAX_FILE_SIZE) { - throw new IllegalArgumentException(String.format("ParseFile must be less than %d bytes", - MAX_FILE_SIZE)); - } this.file = file; } @@ -186,10 +179,6 @@ public ParseFile(File file, String contentType) { */ public ParseFile(String name, byte[] data, String contentType) { this(new State.Builder().name(name).mimeType(contentType).build()); - if (data.length > MAX_FILE_SIZE) { - throw new IllegalArgumentException(String.format("ParseFile must be less than %d bytes", - MAX_FILE_SIZE)); - } this.data = data; } diff --git a/Parse/src/test/java/com/parse/ParseFileTest.java b/Parse/src/test/java/com/parse/ParseFileTest.java index c685b0d6a..6afa4829b 100644 --- a/Parse/src/test/java/com/parse/ParseFileTest.java +++ b/Parse/src/test/java/com/parse/ParseFileTest.java @@ -91,12 +91,6 @@ public void testConstructor() throws Exception { assertEquals("content_type", parseFile.getState().mimeType()); } - @Test(expected = IllegalArgumentException.class) - public void testSavingTooLargeFileThrowsException() throws Exception { - byte[] data = new byte[10 * 1048576 + 1]; - new ParseFile(data); - } - @Test public void testGetters() { ParseFile file = new ParseFile(new ParseFile.State.Builder().url("http://example.com").build());