MCPcopy Create free account
hub / github.com/akeranen/the-one / writeToFile

Method writeToFile

test/MapBasedMovementTest.java:248–266  ·  view source on GitHub ↗
(String path)

Source from the content-addressed store, hash-verified

246 }
247
248 private void writeToFile(String path) throws IOException {
249 File tempFile = new File(path);
250 PrintWriter out = new PrintWriter(tempFile);
251 out.println(WKT);
252 out.close();
253 String ns = MapBasedMovement.MAP_BASE_MOVEMENT_NS + ".";
254
255 // override sim map settings
256 File settingsFile = File.createTempFile("settingsFile", ".tmp");
257 settingsFile.deleteOnExit();
258 PrintWriter pw = new PrintWriter(settingsFile);
259 pw.println(ns + MapBasedMovement.NROF_FILES_S + " = 1");
260 // need to change path separators for settings file
261 pw.println(ns + MapBasedMovement.FILE_S + "1 = " +
262 tempFile.getAbsolutePath().replace('\\', '/'));
263 pw.close();
264 Settings.init(settingsFile.getAbsolutePath());
265
266 }
267
268}

Callers 1

writeToNewFileMethod · 0.95

Calls 2

initMethod · 0.95
closeMethod · 0.65

Tested by

no test coverage detected