public class CQAssetsClient extends CQClient
CQClient.Builder, CQClient.InternalBuilder<T extends CQClient>| Modifier and Type | Field and Description |
|---|---|
protected static long |
ASSET_PROCESSED_DELAY
The default delay between polling for asset processing status, 500L milliseconds.
|
protected static long |
ASSET_PROCESSED_TIMEOUT
The default timeout for asset processing, 30000L milliseconds.
|
STATISTICS_ROOT, wcmCommands| Constructor and Description |
|---|
CQAssetsClient(org.apache.http.impl.client.CloseableHttpClient http,
org.apache.sling.testing.clients.SlingClientConfig config) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAssetProcessingFailures(String assetPath)
Retrieve any processing failures with an asset.
|
String |
getAssetStatus(String assetPath)
Retrieve the asset processing status.
|
boolean |
isDirectBinaryAccessSupported()
Check if Direct Binary Access is enabled
|
org.apache.sling.testing.clients.SlingHttpResponse |
uploadAsset(String fileName,
String resourcePath,
String mimeType,
String parentPath,
int... expectedStatus)
Uploads an Asset to the repository.
|
void |
waitAssetProcessed(String assetPath)
Wait for an asset to complete processing.
|
void |
waitAssetProcessed(String assetPath,
long timeout,
long delay)
Wait for an asset to complete processing.
|
copyLanguages, copyPage, createPage, createPageWithRetry, createVersion, deletePage, deletePageWithRetry, getAuthorSitesPage, lockPage, movePage, movePage, pageExists, pageExistsWithRetry, pageExistsWithRetry, resetPageStatistics, restoreTree, restoreVersion, rolloutPage, searchAndReplaceInPages, searchInPages, setPageProperties, setPageProperty, setPagePropertyImage, unlockPage, uploadFileCQStylecreateFolder, createNode, createNodeRecursive, deletePath, doGetJson, exists, getJsonNode, getJsonNode, getNodeNameFromPath, getParentPath, getUUId, getUUID, importContent, importContent, importJson, move, setPropertiesString, setPropertyString, setPropertyStringArray, upload, waitExists, waitUntilExistsadaptTo, addValue, close, doDelete, doGet, doGet, doGet, doHead, doPatch, doPost, doPost, doPut, doRawRequest, doRequest, doStreamGet, doStreamPost, doStreamRequest, execute, execute, execute, execute, execute, execute, execute, execute, getClientId, getConnectionManager, getCookieStore, getCredentialsProvider, getParams, getPassword, getPath, getPath, getUrl, getUrl, getUrl, getUser, getValue, getValues, hasValueprotected static final long ASSET_PROCESSED_TIMEOUT
protected static final long ASSET_PROCESSED_DELAY
public CQAssetsClient(org.apache.http.impl.client.CloseableHttpClient http,
org.apache.sling.testing.clients.SlingClientConfig config)
throws org.apache.sling.testing.clients.ClientException
org.apache.sling.testing.clients.ClientExceptionpublic boolean isDirectBinaryAccessSupported()
throws org.apache.sling.testing.clients.ClientException
org.apache.sling.testing.clients.ClientException - if something fails during the request/response cyclepublic org.apache.sling.testing.clients.SlingHttpResponse uploadAsset(String fileName, String resourcePath, String mimeType, String parentPath, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
New File... in the DAM admin or when
uploading a file below Digital Assets in the Site Admin.dam:Asset. This will trigger all
DAM related workflows for generating rendition nodes, extract metadata etc.CQClient.uploadFileCQStyle(java.lang.String, java.lang.String, java.lang.String, java.lang.String, int...) instead.SlingClient.upload(java.io.File, String, String, boolean, int...).fileName - file nameresourcePath - defines the path to the resourcemimeType - MIME type of the image getting uploadedparentPath - parent page (folder) that will contain the fileexpectedStatus - list of expected HTTP Status to be returned, if not set, 200 is assumed.org.apache.sling.testing.clients.ClientException - if something fails during the request/response cyclepublic void waitAssetProcessed(String assetPath) throws org.apache.sling.testing.clients.ClientException, TimeoutException, InterruptedException
assetPath - Path to an assetorg.apache.sling.testing.clients.ClientException - if something fails during the request/response cycle, or if the asset failed to processTimeoutException - if the wait times outInterruptedException - if the wait is interruptedpublic void waitAssetProcessed(String assetPath, long timeout, long delay) throws org.apache.sling.testing.clients.ClientException, TimeoutException, InterruptedException
assetPath - Path to an assettimeout - total time to wait, in millisecondsdelay - time to wait between polls of asset status, in millisecondsorg.apache.sling.testing.clients.ClientException - if something fails during the request/response cycle, or if the asset failed to processTimeoutException - if the wait times outInterruptedException - if the wait is interruptedpublic String getAssetStatus(String assetPath) throws org.apache.sling.testing.clients.ClientException
assetPath - Asset pathorg.apache.sling.testing.clients.ClientException - if something fails during the request/response cyclepublic String getAssetProcessingFailures(String assetPath) throws org.apache.sling.testing.clients.ClientException
assetPath - Asset pathorg.apache.sling.testing.clients.ClientException - if something fails during the request/response cycleCopyright © 2021. All rights reserved.