|
||||||||||
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<java.lang.String,java.lang.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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.util.AbstractMap |
---|
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V> |
Field Summary | |
---|---|
static java.lang.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 java.lang.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 java.lang.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 java.lang.String |
CREATION_TIME
Returns the creation time of this resource in the repository in milliseconds (value is "sling.creationTime"). |
static java.lang.String |
MODIFICATION_TIME
Returns the last modification time of this resource in the repository in milliseconds (value is "sling.modificationTime"). |
static java.lang.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 java.lang.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 | |
---|---|
java.lang.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 . |
java.lang.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 . |
java.lang.String |
getResolutionPath()
Returns the RESOLUTION_PATH property if not null
and a String instance. |
java.lang.String |
getResolutionPathInfo()
Returns the RESOLUTION_PATH_INFO property if not
null and a String instance. |
void |
setCharacterEncoding(java.lang.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(java.lang.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(java.lang.String resolutionPath)
Sets the RESOLUTION_PATH property to resolutionPath
if not null . |
void |
setResolutionPathInfo(java.lang.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 java.lang.String RESOLUTION_PATH
public static final java.lang.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 java.lang.String CONTENT_TYPE
public static final java.lang.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 java.lang.String CHARACTER_ENCODING
public static final java.lang.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 java.lang.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(java.lang.String encoding)
CHARACTER_ENCODING
property to encoding
if not null
.
public java.lang.String getCharacterEncoding()
CHARACTER_ENCODING
property if not null
and a String
instance. Otherwise null
is
returned.
public void setContentType(java.lang.String contentType)
CONTENT_TYPE
property to contentType
if
not null
.
public java.lang.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(java.lang.String resolutionPath)
RESOLUTION_PATH
property to resolutionPath
if not null
.
public java.lang.String getResolutionPath()
RESOLUTION_PATH
property if not null
and a String
instance. Otherwise null
is
returned.
public void setResolutionPathInfo(java.lang.String resolutionPathInfo)
RESOLUTION_PATH_INFO
property to
resolutionPathInfo
if not null
.
public java.lang.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 |