improve signing
diff --git a/plugins/org.eclipse.wtp.releng.tools/src/org/eclipse/wtp/releng/tools/UpdatePackPropertiesFile.java b/plugins/org.eclipse.wtp.releng.tools/src/org/eclipse/wtp/releng/tools/UpdatePackPropertiesFile.java
index 49454f4..8b0e453 100644
--- a/plugins/org.eclipse.wtp.releng.tools/src/org/eclipse/wtp/releng/tools/UpdatePackPropertiesFile.java
+++ b/plugins/org.eclipse.wtp.releng.tools/src/org/eclipse/wtp/releng/tools/UpdatePackPropertiesFile.java
@@ -47,12 +47,12 @@
 	private String archiveFilename;
 	private FilenameFilter jarFileFilter = new JarFileFilter();
 	private static String tempdir;
-	private static String destinationdirectory;
+
 	static {
 		tempdir = System.getProperty("java.io.tmpdir");
 		if (!(tempdir.endsWith("/") || tempdir.endsWith("\\")))
 			tempdir = tempdir + FILE_SEPERATOR;
-		destinationdirectory = tempdir + "tempzip" + FILE_SEPERATOR;
+		tempdir = tempdir + "tempupdatepackproperties" + FILE_SEPERATOR;
 	}
 
 	/**
@@ -99,17 +99,22 @@
 
 	private void excludeSignedJars() throws IOException {
 		String result = "";
-
+		String destinationdirectory = null;
 		String zipfilename = getArchiveFilename();
+		String zipfilenameOnly = nameOnly(zipfilename);
+		// we add zip file name as part of directory name, to be sure
+		// it is unique (since more than one build can be running).
+		destinationdirectory = tempdir + zipfilenameOnly + FILE_SEPERATOR;
+
 		log("Finding jars already signed");
 		log("destinationdirectory: " + destinationdirectory, Project.MSG_DEBUG);
 
 		// delete if exists, to remove items from previous runs
 		File tempDestDir = new File(destinationdirectory);
 		if (tempDestDir.exists()) {
-			tempDestDir.delete();
+			deleteDirectory(tempDestDir);
 		}
-		
+
 
 		extractZipStream(destinationdirectory, zipfilename);
 
@@ -134,7 +139,8 @@
 		packFile.write("sign.excludes=" + result + EOL);
 		packFile.close();
 
-		String tempzipFileName = tempdir + "tempzip.zip";
+		// again, include zip file name to make sure unique
+		String tempzipFileName = tempdir + "tempzip" + zipfilenameOnly + ".zip";
 		File tempnewarchive = new File(tempzipFileName);
 		// delete, if exists from previous run
 		if (tempnewarchive.exists()) {
@@ -144,7 +150,8 @@
 
 		File originalarchive = new File(getArchiveFilename());
 		// we mostly back this up in case we need to compare original with
-		// tweaked version. Eventually, when confidence gained, this could be removed.
+		// tweaked version. Eventually, when confidence gained, this could be
+		// removed.
 		File tempbackup = new File(getArchiveFilename() + ".bak");
 		originalarchive.renameTo(tempbackup);
 
@@ -155,6 +162,38 @@
 	}
 
 
+	private void deleteDirectory(File tempDestDir) {
+
+		File[] files = tempDestDir.listFiles();
+		for (int i = 0; i < files.length; i++) {
+			File file = files[i];
+			if (file.isDirectory()) {
+				deleteDirectory(file);
+			}
+			else {
+				file.delete();
+			}
+		}
+		boolean success = tempDestDir.delete();
+		if (!success) {
+			throw new BuildException("could not delete temporary desination directory");
+		}
+
+	}
+
+	private String nameOnly(String zipfilename) {
+		String result = zipfilename;
+
+		// note, not sure if we should check for both '/' and '\\'?
+		int lastSeperatorPos = zipfilename.lastIndexOf(FILE_SEPERATOR);
+		// we use -4 for length of extension: ".zip"
+		result = result.substring(lastSeperatorPos + 1, result.length() - 4);
+
+		log("filenameonly: " + result);
+
+		return result;
+	}
+
 	private void zipDirectory(String dir, String zipFileName) {
 		File dirObj = new File(dir);
 
@@ -163,7 +202,7 @@
 
 			ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFileName));
 			log("Creating : " + zipFileName, Project.MSG_DEBUG);
-			addDir(dirObj, out);
+			addDir(dirObj, out, dir);
 			// Complete and close the ZIP file
 			out.close();
 
@@ -175,19 +214,28 @@
 
 	}
 
-	private void addDir(File dirObj, ZipOutputStream out) throws IOException {
+	private void addDir(File dirObj, ZipOutputStream out, String rootDirectory) throws IOException {
 		File[] files = dirObj.listFiles();
 		byte[] tmpBuf = new byte[1024];
 
 
 		for (int i = 0; i < files.length; i++) {
 			if (files[i].isDirectory()) {
-				addDir(files[i], out);
+				String entryName = files[i].getCanonicalPath().substring(rootDirectory.length());
+				entryName = translate(entryName, '\\', "/");
+				if (!entryName.endsWith("/")) {
+					entryName = entryName + "/";
+				}
+
+				log(" Adding Directory Entry: " + entryName, Project.MSG_DEBUG);
+				out.putNextEntry(new ZipEntry(entryName));
+				// now recurse through the directory
+				addDir(files[i], out, rootDirectory);
 			}
 			else {
 				FileInputStream in = new FileInputStream(files[i].getAbsolutePath());
 
-				String entryName = files[i].getAbsolutePath().substring(destinationdirectory.length());
+				String entryName = files[i].getAbsolutePath().substring(rootDirectory.length());
 				log(" Adding: " + entryName, Project.MSG_DEBUG);
 
 				out.putNextEntry(new ZipEntry(entryName));
@@ -206,6 +254,20 @@
 	}
 
 
+	private String translate(String entryName, char c, String d) {
+		String result = entryName;
+		if (entryName.indexOf(c) > -1) {
+			StringBuffer tempHold = new StringBuffer(entryName);
+			for (int i = 0; i < tempHold.length(); i++) {
+				if (tempHold.charAt(i) == c) {
+					tempHold.replace(i, i+1, d);
+				}
+			}
+			result = tempHold.toString();
+		}
+		return result;
+	}
+
 	private String checkIfJarsSigned(String currentresults, String destinationDir, String parentDir, String[] jars) throws IOException {
 		for (int i = 0; i < jars.length; i++) {
 			String jarname = jars[i];
@@ -234,40 +296,48 @@
 
 		// make sure destination exists
 		File dir = new File(destinationdirectory);
-		dir.mkdirs();
+		boolean success = dir.mkdirs();
+		if (success) {
 
 
-		zipentry = zipinputstream.getNextEntry();
-		while (zipentry != null) {
-			// for each entry to be extracted
-			String entryName = zipentry.getName();
-			log("entryname: " + entryName, Project.MSG_DEBUG);
-			int n;
-			FileOutputStream fileoutputstream;
-
-
-
-			if (zipentry.isDirectory()) {
-				// we assume folder entries come before their files.
-				// not sure that's always true?
-				File newFile = new File(destinationdirectory + entryName);
-				newFile.mkdirs();
-			}
-			else {
-
-				fileoutputstream = new FileOutputStream(destinationdirectory + entryName);
-
-				while ((n = zipinputstream.read(buf, 0, 1024)) > -1)
-					fileoutputstream.write(buf, 0, n);
-				fileoutputstream.close();
-			}
-
-			zipinputstream.closeEntry();
 			zipentry = zipinputstream.getNextEntry();
+			while (zipentry != null) {
+				// for each entry to be extracted
+				String entryName = zipentry.getName();
+				log("entryname: " + entryName, Project.MSG_DEBUG);
+				int n;
+				FileOutputStream fileoutputstream;
 
-		}// while
 
-		zipinputstream.close();
+
+				String fullname = destinationdirectory + entryName;
+				if (zipentry.isDirectory()) {
+					// we assume folder entries come before their files.
+					// not sure that's always true?
+					File newDir = new File(fullname);
+					newDir.mkdirs();
+				}
+				else {
+					File newFile = new File(fullname);
+
+					fileoutputstream = new FileOutputStream(newFile);
+
+					while ((n = zipinputstream.read(buf, 0, 1024)) > -1)
+						fileoutputstream.write(buf, 0, n);
+					fileoutputstream.close();
+				}
+
+				zipinputstream.closeEntry();
+				zipentry = zipinputstream.getNextEntry();
+
+			}// while
+
+			zipinputstream.close();
+		}
+
+		else {
+			throw new BuildException("Could not create directory: " + destinationdirectory);
+		}
 	}
 
 	public String getArchiveFilename() {