org.exoplatform.services.jcr.ext.resource.representation
Class NtResourceNodeRepresentation

java.lang.Object
  extended by org.exoplatform.services.jcr.ext.resource.representation.NtResourceNodeRepresentation
All Implemented Interfaces:
NodeRepresentation

public class NtResourceNodeRepresentation
extends java.lang.Object
implements NodeRepresentation

Version:
$Id: NtResourceNodeRepresentation.java 35186 2009-08-07 14:23:43Z pnedonosko $
Author:
Andrey Parfonov

Field Summary
protected  javax.jcr.Node node
           
protected  java.util.ArrayList<org.exoplatform.common.util.HierarchicalProperty> properties
           
 
Constructor Summary
NtResourceNodeRepresentation(javax.jcr.Node node)
           
 
Method Summary
 void addProperties(java.util.Collection<org.exoplatform.common.util.HierarchicalProperty> properties)
          adds multivalued property.
 void addProperty(org.exoplatform.common.util.HierarchicalProperty property)
          adds single property.
 java.lang.String getContentEncoding()
           
 long getContentLenght()
           
 java.io.InputStream getInputStream()
           
 long getLastModified()
          Get date of last modified if available.
 java.lang.String getMediaType()
           
 javax.jcr.Node getNode()
           
 java.util.Collection<org.exoplatform.common.util.HierarchicalProperty> getProperties(java.lang.String name)
           
 org.exoplatform.common.util.HierarchicalProperty getProperty(java.lang.String name)
           
 java.util.Collection<java.lang.String> getPropertyNames()
           
 void removeProperty(java.lang.String name)
          removes property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

node

protected javax.jcr.Node node

properties

protected java.util.ArrayList<org.exoplatform.common.util.HierarchicalProperty> properties
Constructor Detail

NtResourceNodeRepresentation

public NtResourceNodeRepresentation(javax.jcr.Node node)
                             throws javax.jcr.RepositoryException
Parameters:
node -
Throws:
javax.jcr.RepositoryException
Method Detail

getContentEncoding

public java.lang.String getContentEncoding()
Specified by:
getContentEncoding in interface NodeRepresentation
Returns:
the content encoding or null if it unknown.

getContentLenght

public long getContentLenght()
                      throws javax.jcr.RepositoryException
Specified by:
getContentLenght in interface NodeRepresentation
Returns:
the content length or -1 if content length unknown
Throws:
javax.jcr.RepositoryException

getMediaType

public java.lang.String getMediaType()
                              throws javax.jcr.RepositoryException
Specified by:
getMediaType in interface NodeRepresentation
Returns:
Mimetype for this representation.
Throws:
javax.jcr.RepositoryException

getLastModified

public long getLastModified()
                     throws javax.jcr.RepositoryException
Description copied from interface: NodeRepresentation
Get date of last modified if available.

Specified by:
getLastModified in interface NodeRepresentation
Returns:
the date of last modified.
Throws:
javax.jcr.RepositoryException

getNode

public javax.jcr.Node getNode()
Specified by:
getNode in interface NodeRepresentation
Returns:
the underlying node.

getProperty

public org.exoplatform.common.util.HierarchicalProperty getProperty(java.lang.String name)
                                                             throws javax.jcr.RepositoryException
Specified by:
getProperty in interface NodeRepresentation
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 java.util.Collection<org.exoplatform.common.util.HierarchicalProperty> getProperties(java.lang.String name)
                                                                                     throws javax.jcr.RepositoryException
Specified by:
getProperties in interface NodeRepresentation
Parameters:
name - the name of properties.
Returns:
the properties with specified name.
Throws:
javax.jcr.RepositoryException

getPropertyNames

public java.util.Collection<java.lang.String> getPropertyNames()
                                                        throws javax.jcr.RepositoryException
Specified by:
getPropertyNames in interface NodeRepresentation
Returns:
the collection of node properties name.
Throws:
javax.jcr.RepositoryException

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException,
                                          javax.jcr.RepositoryException
Specified by:
getInputStream in interface NodeRepresentation
Returns:
the stream.
Throws:
java.io.IOException
javax.jcr.RepositoryException

addProperties

public void addProperties(java.util.Collection<org.exoplatform.common.util.HierarchicalProperty> properties)
                   throws javax.jcr.UnsupportedRepositoryOperationException
Description copied from interface: NodeRepresentation
adds multivalued property.

Specified by:
addProperties in interface NodeRepresentation
Parameters:
properties - .
Throws:
javax.jcr.UnsupportedRepositoryOperationException

addProperty

public void addProperty(org.exoplatform.common.util.HierarchicalProperty property)
                 throws javax.jcr.UnsupportedRepositoryOperationException
Description copied from interface: NodeRepresentation
adds single property.

Specified by:
addProperty in interface NodeRepresentation
Parameters:
property - .
Throws:
javax.jcr.UnsupportedRepositoryOperationException

removeProperty

public void removeProperty(java.lang.String name)
                    throws javax.jcr.UnsupportedRepositoryOperationException
Description copied from interface: NodeRepresentation
removes property.

Specified by:
removeProperty in interface NodeRepresentation
Parameters:
name - .
Throws:
javax.jcr.UnsupportedRepositoryOperationException


Copyright © 2011 eXo Platform SAS. All Rights Reserved.