Skip to content

Commit ae0a51e

Browse files
shaileshmishrashaileshmishra
authored andcommitted
Documentation updated
New Features: • None
1 parent 63163dd commit ae0a51e

File tree

6 files changed

+49
-20
lines changed

6 files changed

+49
-20
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11

22
## CHANGELOG
33

4+
## Version 1.5.6
5+
###### Date: 27-Jan-2021
6+
Document updated
7+
8+
New Features:
9+
• None
410

511
## Version 1.5.5
612
###### Date: 22-Jan-2021

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.5</version>
23+
<version>1.5.6</version>
2424
</dependency>
2525
```
2626

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

3232
### Key Concepts for using Contentstack

pom.xml

Lines changed: 2 additions & 1 deletion
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.5</version>
9+
<version>1.5.6</version>
1010
<packaging>jar</packaging>
1111
<name>contentstack-java</name>
1212
<description>Java SDK for Contentstack Content Delivery API, Contentstack is a headless CMS with an API-first approach
@@ -291,6 +291,7 @@
291291
<goals>
292292
<goal>report</goal>
293293
</goals>
294+
294295
</execution>
295296
</executions>
296297
</plugin>

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ Assets refer to all the media files (images, videos, PDFs, audio files, and so o
1212
These files can be used in multiple entries.
1313
Read more about [Assets](https://www.contentstack.com/docs/guide/content-management#working-with-assets)
1414
*/
15-
1615
public class AssetLibrary implements INotifyClass{
1716

1817
private com.contentstack.sdk.Stack stackInstance;
@@ -27,7 +26,6 @@ public class AssetLibrary implements INotifyClass{
2726
* Sorting order enum for {@link AssetLibrary}.
2827
* @author Contentstack.com, Inc
2928
*/
30-
3129
public enum ORDERBY
3230
{
3331
ASCENDING,
@@ -60,7 +58,6 @@ protected void setStackInstance(Stack stack){
6058
* assetLibObject.setHeader("custom_header_key", "custom_header_value");
6159
* </pre>
6260
*/
63-
6461
public void setHeader(String key, String value) {
6562
if (!key.isEmpty() && !value.isEmpty()) {
6663
localHeader.put(key, value);

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

Lines changed: 38 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ protected Stack(String stackApiKey) {
6060
}
6161

6262
protected void setConfig(Config config){
63-
this.config = config;
64-
URLSCHEMA = config.URLSCHEMA;
65-
URL = config.URL;
66-
VERSION = config.VERSION;
63+
this.config = config;
64+
URLSCHEMA = config.URLSCHEMA;
65+
URL = config.URL;
66+
VERSION = config.VERSION;
6767

6868
if(!config.environment.isEmpty()){
6969
setHeader("environment", config.environment);
@@ -90,8 +90,11 @@ public ContentType contentType(String contentTypeName){
9090
}
9191

9292

93-
94-
93+
/**
94+
* Takes asset uid as a parameter and returns @{@link Asset} instance
95+
* @param uid uid of {@link Asset}
96+
* @return Asset instance
97+
*/
9598
public Asset asset(String uid){
9699
Asset asset = new Asset(uid);
97100
asset.setStackInstance(this);
@@ -106,33 +109,55 @@ protected Asset asset(){
106109
return asset;
107110
}
108111

109-
110-
112+
/**
113+
* assetLibrary returns AssetLibrary instance
114+
* @return @{@link AssetLibrary}
115+
*/
111116
public AssetLibrary assetLibrary(){
112117
AssetLibrary library = new AssetLibrary();
113118
library.setStackInstance(this);
114-
115119
return library;
116120
}
117121

118122

119-
123+
/**
124+
* Returns apiKey of particular stack
125+
* @return @{@link String} stack api key
126+
*/
120127
public String getApplicationKey(){ return stackApiKey;}
121128

122129

123-
130+
/**
131+
* Returns accessToken of particular stack
132+
* @return @{@link String} access token of particular stack
133+
*/
124134
public String getAccessToken(){ return localHeader != null ? (String)localHeader.get("access_token") : null;};
125135

126136

127-
137+
/**
138+
* Removes Header by key
139+
* @param key @{@link String} header key
140+
* <br><br><b>Example :</b><br>
141+
* stack.removeHeader("delivery_token");
142+
* <br><br>
143+
* </p>
144+
*/
128145
public void removeHeader(String key){
129146
if(!key.isEmpty()){
130147
localHeader.remove(key);
131148
}
132149
}
133150

134151

135-
152+
/**
153+
* Adds header to the stack by key and value
154+
* @param key @{@link String} header key
155+
* @param value @{@link String} header value
156+
* <p>
157+
* Example
158+
* stack.setHeader("delivery_token","blt843748744");
159+
* </p>
160+
*/
136161
public void setHeader(String key, String value) {
137162
if (!key.isEmpty() && !value.isEmpty()) {
138163
localHeader.put(key, value);

src/main/java/com/contentstack/sdk/utility/CSAppConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
public class CSAppConstants {
88

9-
public static final String SDK_VERSION = "1.5.5";
9+
public static final String SDK_VERSION = "1.5.6";
1010

1111
public static enum RequestMethod
1212
{

0 commit comments

Comments
 (0)