public class JCRResource extends Object implements ModifiableResource
Modifier and Type | Field and Description |
---|---|
private boolean |
_lockAlreadyChecked |
private Node |
_node |
Constructor and Description |
---|
JCRResource(Node node)
Constructor
|
Modifier and Type | Method and Description |
---|---|
private void |
_checkLock() |
String |
getEncoding()
Returns the encoding if the data stream, if it is a character stream.
|
InputStream |
getInputStream()
Returns the data stream.
|
Date |
getLastModified()
Returns the last modification date.
|
long |
getLength()
Returns the length of the data stream.
|
String |
getMimeType()
Returns the data mime-type.
|
Node |
getNode()
Retrieves the underlying node.
|
OutputStream |
getOutputStream()
Returns an OuputStream to write the data stream.
|
void |
rename(String newName)
Rename the current metadata
|
void |
setEncoding(String encoding)
Set the encoding if the data stream, if it is a character stream.
|
void |
setInputStream(InputStream stream)
Set the data stream.
|
void |
setLastModified(Date lastModifiedDate)
Set the last modification date.
|
void |
setMimeType(String mimeType)
Set the mime type.
|
private boolean _lockAlreadyChecked
public JCRResource(Node node)
node
- the nt:resource Nodepublic void rename(String newName) throws AmetysRepositoryException
ModifiableResource
rename
in interface ModifiableResource
newName
- the new nameAmetysRepositoryException
- if an error occurs.public String getEncoding() throws AmetysRepositoryException
Resource
getEncoding
in interface Resource
null
if not available.AmetysRepositoryException
- if an error occurs.public InputStream getInputStream() throws AmetysRepositoryException
Resource
getInputStream
in interface Resource
AmetysRepositoryException
- if an error occurs.public Date getLastModified() throws AmetysRepositoryException
Resource
getLastModified
in interface Resource
AmetysRepositoryException
- if an error occurs.public long getLength() throws AmetysRepositoryException
Resource
getLength
in interface Resource
AmetysRepositoryException
- if an error occurs.public String getMimeType() throws AmetysRepositoryException
Resource
getMimeType
in interface Resource
AmetysRepositoryException
- if an error occurs.public void setEncoding(String encoding) throws AmetysRepositoryException
ModifiableResource
setEncoding
in interface ModifiableResource
encoding
- the encoding of the data stream.AmetysRepositoryException
- if an error occurs.public void setInputStream(InputStream stream) throws AmetysRepositoryException
ModifiableResource
setInputStream
in interface ModifiableResource
stream
- the data stream.AmetysRepositoryException
- if an error occurs.public void setLastModified(Date lastModifiedDate) throws AmetysRepositoryException
ModifiableResource
setLastModified
in interface ModifiableResource
lastModifiedDate
- the last modification date.AmetysRepositoryException
- if an error occurs.public void setMimeType(String mimeType) throws AmetysRepositoryException
ModifiableResource
setMimeType
in interface ModifiableResource
mimeType
- the mime type of the data.AmetysRepositoryException
- if an error occurs.public OutputStream getOutputStream() throws AmetysRepositoryException
ModifiableResource
getOutputStream
in interface ModifiableResource
AmetysRepositoryException
- if an error occurs.private void _checkLock() throws RepositoryException
RepositoryException