Skip to content

Commit 23fe3c7

Browse files
asset docs updated
1 parent bd80ac2 commit 23fe3c7

File tree

1 file changed

+96
-85
lines changed

1 file changed

+96
-85
lines changed

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

Lines changed: 96 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,15 @@
1414
import static com.contentstack.sdk.Constants.parseDate;
1515

1616
/**
17-
* <a href= "https://www.contentstack.com/docs/content-managers/working-with-assets/about-assets">Assets</a> refer to
18-
* all the media files (images, videos, PDFs, audio files, and so on) uploaded in your Contentstack repository for
17+
* <a href=
18+
* "https://www.contentstack.com/docs/content-managers/working-with-assets/about-assets">Assets</a>
19+
* refer to
20+
* all the media files (images, videos, PDFs, audio files, and so on) uploaded
21+
* in your Contentstack repository for
1922
* future use. These files can be attached and used in multiple entries.
2023
* <p>
21-
* You can now pass the branch header in the API request to fetch or manage modules located within specific branches of
24+
* You can now pass the branch header in the API request to fetch or manage
25+
* modules located within specific branches of
2226
* the stack.
2327
*
2428
* @author Shailesh Mishra
@@ -93,16 +97,18 @@ public void setHeader(@NotNull String headerKey, @NotNull String headerValue) {
9397
}
9498

9599
/**
96-
* Remove header.
97-
*
98-
* @param headerKey the header key
99-
*
100-
* <br>
100+
* The function removes a header from a collection of headers based on a given
101+
* key.
102+
*
103+
* @param headerKey The parameter "headerKey" is a String that represents the
104+
* key of the header to
105+
* be removed.
101106
* <br>
102107
* <b>Example :</b>
103108
* <p>
104109
* <code>
105-
* Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment"); Asset asset =
110+
* Stack stack = Contentstack.stack("apiKey", "deliveryToken",
111+
* "environment"); Asset asset =
106112
* stack.asset(asset_uid); asset.removeHeader();
107113
* <code>
108114
*/
@@ -121,11 +127,11 @@ protected void setUid(@NotNull String assetUid) {
121127
*
122128
* @return the asset uid
123129
*
124-
* <br>
125-
* <br>
126-
* <b>Example :</b><br>
130+
* <br>
131+
* <br>
132+
* <b>Example :</b><br>
127133
*
128-
* <code>
134+
* <code>
129135
* Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment"); Asset asset = stack.asset(asset_uid);
130136
* asset.fetch(new FetchResultCallback() { &#64;Override public void onCompletion(ResponseType responseType, Error
131137
* error) { asset.getAssetUid(); } });
@@ -141,15 +147,20 @@ public String getAssetUid() {
141147
*
142148
* @return the file type
143149
*
144-
* <br>
145-
* <br>
146-
* <b>Example :</b><br>
150+
* <br>
151+
* <br>
152+
* <b>Example :</b><br>
147153
*
148-
* <pre class="prettyprint">
149-
* Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment"); Asset asset = stack.asset(asset_uid);
150-
* asset.fetch(new FetchResultCallback() { &#64;Override public void onCompletion(ResponseType responseType, Error
151-
* error) { asset.getFileType(); } });
152-
* </pre>
154+
* <pre class="prettyprint">
155+
* Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment");
156+
* Asset asset = stack.asset(asset_uid);
157+
* asset.fetch(new FetchResultCallback() {
158+
* &#64;Override
159+
* public void onCompletion(ResponseType responseType, Error error) {
160+
* asset.getFileType();
161+
* }
162+
* });
163+
* </pre>
153164
*/
154165
public String getFileType() {
155166
return contentType;
@@ -160,11 +171,11 @@ public String getFileType() {
160171
*
161172
* @return the file size
162173
*
163-
* <br>
164-
* <br>
165-
* <b>Example :</b><br>
174+
* <br>
175+
* <br>
176+
* <b>Example :</b><br>
166177
*
167-
* <pre class="prettyprint">
178+
* <pre class="prettyprint">
168179
* Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment");
169180
* Asset asset = stack.asset(asset_uid);
170181
* asset.fetch(new FetchResultCallback() {
@@ -185,11 +196,11 @@ public String getFileSize() {
185196
*
186197
* @return the file name
187198
*
188-
* <br>
189-
* <br>
190-
* <b>Example :</b><br>
199+
* <br>
200+
* <br>
201+
* <b>Example :</b><br>
191202
*
192-
* <pre class="prettyprint">
203+
* <pre class="prettyprint">
193204
* Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment");
194205
* Asset asset = stack.asset(asset_uid);
195206
* asset.fetch(new FetchResultCallback() {
@@ -210,11 +221,11 @@ public String getFileName() {
210221
*
211222
* @return the url
212223
*
213-
* <br>
214-
* <br>
215-
* <b>Example :</b><br>
224+
* <br>
225+
* <br>
226+
* <b>Example :</b><br>
216227
*
217-
* <pre class="prettyprint">
228+
* <pre class="prettyprint">
218229
* Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment");
219230
* Asset asset = stack.asset(asset_uid);
220231
* asset.fetch(new FetchResultCallback() {
@@ -235,11 +246,11 @@ public String getUrl() {
235246
*
236247
* @return the json object
237248
*
238-
* <br>
239-
* <br>
240-
* <b>Example :</b><br>
249+
* <br>
250+
* <br>
251+
* <b>Example :</b><br>
241252
*
242-
* <pre class="prettyprint">
253+
* <pre class="prettyprint">
243254
* Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment");
244255
* Asset asset = stack.asset(asset_uid);
245256
* asset.fetch(new FetchResultCallback() {
@@ -259,10 +270,10 @@ public JSONObject toJSON() {
259270
* Gets create at.
260271
*
261272
* @return the create at
262-
* <br>
263-
* <b>Example :</b><br>
273+
* <br>
274+
* <b>Example :</b><br>
264275
*
265-
* <pre class="prettyprint">
276+
* <pre class="prettyprint">
266277
* Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment");
267278
* Asset asset = stack.asset(asset_uid);
268279
* asset.fetch(new FetchResultCallback() {
@@ -283,11 +294,11 @@ public Calendar getCreateAt() {
283294
*
284295
* @return the created by
285296
*
286-
* <br>
287-
* <br>
288-
* <b>Example :</b><br>
297+
* <br>
298+
* <br>
299+
* <b>Example :</b><br>
289300
*
290-
* <pre class="prettyprint">
301+
* <pre class="prettyprint">
291302
* Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment");
292303
* Asset asset = stack.asset(asset_uid);
293304
* asset.fetch(new FetchResultCallback() {
@@ -308,11 +319,11 @@ public String getCreatedBy() {
308319
*
309320
* @return the update at
310321
*
311-
* <br>
312-
* <br>
313-
* <b>Example :</b><br>
322+
* <br>
323+
* <br>
324+
* <b>Example :</b><br>
314325
*
315-
* <pre class="prettyprint">
326+
* <pre class="prettyprint">
316327
* Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment");
317328
* Asset asset = stack.asset(asset_uid);
318329
* asset.fetch(new FetchResultCallback() {
@@ -332,11 +343,11 @@ public Calendar getUpdateAt() {
332343
* Gets updated by.
333344
*
334345
* @return the updated by
335-
* <br>
336-
* <br>
337-
* <b>Example :</b><br>
346+
* <br>
347+
* <br>
348+
* <b>Example :</b><br>
338349
*
339-
* <pre class="prettyprint">
350+
* <pre class="prettyprint">
340351
* Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment");
341352
* Asset asset = stack.asset(asset_uid);
342353
* asset.fetch(new FetchResultCallback() {
@@ -357,11 +368,11 @@ public String getUpdatedBy() {
357368
*
358369
* @return the delete at
359370
*
360-
* <br>
361-
* <br>
362-
* <b>Example :</b><br>
371+
* <br>
372+
* <br>
373+
* <b>Example :</b><br>
363374
*
364-
* <pre class="prettyprint">
375+
* <pre class="prettyprint">
365376
* Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment");
366377
* Asset asset = stack.asset(asset_uid);
367378
* asset.fetch(new FetchResultCallback() {
@@ -382,11 +393,11 @@ public Calendar getDeleteAt() {
382393
*
383394
* @return the deleted by
384395
*
385-
* <br>
386-
* <br>
387-
* <b>Example :</b><br>
396+
* <br>
397+
* <br>
398+
* <b>Example :</b><br>
388399
*
389-
* <pre class="prettyprint">
400+
* <pre class="prettyprint">
390401
* Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment");
391402
* Asset asset = stack.asset(asset_uid);
392403
* asset.fetch(new FetchResultCallback() {
@@ -405,11 +416,11 @@ public String getDeletedBy() {
405416
* Get tags string [ ].
406417
*
407418
* @return the string [ ]
408-
* <br>
409-
* <br>
410-
* <b>Example :</b><br>
419+
* <br>
420+
* <br>
421+
* <b>Example :</b><br>
411422
*
412-
* <pre class="prettyprint">
423+
* <pre class="prettyprint">
413424
* Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment");
414425
* Asset asset = stack.asset(asset_uid);
415426
* asset.fetch(new FetchResultCallback() {
@@ -435,11 +446,11 @@ protected Asset setTags(String[] tags) {
435446
*
436447
* @return the asset
437448
*
438-
* <br>
439-
* <br>
440-
* <b>Example :</b><br>
449+
* <br>
450+
* <br>
451+
* <b>Example :</b><br>
441452
*
442-
* <pre class="prettyprint">
453+
* <pre class="prettyprint">
443454
* Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment");
444455
* Asset asset = stack.asset(asset_uid);
445456
* asset.includeDimension();
@@ -457,11 +468,11 @@ public Asset includeDimension() {
457468
* @param paramValue the param value
458469
* @return the asset
459470
*
460-
* <br>
461-
* <br>
462-
* <b>Example :</b><br>
471+
* <br>
472+
* <br>
473+
* <b>Example :</b><br>
463474
*
464-
* <pre class="prettyprint">
475+
* <pre class="prettyprint">
465476
* Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment");
466477
* Asset asset = stack.asset(asset_uid);
467478
* asset.addParam();
@@ -476,11 +487,11 @@ public Asset addParam(@NotNull String paramKey, @NotNull String paramValue) {
476487
* Include fallback asset.
477488
*
478489
* @return the asset
479-
* <br>
480-
* <br>
481-
* <b>Example :</b><br>
490+
* <br>
491+
* <br>
492+
* <b>Example :</b><br>
482493
*
483-
* <pre class="prettyprint">
494+
* <pre class="prettyprint">
484495
* Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment");
485496
* Asset asset = stack.asset(asset_uid);
486497
* asset.includeFallback();
@@ -496,11 +507,11 @@ public Asset includeFallback() {
496507
*
497508
* @return {@link Asset} object, so you can chain this call. <br>
498509
*
499-
* <br>
500-
* <br>
501-
* <b>Example :</b><br>
510+
* <br>
511+
* <br>
512+
* <b>Example :</b><br>
502513
*
503-
* <code>
514+
* <code>
504515
* Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment"); Asset asset = stack.asset(asset_uid);
505516
* asset.includeBranch();
506517
* </code>
@@ -515,11 +526,11 @@ public Asset includeBranch() {
515526
*
516527
* @return {@link Asset} object, so you can chain this call. <br>
517528
*
518-
* <br>
519-
* <br>
520-
* <b>Example :</b><br>
529+
* <br>
530+
* <br>
531+
* <b>Example :</b><br>
521532
*
522-
* <code>
533+
* <code>
523534
* Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment"); Asset asset = stack.asset(asset_uid);
524535
* asset.includeMetadata();
525536
* </code>
@@ -540,7 +551,7 @@ public void fetch(FetchResultCallback callback) {
540551
}
541552

542553
private void fetchFromNetwork(String url, JSONObject urlQueries, LinkedHashMap<String, Object> headers,
543-
FetchResultCallback callback) {
554+
FetchResultCallback callback) {
544555
if (callback != null) {
545556
HashMap<String, Object> urlParams = getUrlParams(urlQueries);
546557
new CSBackgroundTask(this, stackInstance, Constants.FETCHASSETS, url, headers, urlParams,

0 commit comments

Comments
 (0)