REVIEW: [NEXUS-6107] mkdirs java6 compat

https://issues.sonatype.org/browse/NEXUS-6107

cherry pick to master