From 65890a2fb33cacc7eae43d3b2f35ca3d4ec8e53d Mon Sep 17 00:00:00 2001 From: kohsuke Date: Sun, 21 Oct 2007 04:37:12 +0000 Subject: [PATCH] try to make it writable by using a Mustang feature. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@5368 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/Util.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/src/main/java/hudson/Util.java b/core/src/main/java/hudson/Util.java index ae9ac1a904..cbab7aa014 100644 --- a/core/src/main/java/hudson/Util.java +++ b/core/src/main/java/hudson/Util.java @@ -137,6 +137,13 @@ public class Util { LOGGER.log(Level.INFO,"Failed to chmod "+f,e); } + // also try JDK6-way of doing it. + try { + f.setWritable(true); + } catch (NoSuchMethodError e) { + // not JDK6 + } + if(!f.delete() && f.exists()) throw new IOException("Unable to delete " + f.getPath()); }