Ejemplo n.º 1
0
  /**
   * Exoirts as a mas project
   *
   * @param xmlFile
   */
  private void exportAsMASProject(File xmlFile) {
    try {
      String saveDirectory = xmlFile.getAbsolutePath();

      String extension = ".xml";
      if (!saveDirectory.endsWith(extension)) {
        saveDirectory += extension;
      }

      saveConfigAsXMLFile(saveDirectory);
      BW4TClientConfig configuration = BW4TClientConfig.fromXML(saveDirectory);

      /* Split the name into two around the ., and pass the name without the extension */
      ExportToMAS.export(xmlFile.getParent(), configuration, xmlFile.getName().split("\\.")[0]);
    } catch (JAXBException ex) {
      ScenarioEditor.handleException(ex, "Error: Saving to XML has failed.");
    } catch (FileNotFoundException ex) {
      ScenarioEditor.handleException(ex, "Error: No file has been found.");
    }
  }