Skip to content

Instantly share code, notes, and snippets.

@breeze4
Created October 12, 2014 16:57
Show Gist options
  • Save breeze4/a2e1dfac14aa47186c99 to your computer and use it in GitHub Desktop.
Save breeze4/a2e1dfac14aa47186c99 to your computer and use it in GitHub Desktop.
String s = Paths.get("").toAbsolutePath().toString();
String newJsonFile = s.replace("\\", "/") + "/src/test/resources/" + jsonFile;
try (Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(newJsonFile), "utf-8"))) {
writer.write(json);
} catch (IOException ex) {
// handle me
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment