File tree 2 files changed +0
-17
lines changed
2 files changed +0
-17
lines changed Original file line number Diff line number Diff line change 42
42
*/
43
43
public class ParseFile {
44
44
45
- // We limit the size of ParseFile data to be 10mb.
46
- /* package */ static final int MAX_FILE_SIZE = 10 * 1048576 ;
47
-
48
45
/* package for tests */ static ParseFileController getFileController () {
49
46
return ParseCorePlugins .getInstance ().getFileController ();
50
47
}
@@ -164,10 +161,6 @@ public ParseFile(File file) {
164
161
*/
165
162
public ParseFile (File file , String contentType ) {
166
163
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
- }
171
164
this .file = file ;
172
165
}
173
166
@@ -186,10 +179,6 @@ public ParseFile(File file, String contentType) {
186
179
*/
187
180
public ParseFile (String name , byte [] data , String contentType ) {
188
181
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
- }
193
182
this .data = data ;
194
183
}
195
184
Original file line number Diff line number Diff line change @@ -91,12 +91,6 @@ public void testConstructor() throws Exception {
91
91
assertEquals ("content_type" , parseFile .getState ().mimeType ());
92
92
}
93
93
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
-
100
94
@ Test
101
95
public void testGetters () {
102
96
ParseFile file = new ParseFile (new ParseFile .State .Builder ().url ("http://example.com" ).build ());
You can’t perform that action at this time.
0 commit comments