Package com.contentstack.sdk
Class AssetLibrary
java.lang.Object
com.contentstack.sdk.AssetLibrary
- All Implemented Interfaces:
INotifyClass
The Asset library is used to get list of assets available in the stack, We can apply filters on the assets also. The
Get all assets request fetches the list of all the assets of a particular stack. It returns the content of each asset
in JSON format.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoid
fetchAll
(FetchAssetsCallback callback) Fetch all.int
getCount()
Gets count.void
void
getResultObject
(List<Object> objects, org.json.JSONObject jsonObject, boolean isSingleEntry) Include count asset library.Retrieve the published content of the fallback locale if an entry is not localized in specified localeRetrieve Metadata in the responseInclude relative url asset library.void
removeHeader
(String headerKey) Remove header.void
Sets header.sort
(String keyOrderBy, AssetLibrary.ORDERBY orderby) Sort asset library.
-
Method Details
-
setHeader
Sets header.- Parameters:
headerKey
- the header keyheaderValue
- the header value
-
removeHeader
Remove header.- Parameters:
headerKey
- the header key
-
sort
Sort asset library.- Parameters:
keyOrderBy
- the key order byorderby
- the orderby- Returns:
- the asset library
-
includeCount
Include count asset library.- Returns:
- the asset library
-
includeRelativeUrl
Include relative url asset library.- Returns:
- the asset library
-
includeFallback
Retrieve the published content of the fallback locale if an entry is not localized in specified locale- Returns:
AssetLibrary
object, so you can chain this call.
Example :
Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment"); AssetLibrary assetLibObject = stack.assetLibrary(); AssetLibrary.includeFallback();
-
includeMetadata
Retrieve Metadata in the response- Returns:
AssetLibrary
object, so you can chain this call.
Example :
Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment"); AssetLibrary assetLibObject = stack.includeOwner(); AssetLibrary.includeMetadata();
-
getCount
public int getCount()Gets count.- Returns:
- the count
-
fetchAll
Fetch all.- Parameters:
callback
- the callback
-
getResult
- Specified by:
getResult
in interfaceINotifyClass
-
getResultObject
public void getResultObject(List<Object> objects, org.json.JSONObject jsonObject, boolean isSingleEntry) - Specified by:
getResultObject
in interfaceINotifyClass
-