|
@@ -4,6 +4,7 @@ import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Map.Entry;
|
|
|
|
|
|
+import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.springframework.core.io.FileSystemResource;
|
|
|
import org.springframework.http.HttpEntity;
|
|
|
import org.springframework.http.HttpHeaders;
|
|
@@ -287,10 +288,12 @@ public abstract class CloudClientSupport {
|
|
|
httpHeaders.setContentType(MediaType.MULTIPART_FORM_DATA);
|
|
|
|
|
|
List<FormFilePart> formFilePartList = req.getFormFilePartList();
|
|
|
- for (FormFilePart part : formFilePartList) {
|
|
|
- FileSystemResource resource = new CustomFileSystemResource(part.getFile(),
|
|
|
- part.getFilename());
|
|
|
- params.add(part.getParamName(), resource);
|
|
|
+ if (CollectionUtils.isNotEmpty(formFilePartList)) {
|
|
|
+ for (FormFilePart part : formFilePartList) {
|
|
|
+ FileSystemResource resource = new CustomFileSystemResource(part.getFile(),
|
|
|
+ part.getFilename());
|
|
|
+ params.add(part.getParamName(), resource);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
String json = JsonUtil.toJson(req);
|