Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions Parse/src/main/java/com/parse/ParseFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down
6 changes: 0 additions & 6 deletions Parse/src/test/java/com/parse/ParseFileTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down