|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.sling.testing.tools.sling.SlingClient
public class SlingClient
Simple Sling client, created for integration tests but should be general purpose
| Field Summary | |
|---|---|
static String |
HTTP_PREFIX
|
static String |
LOCATION_HEADER
|
| Constructor Summary | |
|---|---|
SlingClient(String slingServerUrl,
String username,
String password)
|
|
| Method Summary | |
|---|---|
String |
createNode(String path,
Map<String,Object> properties)
Create a node at specified path, with optional properties |
String |
createNode(String path,
String... properties)
Create a node at specified path, with optional properties specified as a list of String arguments, odd values are keys and even arguments are values. |
void |
delete(String path)
Delete supplied path |
boolean |
exists(String path)
|
protected String |
getParentPath(String path)
Return parent path: whatever comes before the last / in path, empty string if no / in path. |
void |
mkdir(String path)
Create path using MKCOL |
void |
mkdirs(String path)
Create path and all its parent folders, using MKCOL |
void |
upload(String path,
InputStream data,
int length,
boolean createFolders)
Upload using a PUT request. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String LOCATION_HEADER
public static final String HTTP_PREFIX
| Constructor Detail |
|---|
public SlingClient(String slingServerUrl,
String username,
String password)
| Method Detail |
|---|
public String createNode(String path,
String... properties)
throws IOException
IOException
public String createNode(String path,
Map<String,Object> properties)
throws UnsupportedEncodingException,
IOException
path - Used in POST request to Sling serverproperties - If not null, properties are added to the created node
UnsupportedEncodingException
IOException
public void delete(String path)
throws IOException
IOException
public void upload(String path,
InputStream data,
int length,
boolean createFolders)
throws IOException
path - the path of the uploaded filedata - the contentlength - Use -1 if unknowncreateFolders - if true, intermediate folders are created via mkdirs
IOException
public void mkdirs(String path)
throws IOException
IOException
public void mkdir(String path)
throws IOException
IOException
public boolean exists(String path)
throws IOException
IOExceptionprotected String getParentPath(String path)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||