Java implementation of mkdir.