@Override public DocumentTranslationMap write(ExportedDocument xdoc) throws IOException { if (xdoc.getDocument() == null) { // not a valid doc -> this may be a regular folder for example the // root of the tree return null; } DocumentModel doc = null; String id = xdoc.getId(); try { doc = session.getDocument(new IdRef(id)); } catch (DocumentNotFoundException e) { log.error("Cannot update document. No such document: " + id); return null; } doc = updateDocument(xdoc, doc); DocumentLocation source = xdoc.getSourceLocation(); DocumentTranslationMap map = new DocumentTranslationMapImpl(source.getServerName(), doc.getRepositoryName()); map.put(source.getDocRef(), doc.getRef()); return map; }