question: public static Path createDirectory ( final Path parent , final String folderName ) { final File file = new File ( parent . toFile ( ) , folderName ) ; if ( ! file . exists ( ) ) { if ( ! file . mkdir ( ) ) { throw new RuntimeException ( "Error while trying to create folder at " + parent + " with " + folderName + "." ) ; } } file . deleteOnExit ( ) ; return file . toPath ( ) ; }
target:  Creates a new directory with the given parent folder and folder name. The newly created folder will be deleted on graceful VM shutdown.