|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.sling.commons.testing.integration.SlingIntegrationTestClient
public class SlingIntegrationTestClient
Client functions to interact with Sling in integration tests
Constructor Summary | |
---|---|
SlingIntegrationTestClient(org.apache.commons.httpclient.HttpClient client)
|
Method Summary | |
---|---|
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 |
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 |
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SlingIntegrationTestClient(org.apache.commons.httpclient.HttpClient client)
Method Detail |
---|
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 POST
IOException
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 POST
IOException
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 field
IOException
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |