org.apache.jackrabbit.server.io
Class FileExportCommand

java.lang.Object
  extended byorg.apache.jackrabbit.server.io.AbstractCommand
      extended byorg.apache.jackrabbit.server.io.AbstractExportCommand
          extended byorg.apache.jackrabbit.server.io.FileExportCommand
All Implemented Interfaces:
org.apache.commons.chain.Command, org.apache.jackrabbit.JcrConstants

public class FileExportCommand
extends AbstractExportCommand

This Class implements a export command that returns the data included in the jcr:data property of a nt:resource node.


Field Summary
 
Fields inherited from interface org.apache.jackrabbit.JcrConstants
JCR_AUTOCREATED, JCR_BASEVERSION, JCR_CHILD, JCR_CHILDNODEDEFINITION, JCR_CONTENT, JCR_CREATED, JCR_DATA, JCR_DEFAULTPRIMARYTYPE, JCR_DEFAULTVALUES, JCR_ENCODING, JCR_FROZENMIXINTYPES, JCR_FROZENNODE, JCR_FROZENPRIMARYTYPE, JCR_FROZENUUID, JCR_HASORDERABLECHILDNODES, JCR_ISCHECKEDOUT, JCR_ISMIXIN, JCR_LANGUAGE, JCR_LASTMODIFIED, JCR_LOCKISDEEP, JCR_LOCKOWNER, JCR_MANDATORY, JCR_MERGEFAILED, JCR_MIMETYPE, JCR_MIXINTYPES, JCR_MULTIPLE, JCR_NAME, JCR_NODETYPENAME, JCR_ONPARENTVERSION, JCR_PATH, JCR_PREDECESSORS, JCR_PRIMARYITEMNAME, JCR_PRIMARYTYPE, JCR_PROPERTYDEFINITION, JCR_PROTECTED, JCR_REQUIREDPRIMARYTYPES, JCR_REQUIREDTYPE, JCR_ROOTVERSION, JCR_SAMENAMESIBLINGS, JCR_SCORE, JCR_STATEMENT, JCR_SUCCESSORS, JCR_SUPERTYPES, JCR_SYSTEM, JCR_UUID, JCR_VALUECONSTRAINTS, JCR_VERSIONABLEUUID, JCR_VERSIONHISTORY, JCR_VERSIONLABELS, JCR_VERSIONSTORAGE, MIX_LOCKABLE, MIX_REFERENCEABLE, MIX_VERSIONABLE, NT_BASE, NT_CHILDNODEDEFINITION, NT_FILE, NT_FOLDER, NT_FROZENNODE, NT_HIERARCHYNODE, NT_LINKEDFILE, NT_NODETYPE, NT_PROPERTYDEFINITION, NT_QUERY, NT_RESOURCE, NT_UNSTRUCTURED, NT_VERSION, NT_VERSIONEDCHILD, NT_VERSIONHISTORY, NT_VERSIONLABELS
 
Constructor Summary
FileExportCommand()
           
 
Method Summary
 boolean canHandle(Node node)
          Checks if the given node can be handled by this export command.
 boolean exportNode(ExportContext context, Node content)
          Exports the node by returning the content of the jcr:data property of the content node.
 String getDefaultContentType()
          Returns the default content type
 
Methods inherited from class org.apache.jackrabbit.server.io.AbstractExportCommand
execute, execute
 
Methods inherited from class org.apache.jackrabbit.server.io.AbstractCommand
execute, getId, setEnabled, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileExportCommand

public FileExportCommand()
Method Detail

exportNode

public boolean exportNode(ExportContext context,
                          Node content)
                   throws Exception
Exports the node by returning the content of the jcr:data property of the content node.

Specified by:
exportNode in class AbstractExportCommand
Parameters:
context - the export context
content - the content node
Returns:
true
Throws:
Exception - if an error occurrs

getDefaultContentType

public String getDefaultContentType()
Returns the default content type

Specified by:
getDefaultContentType in class AbstractExportCommand
Returns:
"application/octet-stream".

canHandle

public boolean canHandle(Node node)
Checks if the given node can be handled by this export command. This is the case, if the node contains a 'jcr:content' node which is of node type 'nt:resource'.

Specified by:
canHandle in class AbstractExportCommand
Parameters:
node - the node to be exported
Returns:
true if the correct node is passed; false otherwise.


Copyright © 2005 . All Rights Reserved.