Commit 7182d3af authored by Tianyi Zuo's avatar Tianyi Zuo
Browse files

Added a close

parent c5f3f314
Pipeline #63100 canceled with stages
in 88 minutes and 26 seconds
......@@ -20,7 +20,7 @@ public class MarkDownCreator implements Page {
}
private File toMarkDown(String result) throws IOException {
File temp = File.createTempFile(query,".md",null);
File temp = File.createTempFile(query,".markdown",null);
System.out.println(temp.getAbsolutePath());
BufferedWriter writer = new BufferedWriter(new FileWriter(temp));
writer.write(result);
......@@ -41,6 +41,7 @@ public class MarkDownCreator implements Page {
File markdown = toMarkDown(answer);
InputStream stream = new FileInputStream(markdown);
writer.write(stream.readAllBytes());
writer.close();
markdown.delete();
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment