Skip to content

Commit

Permalink
housekeeping: replace calls to "System.out.println()" with "Log.d()"
Browse files Browse the repository at this point in the history
  • Loading branch information
warren-bank committed Mar 28, 2020
1 parent 665d51e commit dc47bcc
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
import org.apache.http.message.BasicHttpEntityEnclosingRequest;
import org.apache.http.message.BasicHttpRequest;

import android.util.Log;

public class MyHttpRequestFactory extends DefaultHttpRequestFactory {
private static final String tag = MyHttpRequestFactory.class.getSimpleName();
private static final String[] RFC2616_COMMON_METHODS = {"GET"};
private static final String[] RFC2616_ENTITY_ENC_METHODS = {"POST", "PUT"};
private static final String[] RFC2616_SPECIAL_METHODS = {"HEAD", "OPTIONS", "DELETE", "TRACE", "CONNECT"};
Expand All @@ -31,21 +34,21 @@ public HttpRequest newHttpRequest(final RequestLine requestline)
throw new IllegalArgumentException("Request line may not be null");
}
String method = requestline.getMethod();
System.out.println("in MyHTTPRequestFactory requestMethod=" + method);
Log.d(tag, "requestMethod = " + method);
if (isOneOf(RFC2616_COMMON_METHODS, method)) {
//System.out.println("RFC2616_COMMON_METHODS,in MyHTTPRequestFactory create new BasicHttpRequest(requestline)");
Log.d(tag, "RFC2616_COMMON_METHODS: create new BasicHttpRequest(requestline)");
return new BasicHttpRequest(requestline);
}
else if (isOneOf(RFC2616_ENTITY_ENC_METHODS, method)) {
//System.out.println("RFC2616_ENTITY_ENC_METHODS,in MyHTTPRequestFactory create new BasicHttpEntityEnclosingRequest(requestline)");
Log.d(tag, "RFC2616_ENTITY_ENC_METHODS: create new BasicHttpEntityEnclosingRequest(requestline)");
return new BasicHttpEntityEnclosingRequest(requestline);
}
else if (isOneOf(RFC2616_SPECIAL_METHODS, method)) {
//System.out.println("RFC2616_SPECIAL_METHODS,in MyHTTPRequestFactory create new BasicHttpRequest(requestline)");
Log.d(tag, "RFC2616_SPECIAL_METHODS: create new BasicHttpRequest(requestline)");
return new BasicHttpRequest(requestline);
}
else if ("200".equalsIgnoreCase(method)) {
//System.out.println("200 Revese HTTP, MyHTTPRequestFactory create new BasicHttpEntityEnclosingRequest(requestline)");
Log.d(tag, "200 Reverse HTTP: create new BasicHttpEntityEnclosingRequest(requestline)");
return new BasicHttpRequest(requestline);
}
else {
Expand Down

0 comments on commit dc47bcc

Please sign in to comment.