public class SlingIntegrationTestClient extends Object
| Constructor and Description |
|---|
SlingIntegrationTestClient(org.apache.commons.httpclient.HttpClient client) |
| Modifier and Type | Method and Description |
|---|---|
String |
createNode(String url,
Map<String,String> nodeProperties)
Call the other createNode method with headers==null
|
String |
createNode(String url,
Map<String,String> clientNodeProperties,
Map<String,String> requestHeaders,
boolean multiPart)
Create a node under given path, using a POST to Sling
|
String |
createNode(String url,
NameValuePairList clientNodeProperties,
Map<String,String> requestHeaders,
boolean multiPart)
Create a node under given path, using a POST to Sling
|
String |
createNode(String url,
NameValuePairList clientNodeProperties,
Map<String,String> requestHeaders,
boolean multiPart,
File localFile,
String fieldName,
String typeHint)
Create a node under given path, using a POST to Sling
|
int |
delete(String url)
Delete a file from the Sling repository
|
int |
get(String url) |
String |
getFolderExistsTestExtension() |
void |
mkdir(String url)
Create the given directory via WebDAV, if needed, under given URL
|
void |
mkdirs(String baseUrl,
String path)
Create the given directory via WebDAV, including parent directories
|
int |
post(String url,
Map<String,String> properties) |
void |
setFolderExistsTestExtension(String folderExistsTestExtension) |
int |
upload(String toUrl,
InputStream is)
Upload a file to the Sling repository
|
void |
uploadToFileNode(String url,
File localFile,
String fieldName,
String typeHint)
Upload to an file node structure, see SLING-168
|
void |
uploadToFileNodes(String url,
File[] localFiles,
String[] fieldNames,
String[] typeHints)
Upload multiple files to file node structures
|
public SlingIntegrationTestClient(org.apache.commons.httpclient.HttpClient client)
public String getFolderExistsTestExtension()
public void setFolderExistsTestExtension(String folderExistsTestExtension)
public int upload(String toUrl, InputStream is) throws IOException
IOExceptionpublic int delete(String url) throws IOException
IOExceptionpublic void mkdir(String url) throws IOException
IOExceptionpublic void mkdirs(String baseUrl, String path) throws IOException
IOExceptionpublic String createNode(String url, Map<String,String> nodeProperties) throws IOException
IOExceptionpublic String createNode(String url, Map<String,String> clientNodeProperties, Map<String,String> requestHeaders, boolean multiPart) throws IOException
url - under which node is createdmultiPart - if true, does a multipart POSTIOExceptionpublic String createNode(String url, NameValuePairList clientNodeProperties, Map<String,String> requestHeaders, boolean multiPart) throws IOException
url - under which node is createdmultiPart - if true, does a multipart POSTIOExceptionpublic String createNode(String url, NameValuePairList clientNodeProperties, Map<String,String> requestHeaders, boolean multiPart, File localFile, String fieldName, String typeHint) throws IOException
url - under which node is createdmultiPart - if true, does a multipart POSTlocalFile - file to uploadfieldName - name of the file fieldtypeHint - typeHint of the file fieldIOExceptionpublic void uploadToFileNode(String url, File localFile, String fieldName, String typeHint) throws IOException
IOExceptionpublic void uploadToFileNodes(String url, File[] localFiles, String[] fieldNames, String[] typeHints) throws IOException
IOExceptionpublic int post(String url, Map<String,String> properties) throws org.apache.commons.httpclient.HttpException, IOException
org.apache.commons.httpclient.HttpExceptionIOExceptionpublic int get(String url) throws org.apache.commons.httpclient.HttpException, IOException
org.apache.commons.httpclient.HttpExceptionIOExceptionCopyright © 2007–2017 The Apache Software Foundation. All rights reserved.