question: @ Nullable @ WorkerThread static File writeBitmapToDirectory ( @ NonNull Bitmap bitmap , @ NonNull File directory ) { if ( ! directory . mkdirs ( ) && ! directory . exists ( ) ) { Log . e ( TAG , "Failed to create directory for bitmap." ) ; return null ; } return writeBitmapToFile ( bitmap , new File ( directory , createUniqueFilename ( BITMAP_PREFIX ) ) ) ; }
target:  Writes the bitmap the directory, creating the directory if it doesn't exist.