File tree Expand file tree Collapse file tree 2 files changed +0
-17
lines changed Expand file tree Collapse file tree 2 files changed +0
-17
lines changed Original file line number Diff line number Diff line change 4242 */
4343public 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
Original file line number Diff line number Diff 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 ());
You can’t perform that action at this time.
0 commit comments