public static File mkdirs(File dir) throws IOException {
        try {
            return Files.createDirectories(fileToPath(dir)).toFile();
        } catch (UnsupportedOperationException e) {
            throw new IOException(e);
        }
    }
public static File mkdirs ( File dir ) throws IOException { try { return Files . createDirectories ( fileToPath ( dir ) ) . toFile ( ) ; } catch ( UnsupportedOperationException e ) { throw new IOException ( e ) ; } }
Ensures that the given directory exists (if not, it's created, including all the parent directories.)

@return
This method returns the 'dir' parameter so that the method call flows better.