@@ -140,7 +140,7 @@ public void setResume(String isResume) {
140140 if (isResume .compareToIgnoreCase ("true" ) == 0 ) {
141141 this .isResume = true ;
142142 } else if (isResume .compareToIgnoreCase ("false" ) != 0 ) {
143- throw new IllegalArgumentException ("resume invalid. should be true or false" );
143+ throw new IllegalArgumentException (isResume + " is invalid, isResume should be true or false" );
144144 }
145145 }
146146
@@ -154,7 +154,7 @@ public void setRealTimeCompare(String realTimeCompare) throws IllegalArgumentEx
154154 } else if (realTimeCompare .equalsIgnoreCase ("off" )) {
155155 this .realTimeCompare = false ;
156156 } else {
157- throw new IllegalArgumentException (" invalid realTimeCompare config. only support on/off" );
157+ throw new IllegalArgumentException (realTimeCompare + " is invalid, realTimeCompare only support on/off" );
158158 }
159159 }
160160
@@ -272,14 +272,14 @@ public String getCosPath() {
272272
273273 public void setCosPath (String cosPath ) throws IllegalArgumentException {
274274 if (!cosPath .startsWith ("/" )) {
275- throw new IllegalArgumentException (" cospath must start with /" );
275+ throw new IllegalArgumentException (cosPath + " is invalid, cospath must start with /" );
276276 }
277277 this .cosPath = PathUtils .formatCosFolderPath (cosPath );
278278 }
279279
280280 public void setDbCosPath (String dbCosPath ) throws IllegalArgumentException {
281281 if (!dbCosPath .startsWith ("/" )) {
282- throw new IllegalArgumentException (" dbcospath must start with /" );
282+ throw new IllegalArgumentException (dbCosPath + " is invalid, dbcospath must start with /" );
283283 }
284284 this .dbCosPath = PathUtils .formatCosFolderPath (dbCosPath );
285285 }
@@ -302,7 +302,7 @@ public void setEnableHttps(String enableHttpsStr) throws IllegalArgumentExceptio
302302 } else if (enableHttpsStr .equalsIgnoreCase ("off" )) {
303303 this .enableHttps = false ;
304304 } else {
305- throw new IllegalArgumentException (" invalid https config. only support on/off" );
305+ throw new IllegalArgumentException (enableHttpsStr + " is invalid, https config only support on/off" );
306306 }
307307 }
308308
@@ -312,7 +312,7 @@ public void setTaskExecutorNumberStr(String taskExecutorNumberStr)
312312 try {
313313 int number = Integer .valueOf (taskExecutorNumberStr );
314314 if (number <= 0 ) {
315- throw new IllegalArgumentException (" taskExecutorNumber must be greater than 0" );
315+ throw new IllegalArgumentException (taskExecutorNumberStr + " is invalid, taskExecutorNumber must be greater than 0" );
316316 }
317317 this .taskExecutorNumber = number ;
318318 } catch (NumberFormatException e ) {
@@ -347,7 +347,7 @@ public void setSmallFileUploadExecutorNum(String smallFileExecutorNumStr)
347347 try {
348348 int number = Integer .valueOf (smallFileExecutorNumStr );
349349 if (number <= 0 || number > 1024 ) {
350- throw new IllegalArgumentException (" legal smallFileExecutorNum is [1, 1024] " );
350+ throw new IllegalArgumentException (smallFileExecutorNumStr + " is invalid, legal smallFileExecutorNum is [1, 1024] " );
351351 }
352352 this .smallFileExecutorNumber = number ;
353353 this .taskExecutorNumber = this .smallFileExecutorNumber + this .bigFileExecutorNum ;
@@ -365,7 +365,7 @@ public void setBigFileUploadExecutorNum(String bigFileExecutorNumStr) {
365365 try {
366366 int number = Integer .valueOf (bigFileExecutorNumStr );
367367 if (number <= 0 || number > 64 ) {
368- throw new IllegalArgumentException (" legal bigFileExecutorNum is [1, 64] " );
368+ throw new IllegalArgumentException (bigFileExecutorNumStr + " is invalid, legal bigFileExecutorNum is [1, 64] " );
369369 }
370370 this .bigFileExecutorNum = number ;
371371 this .taskExecutorNumber = this .smallFileExecutorNumber + this .bigFileExecutorNum ;
@@ -382,7 +382,8 @@ public void setSmallFileThreshold(String smallFileThresholdStr) {
382382 final long maxSmallFile = 5L * 1024 * 1024 * 1024 ; // 最大5GB
383383 if (number < minSmallFile || number > maxSmallFile ) {
384384 throw new IllegalArgumentException (String .format (
385- "legal smallFileThreshold is [%d, %d], 5MB ~ 5GB" , minSmallFile , maxSmallFile ));
385+ "invalid smallFileThresholdStr: %s, legal smallFileThreshold is [%d, %d], 5MB ~ 5GB"
386+ , smallFileThresholdStr , minSmallFile , maxSmallFile ));
386387 }
387388 this .smallFileThreshold = number ;
388389 } catch (NumberFormatException e ) {
@@ -404,8 +405,7 @@ public void setEntireFileMd5Attached(String entireFileMd5AttachedStr) {
404405 } else if (entireFileMd5AttachedStr .equalsIgnoreCase ("off" )) {
405406 this .entireFileMd5Attached = false ;
406407 } else {
407- throw new IllegalArgumentException (
408- "invalid entireFileMd5Attached config. only support on/off" );
408+ throw new IllegalArgumentException (entireFileMd5AttachedStr + " is invalid, entireFileMd5Attached only support on/off" );
409409 }
410410 }
411411
@@ -415,17 +415,16 @@ public void setDaemonMode(String daemonModeStr) {
415415 } else if (daemonModeStr .equalsIgnoreCase ("off" )) {
416416 this .damonMode = false ;
417417 } else {
418- throw new IllegalArgumentException (
419- "invalid daemonMode config. only support on/off" );
418+ throw new IllegalArgumentException (daemonModeStr + " is invalid, daemonMode only support on/off" );
420419 }
421420 }
422421
423- public void setDaemonModeInterVal (String daemonModeStr ) {
424- daemonModeStr = daemonModeStr .trim ();
422+ public void setDaemonModeInterVal (String daemonModeInvatervalStr ) {
423+ daemonModeInvatervalStr = daemonModeInvatervalStr .trim ();
425424 try {
426- int number = Integer .valueOf (daemonModeStr );
425+ int number = Integer .valueOf (daemonModeInvatervalStr );
427426 if (number <= 0 ) {
428- throw new IllegalArgumentException (" damonInterVal must be greater than 0" );
427+ throw new IllegalArgumentException (daemonModeInvatervalStr + " is invalid, damonInterVal must be greater than 0" );
429428 }
430429 this .damonInterVal = number ;
431430 } catch (NumberFormatException e ) {
@@ -445,34 +444,34 @@ public void setTimeWindowsStr(String timeWindowStr) {
445444 timeWindowStr = timeWindowStr .trim ();
446445 String [] timeWindowArray = timeWindowStr .split ("," );
447446 if (timeWindowArray .length != 2 ) {
448- throw new IllegalArgumentException ("executeTimeWindow is invalid, the legal example 03:30,21:00" );
447+ throw new IllegalArgumentException (timeWindowStr + " is invalid, the legal executeTimeWindow example 03:30,21:00" );
449448 }
450449 try {
451450 String [] timeBeginMemberArray = timeWindowArray [0 ].split (":" );
452451 if (timeBeginMemberArray .length != 2 ) {
453- throw new IllegalArgumentException ("executeTimeWindow is invalid, the legal example 03:30,21:00" );
452+ throw new IllegalArgumentException (timeWindowStr + " is invalid, the legal executeTimeWindow example 03:30,21:00" );
454453 }
455454 int hour = Integer .valueOf (timeBeginMemberArray [0 ]);
456455 if (hour < 0 || hour >= 24 ) {
457- throw new IllegalArgumentException ("executeTimeWindow is invalid, the legal example 03:30,21:00" );
456+ throw new IllegalArgumentException (timeWindowStr + " is invalid, the legal executeTimeWindow example 03:30,21:00" );
458457 }
459458 int minute = Integer .valueOf (timeBeginMemberArray [1 ]);
460459 if (minute < 0 || minute >= 60 ) {
461- throw new IllegalArgumentException ("executeTimeWindow is invalid, the legal example 03:30,21:00" );
460+ throw new IllegalArgumentException (timeWindowStr + " is invalid, the legal executeTimeWindow example 03:30,21:00" );
462461 }
463462 this .timeWindowBegin = hour * 60 + minute ;
464463
465464 String [] timeEndMemberArray = timeWindowArray [1 ].split (":" );
466465 if (timeEndMemberArray .length != 2 ) {
467- throw new IllegalArgumentException ("executeTimeWindow is invalid, the legal example 03:30,21:00" );
466+ throw new IllegalArgumentException (timeWindowStr + " is invalid, the legal executeTimeWindow example 03:30,21:00" );
468467 }
469468 hour = Integer .valueOf (timeEndMemberArray [0 ]);
470469 if (hour < 0 || hour > 24 ) {
471- throw new IllegalArgumentException ("executeTimeWindow is invalid, the legal example 03:30,21:00" );
470+ throw new IllegalArgumentException (timeWindowStr + " is invalid, the legal executeTimeWindow example 03:30,21:00" );
472471 }
473472 minute = Integer .valueOf (timeEndMemberArray [1 ]);
474473 if (minute < 0 || minute >= 60 ) {
475- throw new IllegalArgumentException ("executeTimeWindow is invalid, the legal example 03:30,21:00" );
474+ throw new IllegalArgumentException (timeWindowStr + " is invalid, the legal executeTimeWindow example 03:30,21:00" );
476475 }
477476 this .timeWindowEnd = hour * 60 + minute ;
478477
@@ -543,7 +542,7 @@ public void setShortConnection(String shortConnection) throws IllegalArgumentExc
543542 } else if (shortConnection .equalsIgnoreCase ("false" )) {
544543 isShortConnection = false ;
545544 } else {
546- throw new IllegalArgumentException (" invalid short connection config. only support true/false" );
545+ throw new IllegalArgumentException (shortConnection + " is invalid, short connection config. only support true/false" );
547546 }
548547 }
549548
@@ -557,7 +556,7 @@ public void setRequestTimeoutEnable(String strRequestTimeoutEnable) throws Illeg
557556 } else if (strRequestTimeoutEnable .equalsIgnoreCase ("off" )) {
558557 requestTimeoutEnable = false ;
559558 } else {
560- throw new IllegalArgumentException (" invalid request timeout enable config. only support on/off" );
559+ throw new IllegalArgumentException (strRequestTimeoutEnable + " is invalid, request timeout enable config. only support on/off" );
561560 }
562561 }
563562
@@ -570,7 +569,7 @@ public void setRequestTimeoutMS(String strRequestTimeoutMS) throws IllegalArgume
570569 try {
571570 int number = Integer .valueOf (strRequestTimeoutMS );
572571 if (number <= 0 ) {
573- throw new IllegalArgumentException (" legal requestTimeoutMS must be gt 0" );
572+ throw new IllegalArgumentException (strRequestTimeoutMS + " is invalid, legal requestTimeoutMS must be gt 0" );
574573 }
575574 requestTimeoutMS = number ;
576575 } catch (NumberFormatException e ) {
@@ -587,11 +586,30 @@ public void setRequestTryCount(String strRequestTryCount) throws IllegalArgument
587586 try {
588587 int number = Integer .valueOf (strRequestTryCount );
589588 if (number <= 0 ) {
590- throw new IllegalArgumentException (" legal requestTryCount must be gt 0" );
589+ throw new IllegalArgumentException (strRequestTryCount + " is invalid, legal requestTryCount must be gt 0" );
591590 }
592591 requestTryCount = number ;
593592 } catch (NumberFormatException e ) {
594593 throw new IllegalArgumentException ("invalid requestTryCount" );
595594 }
596595 }
596+
597+ /**
598+ * 打印关键参数
599+ */
600+ public String toString () {
601+ return "cosPath=" + cosPath
602+ + ",https=" + isEnableHttps ()
603+ + ",shortConnection=" + isShortConnection ()
604+ + ",smallFileThreshold=" + getSmallFileThreshold ()
605+ + ",smallFileExecutorNum=" + getSmallFileExecutorNumber ()
606+ + ",bigFileExecutorNum=" + getBigFileExecutorNum ()
607+ + ",bigFileUploadPartSize=" + getBigFileUploadPartSize ()
608+ + ",threadTrafficLimit=" + getThreadTrafficLimit ()
609+ + ",executeTimeWindow=" + getTimeWindowBegin () + "," + getTimeWindowEnd ()
610+ + ",resume=" + isResume ()
611+ + ",skipSamePath=" + skipSamePath ()
612+ + ",requestTryCount=" + getRequestTryCount ()
613+ ;
614+ }
597615}
0 commit comments