Skip to content

Commit d970c66

Browse files
Merge pull request #19 from contentstack/automation
Automation
2 parents e27a431 + f93f5a7 commit d970c66

Some content is hidden

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

44 files changed

+56
-886
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@
33

44
------------------------------------------------
55

6+
## Version 1.5.2
7+
###### Date: 23-July-2020
8+
- [Bump Issue] : Bump Issue: log4j-core from 2.5 to 2.13.2
9+
- [Query] : Query.locale() documentation
10+
- [ CSHttpConnection ] : StandardCharsets.UTF_8 Support Added
11+
12+
13+
------------------------------------------------
14+
15+
## Version 1.5.1
16+
###### Date: 13-Jan-2020
17+
- [ dependency vulnerability ] : Java Github reported vulnerable issue on dependency logj
18+
19+
------------------------------------------------
20+
621
## Version 1.5.0
722
###### Date: 15-Nov-2019
823
- [Stack]: Added support for function getContentType()

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ To use the Contentstack Java SDK to your existing project, perform the steps giv
2020
<dependency>
2121
<groupId>com.contentstack.sdk</groupId>
2222
<artifactId>java</artifactId>
23-
<version>1.5.1</version>
23+
<version>1.5.2</version>
2424
</dependency>
2525
```
2626

2727
2. **Gradle**
2828
```
29-
implementation 'com.contentstack.sdk:java:1.5.1'
29+
implementation 'com.contentstack.sdk:java:1.5.2'
3030
```
3131

3232
### Key Concepts for using Contentstack

pom.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Written manually.
2-
version=1.5.1
2+
version=1.5.2
33
groupId=com.contentstack.sdk
44
artifactId=java

pom.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<modelVersion>4.0.0</modelVersion>
77
<groupId>com.contentstack.sdk</groupId>
88
<artifactId>java</artifactId>
9-
<version>1.5.1-SNAPSHOT</version>
9+
<version>1.5.2-SNAPSHOT</version>
1010
<packaging>jar</packaging>
1111

1212
<name>contentstack-java</name>
@@ -111,10 +111,14 @@
111111

112112
<build>
113113
<plugins>
114-
114+
115+
<!-- https://maven.apache.org/surefire/maven-surefire-report-plugin/examples/changing-report-name.html-->
115116
<plugin>
116117
<groupId>org.apache.maven.plugins</groupId>
117118
<artifactId>maven-surefire-report-plugin</artifactId>
119+
<configuration>
120+
<outputName>contentstack-java-test-report</outputName>
121+
</configuration>
118122
<version>2.22.0</version>
119123
</plugin>
120124

src/main/java/com/contentstack/sdk/Asset.java

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,8 @@
99

1010

1111
/**
12-
* MIT License
13-
*
14-
* Copyright (c) 2012 - 2019 Contentstack
15-
*
16-
* Permission is hereby granted, free of charge, to any person obtaining a copy
17-
* of this software and associated documentation files (the "Software"), to deal
18-
* in the Software without restriction, including without limitation the rights
19-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
20-
* copies of the Software, and to permit persons to whom the Software is
21-
* furnished to do so, subject to the following conditions:
22-
*
23-
* The above copyright notice and this permission notice shall be included in all
24-
* copies or substantial portions of the Software.
25-
*
26-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
29-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
31-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32-
* SOFTWARE.
12+
* Asset refer to the media file (images, videos, PDFs, audio files, and so on)
13+
* uploaded to Contentstack. These files can be used in multiple entries.
3314
*/
3415

3516
public class Asset {

src/main/java/com/contentstack/sdk/AssetLibrary.java

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,9 @@
88
import java.util.*;
99

1010
/**
11-
*
12-
* MIT License
13-
*
14-
* Copyright (c) 2012 - 2019 Contentstack
15-
*
16-
* Permission is hereby granted, free of charge, to any person obtaining a copy
17-
* of this software and associated documentation files (the "Software"), to deal
18-
* in the Software without restriction, including without limitation the rights
19-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
20-
* copies of the Software, and to permit persons to whom the Software is
21-
* furnished to do so, subject to the following conditions:
22-
*
23-
* The above copyright notice and this permission notice shall be included in all
24-
* copies or substantial portions of the Software.
25-
*
26-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
29-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
31-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32-
* SOFTWARE.
11+
Assets refer to all the media files (images, videos, PDFs, audio files, and so on) uploaded to Contentstack.
12+
These files can be used in multiple entries.
13+
Read more about [Assets](https://www.contentstack.com/docs/guide/content-management#working-with-assets)
3314
*/
3415

3516
public class AssetLibrary implements INotifyClass{

src/main/java/com/contentstack/sdk/AssetModel.java

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,7 @@
88

99
/**
1010
* @Author Shailesh Mishra
11-
*
12-
* MIT License
13-
*
14-
* Copyright (c) 2012 - 2019 Contentstack
15-
*
16-
* Permission is hereby granted, free of charge, to any person obtaining a copy
17-
* of this software and associated documentation files (the "Software"), to deal
18-
* in the Software without restriction, including without limitation the rights
19-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
20-
* copies of the Software, and to permit persons to whom the Software is
21-
* furnished to do so, subject to the following conditions:
22-
*
23-
* The above copyright notice and this permission notice shall be included in all
24-
* copies or substantial portions of the Software.
25-
*
26-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
29-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
31-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32-
* SOFTWARE.
11+
* Asset Object Model
3312
*/
3413

3514
class AssetModel {

src/main/java/com/contentstack/sdk/AssetsModel.java

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,6 @@
66
import java.util.ArrayList;
77
import java.util.List;
88

9-
/**
10-
* MIT License
11-
*
12-
* Copyright (c) 2012 - 2019 Contentstack
13-
*
14-
* Permission is hereby granted, free of charge, to any person obtaining a copy
15-
* of this software and associated documentation files (the "Software"), to deal
16-
* in the Software without restriction, including without limitation the rights
17-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18-
* copies of the Software, and to permit persons to whom the Software is
19-
* furnished to do so, subject to the following conditions:
20-
*
21-
* The above copyright notice and this permission notice shall be included in all
22-
* copies or substantial portions of the Software.
23-
*
24-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30-
* SOFTWARE.
31-
*/
32-
339
class AssetsModel {
3410

3511
List<Object> objects = new ArrayList<Object>();

src/main/java/com/contentstack/sdk/CSBackgroundTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
package com.contentstack.sdk;import com.contentstack.sdk.utility.CSAppConstants;import org.json.JSONObject;import java.util.HashMap;import java.util.LinkedHashMap;/** * @Author Contentstack * * MIT License * * Copyright (c) 2012 - 2019 Contentstack * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */class CSBackgroundTask { public CSBackgroundTask(Query queryInstance, Stack stackInstance, String controller, String url, LinkedHashMap<String, Object> headers, LinkedHashMap<String, Object> urlQueries, JSONObject jsonMain, String requestInfo, CSAppConstants.RequestMethod method, ResultCallBack callback) { if (headers != null && headers.size() > 0) { String URL = stackInstance.URLSCHEMA + stackInstance.URL + url; CSConnectionRequest csConnectionRequest = new CSConnectionRequest(queryInstance); csConnectionRequest.setQueryInstance(queryInstance); csConnectionRequest.setURLQueries(urlQueries); csConnectionRequest.setParams(URL, method, controller, jsonMain, headers, requestInfo, callback); } else { sendErrorForHeader(callback); } } public CSBackgroundTask(Entry entryInstance, Stack stackInstance, String controller, String url, LinkedHashMap<String, Object> headers, HashMap<String, Object> urlQueries, JSONObject jsonMain, String requestInfo, boolean isOffline, CSAppConstants.RequestMethod method, ResultCallBack callBack) { if (headers != null && headers.size() > 0) { String URL = stackInstance.URLSCHEMA + stackInstance.URL + url; CSConnectionRequest csConnectionRequest = new CSConnectionRequest(entryInstance); csConnectionRequest.setURLQueries(urlQueries); csConnectionRequest.setParams(URL, method, controller, jsonMain, headers, requestInfo, callBack); } else { sendErrorForHeader(callBack); } } public CSBackgroundTask(AssetLibrary assetLibrary, Stack stackInstance, String controller, String url, LinkedHashMap<String, Object> headers, HashMap<String, Object> urlQueries, JSONObject jsonMain, String requestInfo, boolean isOffline, CSAppConstants.RequestMethod method, ResultCallBack callback) { if (headers != null && headers.size() > 0) { String URL = stackInstance.URLSCHEMA + stackInstance.URL + url; CSConnectionRequest csConnectionRequest = new CSConnectionRequest(assetLibrary); csConnectionRequest.setURLQueries(urlQueries); csConnectionRequest.setParams(URL, method, controller, jsonMain, headers, requestInfo, callback); } else { sendErrorForHeader(callback); } } public CSBackgroundTask(Asset asset, Stack stackInstance, String controller, String url, LinkedHashMap<String, Object> headers, HashMap<String, Object> urlQueries, JSONObject jsonMain, String requestInfo, boolean isOffline, CSAppConstants.RequestMethod method, ResultCallBack callback) { if (headers != null && headers.size() > 0) { String URL = stackInstance.URLSCHEMA + stackInstance.URL + url; CSConnectionRequest csConnectionRequest = new CSConnectionRequest(asset); csConnectionRequest.setURLQueries(urlQueries); csConnectionRequest.setParams(URL, method, controller, jsonMain, headers, requestInfo, callback); } else { sendErrorForHeader(callback); } } public CSBackgroundTask(Stack stackInstance, String controller, String url, HashMap<String, Object> headers, HashMap<String, Object> urlParams, JSONObject jsonMain, String requestInfo, boolean b, CSAppConstants.RequestMethod method, ResultCallBack callback) { if (headers != null && headers.size() > 0) { String URL = stackInstance.URLSCHEMA + stackInstance.URL + url; CSConnectionRequest csConnectionRequest = new CSConnectionRequest(stackInstance); csConnectionRequest.setStackInstance(stackInstance); csConnectionRequest.setURLQueries(urlParams); csConnectionRequest.setParams(URL, method, controller, jsonMain, headers, requestInfo, callback); } else { sendErrorForHeader(callback); } } public CSBackgroundTask(ContentType contentTypeInstance, Stack stackInstance, String controller, String url, HashMap<String, Object> headers, HashMap<String, Object> urlParams, JSONObject jsonMain, String requestInfo, boolean b, CSAppConstants.RequestMethod method, ResultCallBack callback) { if (headers != null && headers.size() > 0) { String URL = stackInstance.URLSCHEMA + stackInstance.URL + url; CSConnectionRequest csConnectionRequest = new CSConnectionRequest(contentTypeInstance); csConnectionRequest.setURLQueries(urlParams); csConnectionRequest.setParams(URL, method, controller, jsonMain, headers, requestInfo, callback); } else { sendErrorForHeader(callback); } } private void sendErrorForHeader(ResultCallBack callbackObject) { Error error = new Error(); error.setErrorMessage(CSAppConstants.ErrorMessage_CalledDefaultMethod); if (callbackObject != null) { callbackObject.onRequestFail(ResponseType.UNKNOWN, error); } }}
1+
package com.contentstack.sdk;import com.contentstack.sdk.utility.CSAppConstants;import org.json.JSONObject;import java.util.HashMap;import java.util.LinkedHashMap;class CSBackgroundTask { public CSBackgroundTask(Query queryInstance, Stack stackInstance, String controller, String url, LinkedHashMap<String, Object> headers, LinkedHashMap<String, Object> urlQueries, JSONObject jsonMain, String requestInfo, CSAppConstants.RequestMethod method, ResultCallBack callback) { if (headers != null && headers.size() > 0) { String URL = stackInstance.URLSCHEMA + stackInstance.URL + url; CSConnectionRequest csConnectionRequest = new CSConnectionRequest(queryInstance); csConnectionRequest.setQueryInstance(queryInstance); csConnectionRequest.setURLQueries(urlQueries); csConnectionRequest.setParams(URL, method, controller, jsonMain, headers, requestInfo, callback); } else { sendErrorForHeader(callback); } } public CSBackgroundTask(Entry entryInstance, Stack stackInstance, String controller, String url, LinkedHashMap<String, Object> headers, HashMap<String, Object> urlQueries, JSONObject jsonMain, String requestInfo, boolean isOffline, CSAppConstants.RequestMethod method, ResultCallBack callBack) { if (headers != null && headers.size() > 0) { String URL = stackInstance.URLSCHEMA + stackInstance.URL + url; CSConnectionRequest csConnectionRequest = new CSConnectionRequest(entryInstance); csConnectionRequest.setURLQueries(urlQueries); csConnectionRequest.setParams(URL, method, controller, jsonMain, headers, requestInfo, callBack); } else { sendErrorForHeader(callBack); } } public CSBackgroundTask(AssetLibrary assetLibrary, Stack stackInstance, String controller, String url, LinkedHashMap<String, Object> headers, HashMap<String, Object> urlQueries, JSONObject jsonMain, String requestInfo, boolean isOffline, CSAppConstants.RequestMethod method, ResultCallBack callback) { if (headers != null && headers.size() > 0) { String URL = stackInstance.URLSCHEMA + stackInstance.URL + url; CSConnectionRequest csConnectionRequest = new CSConnectionRequest(assetLibrary); csConnectionRequest.setURLQueries(urlQueries); csConnectionRequest.setParams(URL, method, controller, jsonMain, headers, requestInfo, callback); } else { sendErrorForHeader(callback); } } public CSBackgroundTask(Asset asset, Stack stackInstance, String controller, String url, LinkedHashMap<String, Object> headers, HashMap<String, Object> urlQueries, JSONObject jsonMain, String requestInfo, boolean isOffline, CSAppConstants.RequestMethod method, ResultCallBack callback) { if (headers != null && headers.size() > 0) { String URL = stackInstance.URLSCHEMA + stackInstance.URL + url; CSConnectionRequest csConnectionRequest = new CSConnectionRequest(asset); csConnectionRequest.setURLQueries(urlQueries); csConnectionRequest.setParams(URL, method, controller, jsonMain, headers, requestInfo, callback); } else { sendErrorForHeader(callback); } } public CSBackgroundTask(Stack stackInstance, String controller, String url, HashMap<String, Object> headers, HashMap<String, Object> urlParams, JSONObject jsonMain, String requestInfo, boolean b, CSAppConstants.RequestMethod method, ResultCallBack callback) { if (headers != null && headers.size() > 0) { String URL = stackInstance.URLSCHEMA + stackInstance.URL + url; CSConnectionRequest csConnectionRequest = new CSConnectionRequest(stackInstance); csConnectionRequest.setStackInstance(stackInstance); csConnectionRequest.setURLQueries(urlParams); csConnectionRequest.setParams(URL, method, controller, jsonMain, headers, requestInfo, callback); } else { sendErrorForHeader(callback); } } public CSBackgroundTask(ContentType contentTypeInstance, Stack stackInstance, String controller, String url, HashMap<String, Object> headers, HashMap<String, Object> urlParams, JSONObject jsonMain, String requestInfo, boolean b, CSAppConstants.RequestMethod method, ResultCallBack callback) { if (headers != null && headers.size() > 0) { String URL = stackInstance.URLSCHEMA + stackInstance.URL + url; CSConnectionRequest csConnectionRequest = new CSConnectionRequest(contentTypeInstance); csConnectionRequest.setURLQueries(urlParams); csConnectionRequest.setParams(URL, method, controller, jsonMain, headers, requestInfo, callback); } else { sendErrorForHeader(callback); } } private void sendErrorForHeader(ResultCallBack callbackObject) { Error error = new Error(); error.setErrorMessage(CSAppConstants.ErrorMessage_CalledDefaultMethod); if (callbackObject != null) { callbackObject.onRequestFail(ResponseType.UNKNOWN, error); } }}

0 commit comments

Comments
 (0)