Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JENKINS-42393] Temporary files should not be created in the bundles …
…root directory under JENKINS_HOME (#106) [JENKINS-42393] Temporary files should not be created in the bundles root directory under JENKINS_HOME
- Loading branch information
Showing
7 changed files
with
54 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/main/java/com/cloudbees/jenkins/support/configfiles/XmlRedactedSecretFileContent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.cloudbees.jenkins.support.configfiles; | ||
|
||
import com.cloudbees.jenkins.support.api.FileContent; | ||
import org.xml.sax.SAXException; | ||
|
||
import javax.xml.transform.TransformerException; | ||
import java.io.ByteArrayInputStream; | ||
import java.io.File; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
|
||
class XmlRedactedSecretFileContent extends FileContent { | ||
|
||
public XmlRedactedSecretFileContent(String name, File file) { | ||
super(name, file); | ||
} | ||
|
||
@Override | ||
protected InputStream getInputStream() throws IOException { | ||
try { | ||
return new ByteArrayInputStream(SecretHandler.findSecrets(file).getBytes(SecretHandler.OUTPUT_ENCODING)); | ||
} catch (SAXException | TransformerException e) { | ||
throw new IOException(e); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters