Skip to content

Commit db30f9a

Browse files
v1.0.0 - Removed Support Of Marketplace
1 parent dc92554 commit db30f9a

File tree

7 files changed

+35
-41
lines changed

7 files changed

+35
-41
lines changed

src/main/java/com/contentstack/cms/core/AuthInterceptor.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public AuthInterceptor(String authtoken) {
4343

4444
/**
4545
* The function sets the value of the authtoken variable.
46-
*
46+
*
4747
* @param authtoken The authtoken parameter is a string that represents an
4848
* authentication token.
4949
*/
@@ -55,7 +55,7 @@ public void setAuthtoken(String authtoken) {
5555
* This function intercepts a request and adds headers to it, including a user
5656
* agent, content type, and
5757
* authentication token if available.
58-
*
58+
*
5959
* @param chain The `chain` parameter is an object of type `Interceptor.Chain`.
6060
* It represents the chain
6161
* of interceptors that will be executed for a given request. It
@@ -68,10 +68,7 @@ public void setAuthtoken(String authtoken) {
6868
@Override
6969
public Response intercept(Chain chain) throws IOException {
7070
final String xUserAgent = Util.SDK_NAME + "/v" + Util.SDK_VERSION;
71-
Request.Builder request = chain.request().newBuilder()
72-
.header(Util.X_USER_AGENT, xUserAgent)
73-
.header(Util.USER_AGENT, Util.defaultUserAgent())
74-
.header(Util.CONTENT_TYPE, Util.CONTENT_TYPE_VALUE);
71+
Request.Builder request = chain.request().newBuilder().header(Util.X_USER_AGENT, xUserAgent).header(Util.USER_AGENT, Util.defaultUserAgent()).header(Util.CONTENT_TYPE, Util.CONTENT_TYPE_VALUE);
7572

7673
if (this.authtoken != null) {
7774
request.addHeader(Util.AUTHTOKEN, this.authtoken);

src/main/java/com/contentstack/cms/core/CMALogger.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class CMALogger {
1717

1818
/**
1919
* The function returns the logger object.
20-
*
20+
*
2121
* @return The method is returning an instance of the Logger class.
2222
*/
2323
public Logger getLogger() {
@@ -73,7 +73,7 @@ public void finer(@NotNull String message) {
7373

7474
/**
7575
* The function "warning" logs a warning message using a logger.
76-
*
76+
*
7777
* @param message A string parameter named "message" which is annotated with the
7878
* "@NotNull" annotation.
7979
*/
@@ -83,7 +83,7 @@ public void warning(@NotNull String message) {
8383

8484
/**
8585
* The function "severe" logs a severe-level message using a logger.
86-
*
86+
*
8787
* @param message A string parameter named "message" which is annotated with the
8888
* "@NotNull" annotation.
8989
*/

src/main/java/com/contentstack/cms/core/CMAResponseConvertor.java

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ public CMAResponseConvertor(Response<ResponseBody> response) {
3737
/**
3838
* The function returns the response body as a string if it is not null,
3939
* otherwise it returns null.
40-
*
41-
* @throws IOException if an I/O error occurs
40+
*
4241
* @return The method is returning a String.
42+
* @throws IOException if an I/O error occurs
4343
*/
4444
public String asString() throws IOException {
4545
return this.response.body() != null ? this.response.body().string() : null;
@@ -48,10 +48,10 @@ public String asString() throws IOException {
4848
/**
4949
* The function converts the response body to a JSON string using the Gson
5050
* library.
51-
*
52-
* @throws IOException if an I/O error occurs
51+
*
5352
* @return The method is returning a JSON string representation of the response
54-
* body.
53+
* body.
54+
* @throws IOException if an I/O error occurs
5555
*/
5656
public String asJson() throws IOException {
5757
String body = this.response.body() != null ? this.response.body().string() : null;
@@ -61,7 +61,7 @@ public String asJson() throws IOException {
6161
/**
6262
* The function takes a string as input and converts it to a JSON string using
6363
* the Gson library.
64-
*
64+
*
6565
* @param string The parameter "string" is a String object that represents the
6666
* input string that you
6767
* want to convert to JSON format.
@@ -76,15 +76,15 @@ public String asJson(String string) {
7676
* The function converts a JSON response body into a Java object of the
7777
* specified class using the Gson
7878
* library.
79-
*
79+
*
8080
* @param <T> the type of the parameter
8181
* @param tClass The `tClass` parameter is a `Class` object that represents the
8282
* type of the model class
8383
* that you want to convert the response body to.
84-
* @throws IOException if an I/O error occurs
8584
* @return The method is returning an object of type T, which is determined by
86-
* the input parameter
87-
* tClass.
85+
* the input parameter
86+
* tClass.
87+
* @throws IOException if an I/O error occurs
8888
*/
8989
public <T> T toModel(Class<T> tClass) throws IOException {
9090
Objects.requireNonNull(tClass, MODEL_NULL_CHECK);
@@ -96,12 +96,9 @@ public <T> T toModel(Class<T> tClass) throws IOException {
9696
* It accepts the modal class and the string data response to return the model
9797
* class
9898
*
99-
* @param tClass
100-
* the class
101-
* @param response
102-
* data response
103-
* @param <T>
104-
* the model class type
99+
* @param tClass the class
100+
* @param response data response
101+
* @param <T> the model class type
105102
* @return the model class
106103
*/
107104
public <T> T toModel(Class<T> tClass, String response) {
@@ -120,7 +117,7 @@ public <T> T toModel(Class<T> tClass, Response<ResponseBody> response) throws IO
120117
/**
121118
* The function `requestBody` returns the request object associated with a given
122119
* call instance.
123-
*
120+
*
124121
* @param callInstance An instance of the Call class, which represents a network
125122
* request in OkHttp.
126123
* @return The method is returning a Request object.

src/main/java/com/contentstack/cms/core/ContentstackResponse.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ class ContentstackResponse<T> {
3232
* The function fetches a response from a network call and returns it, or throws
3333
* a CMARuntimeException
3434
* if an IOException occurs.
35-
*
35+
*
3636
* @param response The "response" parameter is an instance of the
3737
* `Call<ResponseBody>` class, which
3838
* represents a network request that has been enqueued for
3939
* execution. It is used to make the actual
4040
* network call and retrieve the response.
4141
* @return The method is returning a Response object with a generic type of
42-
* ResponseBody.
42+
* ResponseBody.
4343
*/
4444
public Response<ResponseBody> fetch(Call<ResponseBody> response) throws CMARuntimeException {
4545
try {
@@ -51,18 +51,18 @@ public Response<ResponseBody> fetch(Call<ResponseBody> response) throws CMARunti
5151

5252
/**
5353
* The function returns a Response object of type T.
54-
*
54+
*
5555
* @return The method is returning a generic type `Response<T>`. However, in
56-
* this specific
57-
* implementation, it is returning `null`.
56+
* this specific
57+
* implementation, it is returning `null`.
5858
*/
5959
Response<T> getResponse() {
6060
return null;
6161
}
6262

6363
/**
6464
* The function returns a null value of type ResponseBody.
65-
*
65+
*
6666
* @return The method is returning a null value.
6767
*/
6868
ResponseBody getResponseBody() {

src/main/java/com/contentstack/cms/core/ResponseResult.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class ResponseResult<T> {
2020
/**
2121
* The function executes a network call and returns the response data or an
2222
* error object.
23-
*
23+
*
2424
* @param call The <b>call</b> parameter is an instance of the `Call` interface,
2525
* which represents a single
2626
* request to be executed. It is a generic type, where `T`

src/main/java/com/contentstack/cms/core/RetryCallback.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ protected RetryCallback(Call<T> call) {
3737
* The function logs the localized message of the thrown exception and retries
3838
* the API call if the
3939
* retry count is less than the total number of retries allowed.
40-
*
40+
*
4141
* @param call The `Call` object represents the network call that was made. It
4242
* contains information
4343
* about the request and response.

src/main/java/com/contentstack/cms/core/Util.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ public class Util {
6565
* The function returns the default user agent string for a Java application,
6666
* including the Java
6767
* version and operating system.
68-
*
68+
*
6969
* @return The method is returning a string value. The string value being
70-
* returned is either the value
71-
* of the "http.agent" system property if it is not null, or a default
72-
* string value "Java" concatenated
73-
* with the Java version and the operating system name.
70+
* returned is either the value
71+
* of the "http.agent" system property if it is not null, or a default
72+
* string value "Java" concatenated
73+
* with the Java version and the operating system name.
7474
*/
7575
protected static String defaultUserAgent() {
7676
String agent = System.getProperty("http.agent");
@@ -81,7 +81,7 @@ protected static String defaultUserAgent() {
8181
/**
8282
* The function checks if a given string is null or empty and throws an
8383
* exception if it is.
84-
*
84+
*
8585
* @param field The parameter "field" is of type String and is annotated with
8686
* the "@NotNull"
8787
* annotation.
@@ -105,7 +105,7 @@ public static void assertionError() {
105105
/**
106106
* The function converts a string into a RequestBody object with a specified
107107
* media type.
108-
*
108+
*
109109
* @param bodyString The `bodyString` parameter is a string that represents the
110110
* body of the request. It
111111
* can contain any data that you want to send in the request

0 commit comments

Comments
 (0)