Folder

View as Markdown

Folder

addParam

Sets header for the request.

NameTypeDescription
key (required)String
Query parameter key for the request.
value (required)Object
Query parameter value for the request.
import contentstack;

Contentstack contentstack = new Contentstack.Builder().build();

Folder folder = contentstack.stack().folder();

folder.addParam("key", value);

delete

The "Delete a folder" call is used to delete an asset folder along with all the assets within that folder.

When executing the API call, provide the parent folder UID.

import contentstack;

Contentstack contentstack = new Contentstack.Builder().build();

Folder folder = contentstack.stack().folder();

Call<ResponseBody> response = folder.delete().execute();

if (response.isSuccessful) {

    System.out.println("Response" + response);

}

create

The "Create a folder" call is used to create an asset folder and/or add a parent folder to it (if required).

NameTypeDescription
requestBody (required)JSONObject

The request body to create a delivery token.

import contentstack;

Contentstack contentstack = new Contentstack.Builder().build();

Folder folder = contentstack.stack().folder();

Call<ResponseBody> response = folder.create(requestBody).execute();

if (response.isSuccessful) {

    System.out.println("Response" + response);

}

update

The "Update or move folder" request can be used either to update the details of a folder or set the parent folder if you want to move a folder under another folder.

When executing the API request, provide the UID of the folder that you want to move/update.

NameTypeDescription
requestBody (required)JSONObject

The request body.

import contentstack;

Contentstack contentstack = new Contentstack.Builder().build();

Folder folder = contentstack.stack().folder();

Call<ResponseBody> response = folder.update(requestBody).execute();

if (response.isSuccessful) {

    System.out.println("Response" + response);

}

removeParam

Set header for the request.

NameTypeDescription
key (required)String

Removes query parameters using the key of the request.

import contentstack;

Contentstack contentstack = new Contentstack.Builder().build();

Folder folder = contentstack.stack().folder();

folder.removeParam("key");

fetch

The "Get a single folder" call gets the comprehensive details of a specific asset folder using folder UID.

When executing the API call to search for a subfolder, you will need to provide the parent folder UID.

import contentstack;

Contentstack contentstack = new Contentstack.Builder().build();

Folder folder = contentstack.stack().folder();

Call<ResponseBody> response = folder.fetch().execute();

if (response.isSuccessful) {

    System.out.println("Response" + response);

}

addHeader

Sets header for the request.

NameTypeDescription
key (required)String
Header key for the request.
value (required)Object
Header value for the request.
import contentstack;

Contentstack contentstack = new Contentstack.Builder().build();

Folder folder = contentstack.stack().folder();

folder.addHeader("key", value);