From b5644ea25bb7bb49233bc950e199253cf72cb52f Mon Sep 17 00:00:00 2001 From: imod Date: Sun, 8 Jan 2012 19:31:08 +0100 Subject: [PATCH] [FIXED JENKINS-12315] Location of the temporary file 'Maven Global Settings' incompatible with release: prepare --- .../maven/settings/SettingsProviderUtils.java | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/maven-plugin/src/main/java/hudson/maven/settings/SettingsProviderUtils.java b/maven-plugin/src/main/java/hudson/maven/settings/SettingsProviderUtils.java index 97fb7bc1a1..290b142027 100644 --- a/maven-plugin/src/main/java/hudson/maven/settings/SettingsProviderUtils.java +++ b/maven-plugin/src/main/java/hudson/maven/settings/SettingsProviderUtils.java @@ -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); } /**