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
ModifiableResourcerename in interface ModifiableResourcenewName - the new nameAmetysRepositoryException - if an error occurs.public String getEncoding() throws AmetysRepositoryException
ResourcegetEncoding in interface Resourcenull if not available.AmetysRepositoryException - if an error occurs.public InputStream getInputStream() throws AmetysRepositoryException
ResourcegetInputStream in interface ResourceAmetysRepositoryException - if an error occurs.public Date getLastModified() throws AmetysRepositoryException
ResourcegetLastModified in interface ResourceAmetysRepositoryException - if an error occurs.public long getLength() throws AmetysRepositoryException
ResourcegetLength in interface ResourceAmetysRepositoryException - if an error occurs.public String getMimeType() throws AmetysRepositoryException
ResourcegetMimeType in interface ResourceAmetysRepositoryException - if an error occurs.public void setEncoding(String encoding) throws AmetysRepositoryException
ModifiableResourcesetEncoding in interface ModifiableResourceencoding - the encoding of the data stream.AmetysRepositoryException - if an error occurs.public void setInputStream(InputStream stream) throws AmetysRepositoryException
ModifiableResourcesetInputStream in interface ModifiableResourcestream - the data stream.AmetysRepositoryException - if an error occurs.public void setLastModified(Date lastModifiedDate) throws AmetysRepositoryException
ModifiableResourcesetLastModified in interface ModifiableResourcelastModifiedDate - the last modification date.AmetysRepositoryException - if an error occurs.public void setMimeType(String mimeType) throws AmetysRepositoryException
ModifiableResourcesetMimeType in interface ModifiableResourcemimeType - the mime type of the data.AmetysRepositoryException - if an error occurs.public OutputStream getOutputStream() throws AmetysRepositoryException
ModifiableResourcegetOutputStream in interface ModifiableResourceAmetysRepositoryException - if an error occurs.private void _checkLock() throws RepositoryException
RepositoryException