Skip to content

Commit

Permalink
[JENKINS-16301] Need to create parent directory of fingerprint file too.
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick committed May 28, 2013
1 parent fff90c1 commit f1b513c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions core/src/main/java/hudson/model/Fingerprint.java
Expand Up @@ -867,6 +867,7 @@ public synchronized void save() throws IOException {

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 {
Expand Down
2 changes: 1 addition & 1 deletion core/src/test/java/hudson/model/FingerprintTest.java
Expand Up @@ -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());
Expand Down

0 comments on commit f1b513c

Please sign in to comment.