From bfaf4a427d016abd60e743d193e5e9bbd2d9e37e Mon Sep 17 00:00:00 2001 From: kohsuke Date: Fri, 15 Aug 2008 22:59:25 +0000 Subject: [PATCH] added a switch to skip the "ln" invocation, even on Unix. This is primarily added for the sake of Project Caroline, but I might remove this later. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@11514 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/Util.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/Util.java b/core/src/main/java/hudson/Util.java index ce1a6b3535..ad394e99d3 100644 --- a/core/src/main/java/hudson/Util.java +++ b/core/src/main/java/hudson/Util.java @@ -37,7 +37,6 @@ import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.text.NumberFormat; import java.text.ParseException; -import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -727,7 +726,7 @@ public class Util { * If there's a prior symlink at baseDir+symlinkPath, it will be overwritten. */ public static void createSymlink(File baseDir, String targetPath, String symlinkPath, TaskListener listener) throws InterruptedException { - if(!isWindows()) { + if(!isWindows() && !NO_SYMLINK) { try { // ignore a failure. new LocalProc(new String[]{"rm","-rf", symlinkPath},new String[0],listener.getLogger(), baseDir).join(); @@ -805,4 +804,9 @@ public class Util { = FastDateFormat.getInstance("EEE, dd MMM yyyy HH:mm:ss Z", Locale.US); private static final Logger LOGGER = Logger.getLogger(Util.class.getName()); + + /** + * On Unix environment that cannot run "ln", set this to true. + */ + public static boolean NO_SYMLINK = Boolean.getBoolean(Util.class.getName()+".noSymLink"); } -- GitLab