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
IOException
public int delete(String url) throws IOException
IOException
public void mkdir(String url) throws IOException
IOException
public void mkdirs(String baseUrl, String path) throws IOException
IOException
public String createNode(String url, Map<String,String> nodeProperties) throws IOException
IOException
public 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 POSTIOException
public 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 POSTIOException
public 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 fieldIOException
public void uploadToFileNode(String url, File localFile, String fieldName, String typeHint) throws IOException
IOException
public void uploadToFileNodes(String url, File[] localFiles, String[] fieldNames, String[] typeHints) throws IOException
IOException
public int post(String url, Map<String,String> properties) throws org.apache.commons.httpclient.HttpException, IOException
org.apache.commons.httpclient.HttpException
IOException
public int get(String url) throws org.apache.commons.httpclient.HttpException, IOException
org.apache.commons.httpclient.HttpException
IOException
Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.