Skip to content

Commit

Permalink
release 1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
jesusbmx committed Sep 3, 2024
1 parent b80e2d9 commit 71c7d35
Show file tree
Hide file tree
Showing 60 changed files with 33 additions and 41 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
To include Juno in your project using Gradle, add the following dependency:
```
dependencies {
implementation 'com.github.jesusbmx:juno:1.0.1'
implementation 'com.github.jesusbmx:juno-http-client:1.0.1'
implementation 'com.github.jesusbmx:juno:1.0.3'
implementation 'com.github.jesusbmx:juno-http-client:1.0.3'
}
```

Alternatively, you can download the JAR file directly from [JitPack](https://jitpack.io/#jesusbmx/juno-http-client):

Download [juno.jar](https://jitpack.io/com/github/jesusbmx/juno/1.0.1/juno-1.0.1.jar)
Download [juno.jar](https://jitpack.io/com/github/jesusbmx/juno/1.0.3/juno-1.0.3.jar)

Download [juno-http-client.jar](https://jitpack.io/com/github/jesusbmx/juno-http-client/1.0.1/juno-http-client-1.0.1.jar)
Download [juno-http-client.jar](https://jitpack.io/com/github/jesusbmx/juno-http-client/1.0.3/juno-http-client-1.0.3.jar)


## [Samples](src/test/java/Samples.java)
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.jesusbmx</groupId>
<artifactId>juno-http-client</artifactId>
<version>1.0.1</version>
<version>1.0.3</version>
<packaging>jar</packaging>

<!--
Expand All @@ -22,7 +22,7 @@
<dependency>
<groupId>com.github.jesusbmx</groupId>
<artifactId>juno</artifactId>
<version>1.0.1</version>
<version>1.0.3</version>
<!--
El scope está establecido en provided, lo que significa que
la dependencia solo se utilizará en tiempo de compilación y
Expand Down
52 changes: 22 additions & 30 deletions src/main/java/juno/http/convert/json/JSONResponseBodyConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,54 +8,46 @@

public class JSONResponseBodyConverter {

private static String readAndValidateJson(HttpResponse response) throws Exception {
String json = null;
try {
json = response.readString();
if (json == null || json.isEmpty()) {
throw new JSONException("Response body is null or empty");
}
return json;
} finally {
response.close();
}
}

public static class Obj implements ResponseBodyConverter<JSONObject> {

public static final Obj INSTANCE = new Obj();

@Override
public JSONObject convert(HttpResponse response) throws Exception {
String json = readAndValidateJson(response);
try {
String json = response.readString();

if (json == null) {
throw new JSONException("json == null");
}

if (json.isEmpty()) {
throw new JSONException("json is empty");
}

return new JSONObject(json);

} finally {
response.close();
} catch (JSONException e) {
throw new Exception("Failed to parse JSONObject from response: " + json, e);
}
}
}

public static class Array implements ResponseBodyConverter<JSONArray> {
public static final Array INSTANCE = new Array();

public static final Array INSTANCE = new Array();

@Override
public JSONArray convert(HttpResponse response) throws Exception {
String json = readAndValidateJson(response);
try {
String json = response.readString();

if (json == null) {
throw new JSONException("json == null");
}

if (json.isEmpty()) {
throw new JSONException("json is empty");
}

return new JSONArray(json);

} finally {
response.close();
} catch (JSONException e) {
throw new Exception("Failed to parse JSONArray from response: " + json, e);
}
}
}

}
Binary file modified target/classes/juno/http/AsyncHttpRequest.class
Binary file not shown.
Binary file modified target/classes/juno/http/Debug.class
Binary file not shown.
Binary file modified target/classes/juno/http/FormBody.class
Binary file not shown.
Binary file modified target/classes/juno/http/Headers.class
Binary file not shown.
Binary file modified target/classes/juno/http/HttpClient.class
Binary file not shown.
Binary file modified target/classes/juno/http/HttpRequest.class
Binary file not shown.
Binary file modified target/classes/juno/http/HttpResponse.class
Binary file not shown.
Binary file modified target/classes/juno/http/HttpStack.class
Binary file not shown.
Binary file not shown.
Binary file modified target/classes/juno/http/HttpURLConnectionStack.class
Binary file not shown.
Binary file modified target/classes/juno/http/HttpUrl.class
Binary file not shown.
Binary file modified target/classes/juno/http/MultipartBody$Part.class
Binary file not shown.
Binary file modified target/classes/juno/http/MultipartBody.class
Binary file not shown.
Binary file modified target/classes/juno/http/OnInterceptor.class
Binary file not shown.
Binary file modified target/classes/juno/http/RequestBody$1.class
Binary file not shown.
Binary file modified target/classes/juno/http/RequestBody$2.class
Binary file not shown.
Binary file modified target/classes/juno/http/RequestBody$3.class
Binary file not shown.
Binary file modified target/classes/juno/http/RequestBody.class
Binary file not shown.
Binary file modified target/classes/juno/http/auth/Authorization.class
Binary file not shown.
Binary file modified target/classes/juno/http/auth/BasicAuthorization.class
Binary file not shown.
Binary file modified target/classes/juno/http/auth/JwtToken.class
Binary file not shown.
Binary file not shown.
Binary file modified target/classes/juno/http/auth/JwtTokenProvider.class
Binary file not shown.
Binary file modified target/classes/juno/http/auth/OAuthAuthorization.class
Binary file not shown.
Binary file modified target/classes/juno/http/auth/Token.class
Binary file not shown.
Binary file modified target/classes/juno/http/auth/TokenAuthorization.class
Binary file not shown.
Binary file modified target/classes/juno/http/auth/TokenProvider.class
Binary file not shown.
Binary file modified target/classes/juno/http/cache/CacheInterceptor.class
Binary file not shown.
Binary file modified target/classes/juno/http/cache/CacheModel.class
Binary file not shown.
Binary file modified target/classes/juno/http/cache/CacheSource.class
Binary file not shown.
Binary file modified target/classes/juno/http/convert/ConverterFactory.class
Binary file not shown.
Binary file modified target/classes/juno/http/convert/RequestBodyConverter.class
Binary file not shown.
Binary file modified target/classes/juno/http/convert/ResponseBodyConverter.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified target/classes/juno/http/convert/gson/GsonConverterFactory.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified target/classes/juno/http/convert/json/JSONConverterFactory.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added target/juno-http-client-1.0.3.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions target/maven-archiver/pom.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Generated by Maven
#Tue Sep 03 12:27:32 CST 2024
version=1.0.1
#Tue Sep 03 15:58:18 CST 2024
version=1.0.3
groupId=com.github.jesusbmx
artifactId=juno-http-client
2 changes: 1 addition & 1 deletion target/surefire-reports/AsynTest.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-------------------------------------------------------------------------------
Test set: AsynTest
-------------------------------------------------------------------------------
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec
2 changes: 1 addition & 1 deletion target/surefire-reports/InterceptorTest.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-------------------------------------------------------------------------------
Test set: InterceptorTest
-------------------------------------------------------------------------------
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec
2 changes: 1 addition & 1 deletion target/surefire-reports/convert.gson.GsonTest.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-------------------------------------------------------------------------------
Test set: convert.gson.GsonTest
-------------------------------------------------------------------------------
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec

0 comments on commit 71c7d35

Please sign in to comment.