Пример #1
0
 private void saveLog(final IGeoLog log, final File logFile) {
   try {
     final IStatusCollection statusCollection = log.getStatusCollection();
     final GMLWorkspace workspace = statusCollection.getWorkspace();
     GmlSerializer.serializeWorkspace(logFile, workspace, Charsets.UTF_8.name());
   } catch (IOException | GmlSerializeException e) {
     e.printStackTrace();
   }
 }
 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();
   }
 }
Пример #3
0
 void saveModel(final String path, final Feature model) throws IOException, GmlSerializeException {
   /* REMARK: We assume that all files are 'UTF-8'. */
   GmlSerializer.serializeWorkspace(
       new File(m_baseDir, path), model.getWorkspace(), "UTF-8"); // $NON-NLS-1$
 }
Пример #4
0
 <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();
 }