mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-16 21:42:27 +00:00
[FIXED JENKINS-12315] Location of the temporary file 'Maven Global Settings' incompatible with release: prepare
This commit is contained in:
1 parent
5a2a2b3427
commit
b5644ea25b
1 file changed
+2
-15
@@ -18,17 +18,16 @@ package hudson.maven.settings;
|
||||
import hudson.ExtensionList;
|
||||
import hudson.FilePath;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.jenkinsci.lib.configprovider.ConfigProvider;
|
||||
import org.jenkinsci.lib.configprovider.model.Config;
|
||||
|
||||
/**
|
||||
* @author Olivier Lamy
|
||||
* @author Dominik Bartholdi (imod)
|
||||
* @since 1.426
|
||||
*/
|
||||
public class SettingsProviderUtils {
|
||||
@@ -64,19 +63,7 @@ public class SettingsProviderUtils {
|
||||
* @param workspace
|
||||
*/
|
||||
public static FilePath copyConfigContentToFilePath(Config config, FilePath workspace) throws IOException, InterruptedException {
|
||||
File tmpContentFile = null;
|
||||
ByteArrayInputStream bs = null;
|
||||
|
||||
try {
|
||||
tmpContentFile = File.createTempFile("config", "tmp");
|
||||
FilePath filePath = new FilePath(workspace, tmpContentFile.getName());
|
||||
bs = new ByteArrayInputStream(config.content.getBytes());
|
||||
filePath.copyFrom(bs);
|
||||
return filePath;
|
||||
} finally {
|
||||
FileUtils.deleteQuietly(tmpContentFile);
|
||||
IOUtils.closeQuietly(bs);
|
||||
}
|
||||
return workspace.createTextTempFile("config", ".tmp", config.content, false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user