@Override public void initializeFrom(String memento) throws CoreException { Exception ex = null; try { Element root = null; DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); parser.setErrorHandler(new DefaultHandler()); StringReader reader = new StringReader(memento); InputSource source = new InputSource(reader); root = parser.parse(source).getDocumentElement(); String path = root.getAttribute("archivePath"); //$NON-NLS-1$ if (isEmpty(path)) { abort(LaunchingMessages.ArchiveSourceLocation_Unable_to_initialize_source_location___missing_archive_path__3, null); } String rootPath = root.getAttribute("rootPath"); //$NON-NLS-1$ setName(path); setRootPath(rootPath); return; } catch (ParserConfigurationException e) { ex = e; } catch (SAXException e) { ex = e; } catch (IOException e) { ex = e; } abort(LaunchingMessages.ArchiveSourceLocation_Exception_occurred_initializing_source_location__5, ex); }
@Override public void initializeFrom(String memento) throws CoreException { Exception ex = null; try { Element root = null; DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); parser.setErrorHandler(new DefaultHandler()); StringReader reader = new StringReader(memento); InputSource source = new InputSource(reader); root = parser.parse(source).getDocumentElement(); String path = root.getAttribute("archivePath"); //$NON-NLS-1$ if (isEmpty(path)) { abort(LaunchingMessages.ArchiveSourceLocation_Unable_to_initialize_source_location___missing_archive_path__3, null); } String rootPath = root.getAttribute("rootPath"); //$NON-NLS-1$ setName(path); setRootPath(rootPath); return; } catch (ParserConfigurationException e) { ex = e; } catch (SAXException e) { ex = e; } catch (IOException e) { ex = e; } abort(LaunchingMessages.ArchiveSourceLocation_Exception_occurred_initializing_source_location__5, ex); }