protected void deserialize(Node importRoot, XmlSaveType saveType, boolean isImportedByStream, int uuidBehavior,
InputStream is) throws RepositoryException, SAXException, IOException
{
ExtendedSession extendedSession = (ExtendedSession)importRoot.getSession();
ExtendedWorkspace extendedWorkspace = (ExtendedWorkspace)extendedSession.getWorkspace();
if (isImportedByStream)
{
if (saveType == XmlSaveType.SESSION)
{
extendedSession.importXML(importRoot.getPath(), is, uuidBehavior);
}
else if (saveType == XmlSaveType.WORKSPACE)
{
extendedWorkspace.importXML(importRoot.getPath(), is, uuidBehavior);
}
}
else
{
XMLReader reader = XMLReaderFactory.createXMLReader();
if (saveType == XmlSaveType.SESSION)
{
reader.setContentHandler(extendedSession.getImportContentHandler(importRoot.getPath(), uuidBehavior));
}
else if (saveType == XmlSaveType.WORKSPACE)
{
reader.setContentHandler(extendedWorkspace.getImportContentHandler(importRoot.getPath(), uuidBehavior));
}
InputSource inputSource = new InputSource(is);
reader.parse(inputSource);