private void logMessage(final CoreException ex) { try { final GMLWorkspace workspace = GmlSerializer.createGMLWorkspace(m_rcmUrl, null); final IRainfallCatchmentModel rcmModel = (IRainfallCatchmentModel) workspace.getRootFeature(); final String logPath = rcmModel.getLogPath(); final URL context = workspace.getContext(); final URL url = new URL(context, logPath); final IFile member = ResourceUtilities.findFileFromURL(url); if (member != null) { final GeoStatusLog log = new GeoStatusLog(member.getLocation().toFile()); log.log(ex.getStatus()); log.serialize(); } } catch (final Exception e) { e.printStackTrace(); } }
<F extends Feature> F loadModel(final String path) throws Exception { final File file = new File(m_baseDir, path); final GMLWorkspace workspace = GmlSerializer.createGMLWorkspace(file, null); return (F) workspace.getRootFeature(); }