Skip to content

Commit 2d94c04

Browse files
committed
1.5 devel backup [RENAME !!!]
1 parent f32c234 commit 2d94c04

File tree

66 files changed

+1338
-1085
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1338
-1085
lines changed

library/build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
apply plugin: 'com.android.library'
22

3+
dependencies {
4+
compile group: 'org.apache.httpcomponents', name: 'httpclient-android', version: '4.3.5'
5+
compile group: 'com.intellij', name: 'annotations', version: '12.0'
6+
}
7+
38
android {
49
compileSdkVersion 21
510
buildToolsVersion '21.1.2'

library/src/main/java/com/loopj/android/http/AsyncHttpClient.java

Lines changed: 216 additions & 212 deletions
Large diffs are not rendered by default.

library/src/main/java/com/loopj/android/http/AsyncHttpRequest.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020

2121
import android.util.Log;
2222

23+
import com.loopj.android.http.handler.RangeFileAsyncHttpResponseHandler;
24+
import com.loopj.android.http.interfaces.ResponseHandlerInterface;
25+
import com.loopj.android.http.util.Utils;
26+
2327
import org.apache.http.HttpResponse;
2428
import org.apache.http.client.HttpRequestRetryHandler;
2529
import org.apache.http.client.methods.HttpUriRequest;
@@ -39,8 +43,8 @@ public class AsyncHttpRequest implements Runnable {
3943
private final HttpContext context;
4044
private final HttpUriRequest request;
4145
private final ResponseHandlerInterface responseHandler;
42-
private int executionCount;
4346
private final AtomicBoolean isCancelled = new AtomicBoolean();
47+
private int executionCount;
4448
private boolean cancelIsNotified;
4549
private volatile boolean isFinished;
4650
private boolean isRequestPreProcessed;
@@ -110,7 +114,7 @@ public void run() {
110114
if (!isCancelled()) {
111115
responseHandler.sendFailureMessage(0, null, null, e);
112116
} else {
113-
Log.e("AsyncHttpRequest", "makeRequestWithRetries returned error", e);
117+
Logger.e("AsyncHttpRequest", "makeRequestWithRetries returned error", e);
114118
}
115119
}
116120

@@ -204,7 +208,7 @@ private void makeRequestWithRetries() throws IOException {
204208
}
205209
} catch (Exception e) {
206210
// catch anything else to ensure failure message is propagated
207-
Log.e("AsyncHttpRequest", "Unhandled exception origin cause", e);
211+
Logger.e("AsyncHttpRequest", "Unhandled exception origin cause", e);
208212
cause = new IOException("Unhandled exception: " + e.getMessage());
209213
}
210214

library/src/main/java/com/loopj/android/http/HttpPatch.java

Lines changed: 0 additions & 54 deletions
This file was deleted.

library/src/main/java/com/loopj/android/http/RequestHandle.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@
2020

2121
import android.os.Looper;
2222

23+
import com.loopj.android.http.interfaces.RequestHandleInterface;
24+
2325
import java.lang.ref.WeakReference;
2426

2527
/**
2628
* A Handle to an AsyncRequest which can be used to cancel a running request.
2729
*/
28-
public class RequestHandle {
30+
public class RequestHandle implements RequestHandleInterface {
2931
private final WeakReference<AsyncHttpRequest> request;
3032

3133
public RequestHandle(AsyncHttpRequest request) {

library/src/main/java/com/loopj/android/http/RequestParams.java

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020

2121
import android.util.Log;
2222

23+
import com.loopj.android.http.interfaces.ResponseHandlerInterface;
24+
import com.loopj.android.http.entities.JsonStreamerEntity;
25+
import com.loopj.android.http.util.SimpleMultipartEntity;
26+
2327
import org.apache.http.HttpEntity;
2428
import org.apache.http.client.entity.UrlEncodedFormEntity;
2529
import org.apache.http.client.utils.URLEncodedUtils;
@@ -97,29 +101,15 @@ public class RequestParams implements Serializable {
97101
"application/json";
98102

99103
protected final static String LOG_TAG = "RequestParams";
100-
protected boolean isRepeatable;
101-
protected boolean useJsonStreamer;
102-
protected boolean autoCloseInputStreams;
103104
protected final ConcurrentHashMap<String, String> urlParams = new ConcurrentHashMap<String, String>();
104105
protected final ConcurrentHashMap<String, StreamWrapper> streamParams = new ConcurrentHashMap<String, StreamWrapper>();
105106
protected final ConcurrentHashMap<String, FileWrapper> fileParams = new ConcurrentHashMap<String, FileWrapper>();
106107
protected final ConcurrentHashMap<String, Object> urlParamsWithObjects = new ConcurrentHashMap<String, Object>();
108+
protected boolean isRepeatable;
109+
protected boolean useJsonStreamer;
110+
protected boolean autoCloseInputStreams;
107111
protected String contentEncoding = HTTP.UTF_8;
108112

109-
/**
110-
* Sets content encoding for return value of {@link #getParamString()} and {@link
111-
* #createFormEntity()} <p>&nbsp;</p> Default encoding is "UTF-8"
112-
*
113-
* @param encoding String constant from {@link org.apache.http.protocol.HTTP}
114-
*/
115-
public void setContentEncoding(final String encoding) {
116-
if (encoding != null) {
117-
this.contentEncoding = encoding;
118-
} else {
119-
Log.d(LOG_TAG, "setContentEncoding called with null attribute");
120-
}
121-
}
122-
123113
/**
124114
* Constructs a new empty {@code RequestParams} instance.
125115
*/
@@ -173,6 +163,20 @@ public RequestParams(Object... keysAndValues) {
173163
}
174164
}
175165

166+
/**
167+
* Sets content encoding for return value of {@link #getParamString()} and {@link
168+
* #createFormEntity()} <p>&nbsp;</p> Default encoding is "UTF-8"
169+
*
170+
* @param encoding String constant from {@link org.apache.http.protocol.HTTP}
171+
*/
172+
public void setContentEncoding(final String encoding) {
173+
if (encoding != null) {
174+
this.contentEncoding = encoding;
175+
} else {
176+
Logger.d(LOG_TAG, "setContentEncoding called with null attribute");
177+
}
178+
}
179+
176180
/**
177181
* Adds a key/value string pair to the request.
178182
*
@@ -488,7 +492,7 @@ private HttpEntity createFormEntity() {
488492
try {
489493
return new UrlEncodedFormEntity(getParamsList(), contentEncoding);
490494
} catch (UnsupportedEncodingException e) {
491-
Log.e(LOG_TAG, "createFormEntity failed", e);
495+
Logger.e(LOG_TAG, "createFormEntity failed", e);
492496
return null; // Can happen, if the 'contentEncoding' won't be HTTP.UTF_8
493497
}
494498
}

library/src/main/java/com/loopj/android/http/SyncHttpClient.java

Lines changed: 0 additions & 101 deletions
This file was deleted.

library/src/main/java/com/loopj/android/http/Utils.java

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)