org.apache.jackrabbit.rmi.xml
Class WorkspaceImportContentHandler

java.lang.Object
  extended by org.apache.jackrabbit.rmi.xml.ImportContentHandler
      extended by org.apache.jackrabbit.rmi.xml.WorkspaceImportContentHandler
All Implemented Interfaces:
ContentHandler

public class WorkspaceImportContentHandler
extends ImportContentHandler

SAX content handler for importing XML data to a JCR Workspace. This utility class can be used to implement the Workspace.getImportContentHandler(String, int) method in terms of the Workspace.importXML(String, InputStream, int) method.

Author:
Jukka Zitting

Constructor Summary
WorkspaceImportContentHandler(Workspace workspace, String path, int uuidBehaviour)
          Creates a SAX content handler for importing XML data to the given workspace and path using the given UUID behaviour.
 
Method Summary
protected  void importXML(byte[] xml)
          Imports the serialized XML stream using the standard Workspace.importXML(String, InputStream, int) method.
 
Methods inherited from class org.apache.jackrabbit.rmi.xml.ImportContentHandler
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkspaceImportContentHandler

public WorkspaceImportContentHandler(Workspace workspace,
                                     String path,
                                     int uuidBehaviour)
Creates a SAX content handler for importing XML data to the given workspace and path using the given UUID behaviour.

Parameters:
workspace - repository workspace
path - import content path
uuidBehaviour - UUID behaviour
Method Detail

importXML

protected void importXML(byte[] xml)
                  throws Exception
Imports the serialized XML stream using the standard Workspace.importXML(String, InputStream, int) method. Imports the given XML data. This method is called by the endDocument() method after the received XML stream has been serialized.

Subclasses must implement this method to provide the actual import mechanism.

Specified by:
importXML in class ImportContentHandler
Parameters:
xml - the XML data to import
Throws:
Exception - on import errors


Copyright © 2004-2007 The Apache Software Foundation. All Rights Reserved.