Class NtFileNodeRepresentation
- java.lang.Object
-
- org.exoplatform.services.jcr.ext.resource.representation.NtFileNodeRepresentation
-
- All Implemented Interfaces:
NodeRepresentation
public class NtFileNodeRepresentation extends Object implements NodeRepresentation
- Version:
- $Id: $
- Author:
- Andrey Parfonov
-
-
Constructor Summary
Constructors Constructor Description NtFileNodeRepresentation(javax.jcr.Node node, NodeRepresentation content)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddProperties(Collection<org.exoplatform.common.util.HierarchicalProperty> properties)adds multivalued property.voidaddProperty(org.exoplatform.common.util.HierarchicalProperty property)adds single property.StringgetContentEncoding()longgetContentLenght()InputStreamgetInputStream()longgetLastModified()Get date of last modified if available.StringgetMediaType()javax.jcr.NodegetNode()Collection<org.exoplatform.common.util.HierarchicalProperty>getProperties(String name)org.exoplatform.common.util.HierarchicalPropertygetProperty(String name)Collection<String>getPropertyNames()voidremoveProperty(String name)removes property.
-
-
-
Constructor Detail
-
NtFileNodeRepresentation
public NtFileNodeRepresentation(javax.jcr.Node node, NodeRepresentation content) throws javax.jcr.RepositoryException- Parameters:
node-content-- Throws:
javax.jcr.RepositoryException
-
-
Method Detail
-
getContentEncoding
public String getContentEncoding()
- Specified by:
getContentEncodingin interfaceNodeRepresentation- Returns:
- the content encoding or null if it unknown.
-
getContentLenght
public long getContentLenght() throws javax.jcr.RepositoryException- Specified by:
getContentLenghtin interfaceNodeRepresentation- Returns:
- the content length or -1 if content length unknown
- Throws:
javax.jcr.RepositoryException
-
getMediaType
public String getMediaType() throws javax.jcr.RepositoryException
- Specified by:
getMediaTypein interfaceNodeRepresentation- Returns:
- Mimetype for this representation.
- Throws:
javax.jcr.RepositoryException
-
getLastModified
public long getLastModified() throws javax.jcr.RepositoryExceptionDescription copied from interface:NodeRepresentationGet date of last modified if available.- Specified by:
getLastModifiedin interfaceNodeRepresentation- Returns:
- the date of last modified.
- Throws:
javax.jcr.RepositoryException
-
getNode
public javax.jcr.Node getNode()
- Specified by:
getNodein interfaceNodeRepresentation- Returns:
- the underlying node.
-
getProperty
public org.exoplatform.common.util.HierarchicalProperty getProperty(String name) throws javax.jcr.RepositoryException
- Specified by:
getPropertyin interfaceNodeRepresentation- Parameters:
name- the name of properties.- Returns:
- the property with specified name. Note that there can be multiple same name properties, in this case any one will be returned.
- Throws:
javax.jcr.RepositoryException
-
getProperties
public Collection<org.exoplatform.common.util.HierarchicalProperty> getProperties(String name) throws javax.jcr.RepositoryException
- Specified by:
getPropertiesin interfaceNodeRepresentation- Parameters:
name- the name of properties.- Returns:
- the properties with specified name.
- Throws:
javax.jcr.RepositoryException
-
getPropertyNames
public Collection<String> getPropertyNames() throws javax.jcr.RepositoryException
- Specified by:
getPropertyNamesin interfaceNodeRepresentation- Returns:
- the collection of node properties name.
- Throws:
javax.jcr.RepositoryException
-
getInputStream
public InputStream getInputStream() throws IOException, javax.jcr.RepositoryException
- Specified by:
getInputStreamin interfaceNodeRepresentation- Returns:
- the stream.
- Throws:
IOExceptionjavax.jcr.RepositoryException
-
addProperties
public void addProperties(Collection<org.exoplatform.common.util.HierarchicalProperty> properties) throws javax.jcr.UnsupportedRepositoryOperationException
Description copied from interface:NodeRepresentationadds multivalued property.- Specified by:
addPropertiesin interfaceNodeRepresentation- Parameters:
properties- .- Throws:
javax.jcr.UnsupportedRepositoryOperationException
-
addProperty
public void addProperty(org.exoplatform.common.util.HierarchicalProperty property) throws javax.jcr.UnsupportedRepositoryOperationExceptionadds single property.- Specified by:
addPropertyin interfaceNodeRepresentation- Parameters:
property- .- Throws:
javax.jcr.UnsupportedRepositoryOperationException
-
removeProperty
public void removeProperty(String name) throws javax.jcr.UnsupportedRepositoryOperationException
removes property.- Specified by:
removePropertyin interfaceNodeRepresentation- Parameters:
name- .- Throws:
javax.jcr.UnsupportedRepositoryOperationException
-
-