@@ -1142,14 +1142,14 @@ private void checkFilterForProcess() throws IOException {
1142
1142
private void setUnitLen () throws IOException {
1143
1143
String unitLen = entryParam .getValue ("unit-len" , "-1" ).trim ();
1144
1144
if (unitLen .startsWith ("-" )) {
1145
- if (isSelfUpload ) this .unitLen = 3 ;
1146
- if ("qiniu" . equals ( source ) || "local " .equals (source )) this .unitLen = 10000 ;
1145
+ if (isSelfUpload ) this .unitLen = 20 ;
1146
+ else if ("qiniu" .equals (source )) this .unitLen = 10000 ;
1147
1147
else this .unitLen = 1000 ;
1148
1148
} else {
1149
1149
ParamsUtils .checked (unitLen , "unit-len" , "\\ d+" );
1150
1150
this .unitLen = Integer .parseInt (unitLen );
1151
1151
if (isSelfUpload && this .unitLen > 100 ) {
1152
- throw new IOException ("file upload shouldn't has too big unit-len, suggest setting unit-len smaller than 100." );
1152
+ throw new IOException ("file upload shouldn't have too big unit-len, suggest to set unit-len smaller than 100." );
1153
1153
}
1154
1154
}
1155
1155
}
@@ -1243,20 +1243,17 @@ private void setSavePath() throws IOException {
1243
1243
} else {
1244
1244
File file = new File (savePath );
1245
1245
File [] files = file .listFiles ();
1246
- boolean isOk = false ;
1246
+ boolean isOk ;
1247
1247
if (files != null && files .length > 0 ) {
1248
- for (File file1 : files ) {
1249
- if (file1 .length () > 0 ) {
1250
- if (file1 .getName ().startsWith (source ) || (!"" .equals (process ) && file1 .getName ().startsWith (process ))) {
1251
- isOk = true ;
1252
- break ;
1253
- }
1254
- }
1248
+ if ("" .equals (process )) {
1249
+ isOk = Arrays .asList (files ).parallelStream ().anyMatch (f -> f .getName ().startsWith (source ));
1250
+ } else {
1251
+ isOk = Arrays .asList (files ).parallelStream ().anyMatch (f -> f .getName ().startsWith (source ) || f .getName ().startsWith (process ));
1255
1252
}
1256
1253
if (isOk ) {
1257
1254
if (pathConfigMap == null || pathConfigMap .size () <= 0 ) {
1258
1255
throw new IOException (String .format ("please change the save-path \" %s\" , " +
1259
- "because there are last listed files, for not cover them." , savePath ));
1256
+ "because there are remained files from last job , for not cover them." , savePath ));
1260
1257
}
1261
1258
} else {
1262
1259
throw new IOException (String .format ("please change save-path \" %s\" because it's not empty." , savePath ));
0 commit comments