提交 f1b513cf 编写于 作者: J Jesse Glick

[JENKINS-16301] Need to create parent directory of fingerprint file too.

上级 fff90c10
......@@ -867,6 +867,7 @@ public class Fingerprint implements ModelObject, Saveable {
void save(File file) throws IOException {
if (facets.isEmpty()) {
file.getParentFile().mkdirs();
// JENKINS-16301: fast path for the common case.
PrintWriter w = new PrintWriter(file, "UTF-8");
try {
......
......@@ -141,7 +141,7 @@ public class FingerprintTest {
f.addWithoutSaving("some", 3);
f.addWithoutSaving("some", 10);
f.addWithoutSaving("other", 6);
File xml = tmp.newFile();
File xml = new File(new File(tmp.getRoot(), "dir"), "fp.xml");
f.save(xml);
Fingerprint f2 = Fingerprint.load(xml);
assertEquals(f.toString(), f2.toString());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册