33
33
import java .util .Locale ;
34
34
import java .util .Map ;
35
35
import java .util .Set ;
36
- import java .util .concurrent .ConcurrentHashMap ;
36
+ import java .util .concurrent .ConcurrentSkipHashMap ;
37
37
38
38
import cz .msebera .android .httpclient .HttpEntity ;
39
39
import cz .msebera .android .httpclient .client .entity .UrlEncodedFormEntity ;
@@ -99,11 +99,11 @@ public class RequestParams implements Serializable {
99
99
"application/json" ;
100
100
101
101
protected final static String LOG_TAG = "RequestParams" ;
102
- protected final ConcurrentHashMap <String , String > urlParams = new ConcurrentHashMap <String , String >();
103
- protected final ConcurrentHashMap <String , StreamWrapper > streamParams = new ConcurrentHashMap <String , StreamWrapper >();
104
- protected final ConcurrentHashMap <String , FileWrapper > fileParams = new ConcurrentHashMap <String , FileWrapper >();
105
- protected final ConcurrentHashMap <String , List <FileWrapper >> fileArrayParams = new ConcurrentHashMap <String , List <FileWrapper >>();
106
- protected final ConcurrentHashMap <String , Object > urlParamsWithObjects = new ConcurrentHashMap <String , Object >();
102
+ protected final ConcurrentSkipHashMap <String , String > urlParams = new ConcurrentSkipHashMap <String , String >();
103
+ protected final ConcurrentSkipHashMap <String , StreamWrapper > streamParams = new ConcurrentSkipHashMap <String , StreamWrapper >();
104
+ protected final ConcurrentSkipHashMap <String , FileWrapper > fileParams = new ConcurrentSkipHashMap <String , FileWrapper >();
105
+ protected final ConcurrentSkipHashMap <String , List <FileWrapper >> fileArrayParams = new ConcurrentSkipHashMap <String , List <FileWrapper >>();
106
+ protected final ConcurrentSkipHashMap <String , Object > urlParamsWithObjects = new ConcurrentSkipHashMap <String , Object >();
107
107
protected boolean isRepeatable ;
108
108
protected boolean forceMultipartEntity = false ;
109
109
protected boolean useJsonStreamer ;
@@ -425,7 +425,7 @@ public boolean has(String key) {
425
425
@ Override
426
426
public String toString () {
427
427
StringBuilder result = new StringBuilder ();
428
- for (ConcurrentHashMap .Entry <String , String > entry : urlParams .entrySet ()) {
428
+ for (ConcurrentSkipHashMap .Entry <String , String > entry : urlParams .entrySet ()) {
429
429
if (result .length () > 0 )
430
430
result .append ("&" );
431
431
@@ -434,7 +434,7 @@ public String toString() {
434
434
result .append (entry .getValue ());
435
435
}
436
436
437
- for (ConcurrentHashMap .Entry <String , StreamWrapper > entry : streamParams .entrySet ()) {
437
+ for (ConcurrentSkipHashMap .Entry <String , StreamWrapper > entry : streamParams .entrySet ()) {
438
438
if (result .length () > 0 )
439
439
result .append ("&" );
440
440
@@ -443,7 +443,7 @@ public String toString() {
443
443
result .append ("STREAM" );
444
444
}
445
445
446
- for (ConcurrentHashMap .Entry <String , FileWrapper > entry : fileParams .entrySet ()) {
446
+ for (ConcurrentSkipHashMap .Entry <String , FileWrapper > entry : fileParams .entrySet ()) {
447
447
if (result .length () > 0 )
448
448
result .append ("&" );
449
449
@@ -452,7 +452,7 @@ public String toString() {
452
452
result .append ("FILE" );
453
453
}
454
454
455
- for (ConcurrentHashMap .Entry <String , List <FileWrapper >> entry : fileArrayParams .entrySet ()) {
455
+ for (ConcurrentSkipHashMap .Entry <String , List <FileWrapper >> entry : fileArrayParams .entrySet ()) {
456
456
if (result .length () > 0 )
457
457
result .append ("&" );
458
458
@@ -530,22 +530,22 @@ private HttpEntity createJsonStreamerEntity(ResponseHandlerInterface progressHan
530
530
elapsedFieldInJsonStreamer );
531
531
532
532
// Add string params
533
- for (ConcurrentHashMap .Entry <String , String > entry : urlParams .entrySet ()) {
533
+ for (ConcurrentSkipHashMap .Entry <String , String > entry : urlParams .entrySet ()) {
534
534
entity .addPart (entry .getKey (), entry .getValue ());
535
535
}
536
536
537
537
// Add non-string params
538
- for (ConcurrentHashMap .Entry <String , Object > entry : urlParamsWithObjects .entrySet ()) {
538
+ for (ConcurrentSkipHashMap .Entry <String , Object > entry : urlParamsWithObjects .entrySet ()) {
539
539
entity .addPart (entry .getKey (), entry .getValue ());
540
540
}
541
541
542
542
// Add file params
543
- for (ConcurrentHashMap .Entry <String , FileWrapper > entry : fileParams .entrySet ()) {
543
+ for (ConcurrentSkipHashMap .Entry <String , FileWrapper > entry : fileParams .entrySet ()) {
544
544
entity .addPart (entry .getKey (), entry .getValue ());
545
545
}
546
546
547
547
// Add stream params
548
- for (ConcurrentHashMap .Entry <String , StreamWrapper > entry : streamParams .entrySet ()) {
548
+ for (ConcurrentSkipHashMap .Entry <String , StreamWrapper > entry : streamParams .entrySet ()) {
549
549
StreamWrapper stream = entry .getValue ();
550
550
if (stream .inputStream != null ) {
551
551
entity .addPart (entry .getKey (),
@@ -575,7 +575,7 @@ private HttpEntity createMultipartEntity(ResponseHandlerInterface progressHandle
575
575
entity .setIsRepeatable (isRepeatable );
576
576
577
577
// Add string params
578
- for (ConcurrentHashMap .Entry <String , String > entry : urlParams .entrySet ()) {
578
+ for (ConcurrentSkipHashMap .Entry <String , String > entry : urlParams .entrySet ()) {
579
579
entity .addPartWithCharset (entry .getKey (), entry .getValue (), contentEncoding );
580
580
}
581
581
@@ -586,7 +586,7 @@ private HttpEntity createMultipartEntity(ResponseHandlerInterface progressHandle
586
586
}
587
587
588
588
// Add stream params
589
- for (ConcurrentHashMap .Entry <String , StreamWrapper > entry : streamParams .entrySet ()) {
589
+ for (ConcurrentSkipHashMap .Entry <String , StreamWrapper > entry : streamParams .entrySet ()) {
590
590
StreamWrapper stream = entry .getValue ();
591
591
if (stream .inputStream != null ) {
592
592
entity .addPart (entry .getKey (), stream .name , stream .inputStream ,
@@ -595,13 +595,13 @@ private HttpEntity createMultipartEntity(ResponseHandlerInterface progressHandle
595
595
}
596
596
597
597
// Add file params
598
- for (ConcurrentHashMap .Entry <String , FileWrapper > entry : fileParams .entrySet ()) {
598
+ for (ConcurrentSkipHashMap .Entry <String , FileWrapper > entry : fileParams .entrySet ()) {
599
599
FileWrapper fileWrapper = entry .getValue ();
600
600
entity .addPart (entry .getKey (), fileWrapper .file , fileWrapper .contentType , fileWrapper .customFileName );
601
601
}
602
602
603
603
// Add file collection
604
- for (ConcurrentHashMap .Entry <String , List <FileWrapper >> entry : fileArrayParams .entrySet ()) {
604
+ for (ConcurrentSkipHashMap .Entry <String , List <FileWrapper >> entry : fileArrayParams .entrySet ()) {
605
605
List <FileWrapper > fileWrapper = entry .getValue ();
606
606
for (FileWrapper fw : fileWrapper ) {
607
607
entity .addPart (entry .getKey (), fw .file , fw .contentType , fw .customFileName );
@@ -614,7 +614,7 @@ private HttpEntity createMultipartEntity(ResponseHandlerInterface progressHandle
614
614
protected List <BasicNameValuePair > getParamsList () {
615
615
List <BasicNameValuePair > lparams = new LinkedList <BasicNameValuePair >();
616
616
617
- for (ConcurrentHashMap .Entry <String , String > entry : urlParams .entrySet ()) {
617
+ for (ConcurrentSkipHashMap .Entry <String , String > entry : urlParams .entrySet ()) {
618
618
lparams .add (new BasicNameValuePair (entry .getKey (), entry .getValue ()));
619
619
}
620
620
0 commit comments