Skip to content

Commit 758f236

Browse files
committed
Merge pull request #462 from kristoprifti/master
Removed file size check, Parse Android SDK
2 parents 95b6b17 + 923aeb0 commit 758f236

File tree

2 files changed

+0
-17
lines changed

2 files changed

+0
-17
lines changed

Parse/src/main/java/com/parse/ParseFile.java

-11
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@
4242
*/
4343
public class ParseFile {
4444

45-
// We limit the size of ParseFile data to be 10mb.
46-
/* package */ static final int MAX_FILE_SIZE = 10 * 1048576;
47-
4845
/* package for tests */ static ParseFileController getFileController() {
4946
return ParseCorePlugins.getInstance().getFileController();
5047
}
@@ -164,10 +161,6 @@ public ParseFile(File file) {
164161
*/
165162
public ParseFile(File file, String contentType) {
166163
this(new State.Builder().name(file.getName()).mimeType(contentType).build());
167-
if (file.length() > MAX_FILE_SIZE) {
168-
throw new IllegalArgumentException(String.format("ParseFile must be less than %d bytes",
169-
MAX_FILE_SIZE));
170-
}
171164
this.file = file;
172165
}
173166

@@ -186,10 +179,6 @@ public ParseFile(File file, String contentType) {
186179
*/
187180
public ParseFile(String name, byte[] data, String contentType) {
188181
this(new State.Builder().name(name).mimeType(contentType).build());
189-
if (data.length > MAX_FILE_SIZE) {
190-
throw new IllegalArgumentException(String.format("ParseFile must be less than %d bytes",
191-
MAX_FILE_SIZE));
192-
}
193182
this.data = data;
194183
}
195184

Parse/src/test/java/com/parse/ParseFileTest.java

-6
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,6 @@ public void testConstructor() throws Exception {
9191
assertEquals("content_type", parseFile.getState().mimeType());
9292
}
9393

94-
@Test(expected = IllegalArgumentException.class)
95-
public void testSavingTooLargeFileThrowsException() throws Exception {
96-
byte[] data = new byte[10 * 1048576 + 1];
97-
new ParseFile(data);
98-
}
99-
10094
@Test
10195
public void testGetters() {
10296
ParseFile file = new ParseFile(new ParseFile.State.Builder().url("http://example.com").build());

0 commit comments

Comments
 (0)