|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractMap<K,V> java.util.HashMap<String,Object> org.apache.sling.api.resource.ResourceMetadata
public class ResourceMetadata
The ResourceMetadata
interface defines the API for the
metadata of a Sling Resource
. Essentially the resource's metadata is
just a map of objects indexed by string keys.
The actual contents of the meta data map is implementation specific with the
exception of the sling.resolutionPath
property which
must be provided by all implementations and contain the part of the request
URI used to resolve the resource. The type of this property value is defined
to be String
.
Note, that the prefix sling. to key names is reserved for the Sling implementation.
Field Summary | |
---|---|
static String |
CHARACTER_ENCODING
The name of the optional property providing the character encoding of the resource if the resource is streamable and contains character data (value is "sling.characterEncoding"). |
static String |
CONTENT_LENGTH
The name of the optional property providing the content length of the resource if the resource is streamable (value is "sling.contentLength"). |
static String |
CONTENT_TYPE
The name of the optional property providing the content type of the resource if the resource is streamable (value is "sling.contentType"). |
static String |
CREATION_TIME
Returns the creation time of this resource in the repository in milliseconds (value is "sling.creationTime"). |
static String |
MODIFICATION_TIME
Returns the last modification time of this resource in the repository in milliseconds (value is "sling.modificationTime"). |
static String |
RESOLUTION_PATH
The name of the required property providing the part of the request URI which was used to the resolve the resource to which the meta data instance belongs (value is "sling.resolutionPath"). |
static String |
RESOLUTION_PATH_INFO
The name of the required property providing the part of the request URI which was not used to the resolve the resource to which the meta data instance belongs (value is "sling.resolutionPathInfo"). |
Constructor Summary | |
---|---|
ResourceMetadata()
|
Method Summary | |
---|---|
String |
getCharacterEncoding()
Returns the CHARACTER_ENCODING property if not null
and a String instance. |
long |
getContentLength()
Returns the CONTENT_LENGTH property if not null
and a long . |
String |
getContentType()
Returns the CONTENT_TYPE property if not null and
a String instance. |
long |
getCreationTime()
Returns the CREATION_TIME property if not null
and a long . |
long |
getModificationTime()
Returns the MODIFICATION_TIME property if not null
and a long . |
String |
getResolutionPath()
Returns the RESOLUTION_PATH property if not null
and a String instance. |
String |
getResolutionPathInfo()
Returns the RESOLUTION_PATH_INFO property if not
null and a String instance. |
void |
setCharacterEncoding(String encoding)
Sets the CHARACTER_ENCODING property to encoding
if not null . |
void |
setContentLength(long contentLength)
Sets the CONTENT_LENGTH property to contentType
if not null . |
void |
setContentType(String contentType)
Sets the CONTENT_TYPE property to contentType if
not null . |
void |
setCreationTime(long creationTime)
Sets the CREATION_TIME property to creationTime
if not negative. |
void |
setModificationTime(long modificationTime)
Sets the MODIFICATION_TIME property to
modificationTime if not negative. |
void |
setResolutionPath(String resolutionPath)
Sets the RESOLUTION_PATH property to resolutionPath
if not null . |
void |
setResolutionPathInfo(String resolutionPathInfo)
Sets the RESOLUTION_PATH_INFO property to
resolutionPathInfo if not null . |
Methods inherited from class java.util.HashMap |
---|
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
Methods inherited from class java.util.AbstractMap |
---|
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Field Detail |
---|
public static final String RESOLUTION_PATH
public static final String RESOLUTION_PATH_INFO
sling.resolutionPath
property returns the
original request URI leading to the resource.
This property is optional. If missing, it should be assumed equal to an empty string.
public static final String CONTENT_TYPE
public static final String CONTENT_LENGTH
Note, that unlike the other properties, this property may be set only
after the resource has successfully been adapted to an
InputStream
for performance reasons.
public static final String CHARACTER_ENCODING
public static final String CREATION_TIME
java.lang.Long
. The property may be missing if the
resource is not streamable or if the creation time is not known.
public static final String MODIFICATION_TIME
java.lang.Long
. The property may be missing
if the resource is not streamable or if the last modification time is not
known.
Constructor Detail |
---|
public ResourceMetadata()
Method Detail |
---|
public void setCharacterEncoding(String encoding)
CHARACTER_ENCODING
property to encoding
if not null
.
public String getCharacterEncoding()
CHARACTER_ENCODING
property if not null
and a String
instance. Otherwise null
is
returned.
public void setContentType(String contentType)
CONTENT_TYPE
property to contentType
if
not null
.
public String getContentType()
CONTENT_TYPE
property if not null
and
a String
instance. Otherwise null
is
returned.
public void setContentLength(long contentLength)
CONTENT_LENGTH
property to contentType
if not null
.
public long getContentLength()
CONTENT_LENGTH
property if not null
and a long
. Otherwise -1
is returned.
public void setCreationTime(long creationTime)
CREATION_TIME
property to creationTime
if not negative.
public long getCreationTime()
CREATION_TIME
property if not null
and a long
. Otherwise -1
is returned.
public void setModificationTime(long modificationTime)
MODIFICATION_TIME
property to
modificationTime
if not negative.
public long getModificationTime()
MODIFICATION_TIME
property if not null
and a long
. Otherwise -1
is returned.
public void setResolutionPath(String resolutionPath)
RESOLUTION_PATH
property to resolutionPath
if not null
.
public String getResolutionPath()
RESOLUTION_PATH
property if not null
and a String
instance. Otherwise null
is
returned.
public void setResolutionPathInfo(String resolutionPathInfo)
RESOLUTION_PATH_INFO
property to
resolutionPathInfo
if not null
.
public String getResolutionPathInfo()
RESOLUTION_PATH_INFO
property if not
null
and a String
instance. Otherwise
null
is returned.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |