Skip to content
This repository was archived by the owner on May 3, 2023. It is now read-only.

Commit adc5f4a

Browse files
fix: minor issue
1 parent 4630c46 commit adc5f4a

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ make finstall
1515

1616
## Configure proxy
1717

18-
You client can be used with [brightData](brightdata.com) proxy.
18+
Your client can be used with [brightData](brightdata.com) proxy.
1919
If you want to use this proxy, you have to configure it.
2020

2121
```java

pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@
1515
<artifactId>log4j-core</artifactId>
1616
<version>2.17.2</version>
1717
</dependency>
18-
<!-- log4j-slf4j-impl -->
19-
<dependency>
20-
<groupId>org.apache.logging.log4j</groupId>
21-
<artifactId>log4j-slf4j-impl</artifactId>
22-
<version>2.17.2</version>
23-
</dependency>
2418
<!-- Apache Httpclient -->
2519
<dependency>
2620
<groupId>org.apache.httpcomponents</groupId>

src/main/java/net/httpclient/wrapper/HttpClientWrapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static int getBrightDataPort() {
4747
* @return The brightdata username property set.
4848
*/
4949
public static String getBrightDataUsername() {
50-
return (System.getProperty("httpClientWrapperBrightDataUser"));
50+
return (System.getProperty("httpClientWrapperBrightDataUsername"));
5151
}
5252

5353
/**

src/main/java/net/httpclient/wrapper/exception/HttpClientException.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ public class HttpClientException extends HttpException {
77
public HttpClientException(HttpResponse httpResponse) {
88
super(httpResponse);
99
}
10+
1011
}

src/main/java/net/httpclient/wrapper/exception/HttpException.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
import org.apache.http.HttpResponse;
44

5-
class HttpException extends Exception {
5+
public class HttpException extends Exception {
66

77
private final HttpResponse httpResponse;
88

99
public HttpException(HttpResponse httpResponse) {
10-
super("http request return status code : " + httpResponse.getStatusLine().getStatusCode());
10+
super("Http request return status code : " + httpResponse.getStatusLine().getStatusCode());
1111
this.httpResponse = httpResponse;
1212
}
1313

1414
public HttpResponse getHttpResponse() {
15-
return httpResponse;
15+
return (httpResponse);
1616
}
1717

1818
public int getStatusCode() {

src/main/java/net/httpclient/wrapper/response/RequestResponse.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import org.apache.http.Header;
44
import org.apache.http.HttpResponse;
55
import org.apache.http.util.EntityUtils;
6+
import org.json.JSONArray;
67
import org.json.JSONObject;
78

89
import java.io.IOException;
@@ -55,10 +56,14 @@ public String getRawResponse() {
5556
return (rawResponse);
5657
}
5758

58-
public JSONObject getJsonResponse() {
59+
public JSONObject toJSONObject() {
5960
return (new JSONObject(rawResponse));
6061
}
6162

63+
public JSONArray toJSONArray() {
64+
return (new JSONArray(rawResponse));
65+
}
66+
6267
public long getTime() {
6368
if (start == null || end == null)
6469
return (-1);

src/main/java/net/httpclient/wrapper/session/HttpClientSessionBasic.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ public void setHttpCookieStore(BasicCookieStore httpCookieStore) {
224224
*/
225225
public JSONObject getIpInformation() throws HttpClientException, IOException, HttpServerException {
226226
RequestResponse requestResponse = sendGet("https://lumtest.com/echo.json");
227-
return (requestResponse.getJsonResponse());
227+
return (requestResponse.toJSONObject());
228228
}
229229

230230
public String getUserAgent() {

0 commit comments

Comments
 (0)