Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfeeeb7f

Browse files
author
Stephane Landelle
committed
minor clean up
1 parentef1372f commitfeeeb7f

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

‎src/main/java/com/ning/http/util/AsyncHttpProviderUtils.java‎

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -300,25 +300,23 @@ public final static MultipartRequestEntity createMultipartRequestEntity(List<Par
300300
for (Partpart :params) {
301301
if (partinstanceofcom.ning.http.multipart.Part) {
302302
parts[i] = (com.ning.http.multipart.Part)part;
303+
303304
}elseif (partinstanceofStringPart) {
304-
parts[i] =newcom.ning.http.multipart.StringPart(part.getName(),
305-
((StringPart)part).getValue(),
306-
((StringPart)part).getCharset());
305+
StringPartstringPart = (StringPart)part;
306+
parts[i] =newcom.ning.http.multipart.StringPart(part.getName(),stringPart.getValue(),stringPart.getCharset());
307+
307308
}elseif (partinstanceofFilePart) {
308-
parts[i] =newcom.ning.http.multipart.FilePart(part.getName(),
309-
((FilePart)part).getFile(),
310-
((FilePart)part).getMimeType(),
311-
((FilePart)part).getCharSet());
309+
FilePartfilePart = (FilePart)part;
310+
parts[i] =newcom.ning.http.multipart.FilePart(part.getName(),filePart.getFile(),filePart.getMimeType(),filePart.getCharSet());
312311

313312
}elseif (partinstanceofByteArrayPart) {
314-
PartSourcesource =newByteArrayPartSource(((ByteArrayPart)part).getFileName(), ((ByteArrayPart)part).getData());
315-
parts[i] =newcom.ning.http.multipart.FilePart(part.getName(),
316-
source,
317-
((ByteArrayPart)part).getMimeType(),
318-
((ByteArrayPart)part).getCharSet());
313+
ByteArrayPartbyteArrayPart = (ByteArrayPart)part;
314+
PartSourcesource =newByteArrayPartSource(byteArrayPart.getFileName(),byteArrayPart.getData());
315+
parts[i] =newcom.ning.http.multipart.FilePart(part.getName(),source,byteArrayPart.getMimeType(),byteArrayPart.getCharSet());
319316

320317
}elseif (part ==null) {
321318
thrownewNullPointerException("Part cannot be null");
319+
322320
}else {
323321
thrownewIllegalArgumentException(String.format("Unsupported part type for multipart parameter %s",
324322
part.getName()));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp