提交 e0b6883a 编写于 作者: K kohsuke

added a method to abort.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@11284 71c3de6d-444a-0410-be80-ed276b4c234a
上级 1bd245df
......@@ -49,6 +49,15 @@ public class AtomicFileWriter extends Writer {
core.close();
}
/**
* When the write operation failed and you'd like to leave the original file intact,
* you can optionally call this method to clean up a temporary file that was created by this writer.
*/
public void abort() throws IOException {
core.close();
tmpFile.delete();
}
public void commit() throws IOException {
close();
if(destFile.exists() && !destFile.delete())
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册