Skip to content
Permalink
Browse files

[JENKINS-32943] Use a standardized temporary directory for secretFiles.

  • Loading branch information...
jglick committed Feb 22, 2016
1 parent 689655d commit 8661953085e98b71a5f2eaa3c191d4cecd3b66f4
Showing with 7 additions and 6 deletions.
  1. +7 −6 src/main/java/org/jenkinsci/plugins/credentialsbinding/impl/FileBinding.java
@@ -27,10 +27,9 @@
import hudson.Extension;
import hudson.FilePath;
import hudson.Launcher;
import hudson.model.Computer;
import hudson.model.Node;
import hudson.model.Run;
import hudson.model.TaskListener;
import hudson.slaves.WorkspaceList;
import java.io.IOException;
import java.util.UUID;

@@ -86,10 +85,12 @@
}

private static FilePath secretsDir(FilePath workspace) {
Computer computer = workspace.toComputer();
Node node = computer == null ? null : computer.getNode();
FilePath root = node == null ? workspace : node.getRootPath();
return root.child("secretFiles");
return tempDir(workspace).child("secretFiles");
}

// TODO move to WorkspaceList
private static FilePath tempDir(FilePath ws) {
return ws.sibling(ws.getName() + System.getProperty(WorkspaceList.class.getName(), "@") + "tmp");
}

protected void copy(FilePath secret, FileCredentials credentials) throws IOException, InterruptedException {

0 comments on commit 8661953

Please sign in to comment.
You can’t perform that action at this time.