mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Fixed XML Loading error, used VMG to calculate boat velocity
- XML read from stream instead of file - Started implementing VMG to calculate boat velocity dynamically Tags: #pair[wmu16, mra106] #story[986]
This commit is contained in:
@@ -3,6 +3,7 @@ package seng302.models.xml;
|
||||
import freemarker.template.Configuration;
|
||||
import freemarker.template.Template;
|
||||
import freemarker.template.TemplateException;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import seng302.server.messages.XMLMessageSubType;
|
||||
|
||||
import java.io.*;
|
||||
@@ -27,11 +28,7 @@ public class XMLGenerator {
|
||||
configuration = new Configuration(Configuration.VERSION_2_3_26);
|
||||
|
||||
try {
|
||||
configuration.setDirectoryForTemplateLoading(new File(getClass().getResource(XML_TEMPLATE_DIR).toURI()));
|
||||
} catch (IOException e){
|
||||
System.out.println("[FATAL] Server could not read XML templates");
|
||||
} catch (URISyntaxException e) {
|
||||
System.out.println("[FATAL] Xml template directory URI is invalid");
|
||||
configuration.setClassForTemplateLoading(getClass(), XML_TEMPLATE_DIR);
|
||||
} catch (NullPointerException e){
|
||||
System.out.println("[FATAL] Server could not load XML Template directory, ensure this directory isn't empty");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user