public interface ResourceBuilder
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_PRIMARY_TYPE
Default primary type for resources created by this builder
|
| Modifier and Type | Method and Description |
|---|---|
ResourceBuilder |
atParent()
Reset the current parent Resource to the original one.
|
ResourceBuilder |
commit()
Commit created resources
|
ResourceBuilder |
file(String filename,
InputStream data)
Create a file under the current parent resource.
|
ResourceBuilder |
file(String filename,
InputStream data,
String mimeType,
long lastModified)
Create a file under the current parent resource
|
org.apache.sling.api.resource.Resource |
getCurrentParent()
Return the current parent resource
|
ResourceBuilder |
hierarchyMode()
Set hierarchy mode (as opposed to siblings mode) where creating a resource
sets it as the current parent.
|
ResourceBuilder |
resource(String path,
Map<String,Object> properties)
Create a Resource, which optionally becomes the current
parent Resource.
|
ResourceBuilder |
resource(String path,
Object... properties)
Create a Resource, which optionally becomes the current
parent Resource.
|
ResourceBuilder |
siblingsMode()
Set siblings mode (as opposed to hierarchy mode) where creating a resource
doesn't change the current parent.
|
ResourceBuilder |
withIntermediatePrimaryType(String primaryType)
Set the primary type for intermediate resources created
when the parent of resource being created does not exist.
|
static final String DEFAULT_PRIMARY_TYPE
ResourceBuilder resource(String path, Object... properties)
path - The path of the Resource to create.
If it's a relative path this builder's current resource is used as parent.
Otherwise the resource is created ad the given absoulte path.properties - optional name-value pairsResourceBuilder resource(String path, Map<String,Object> properties)
path - The path of the Resource to create.
If it's a relative path this builder's current resource is used as parent.
Otherwise the resource is created ad the given absoulte path.properties - Name-value pairsResourceBuilder file(String filename, InputStream data, String mimeType, long lastModified)
filename - The name of the created filedata - The file datamimeType - If null, use the Sling MimeTypeService to set the mime typelastModified - if < 0, current time is usedResourceBuilder file(String filename, InputStream data)
filename - The name of the created filedata - The file dataResourceBuilder commit()
ResourceBuilder withIntermediatePrimaryType(String primaryType)
primaryType - If null the DEFAULT_PRIMARY_TYPE is used.ResourceBuilder siblingsMode()
ResourceBuilder hierarchyMode()
org.apache.sling.api.resource.Resource getCurrentParent()
ResourceBuilder atParent()
Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.