Latest bnd sync

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1370165 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundleplugin/src/main/java/aQute/bnd/osgi/Jar.java b/bundleplugin/src/main/java/aQute/bnd/osgi/Jar.java
index 11c0dab..93c55a1 100755
--- a/bundleplugin/src/main/java/aQute/bnd/osgi/Jar.java
+++ b/bundleplugin/src/main/java/aQute/bnd/osgi/Jar.java
@@ -97,6 +97,7 @@
 		this.name = name;
 	}
 
+	@Override
 	public String toString() {
 		return "Jar:" + name;
 	}
@@ -768,14 +769,19 @@
 	public void expand(File dir) throws Exception {
 		check();
 		dir = dir.getAbsoluteFile();
-		dir.mkdirs();
+		if (!dir.exists() && !dir.mkdirs()) {
+			throw new IOException("Could not create directory " + dir);
+		}
 		if (!dir.isDirectory()) {
 			throw new IllegalArgumentException("Not a dir: " + dir.getAbsolutePath());
 		}
 
 		for (Map.Entry<String,Resource> entry : getResources().entrySet()) {
 			File f = getFile(dir, entry.getKey());
-			f.getParentFile().mkdirs();
+			File fp = f.getParentFile();
+			if (!fp.exists() && !fp.mkdirs()) {
+				throw new IOException("Could not create directory " + fp);
+			}
 			IO.copy(entry.getValue().openInputStream(), f);
 		}
 	}