@ NonNull private static String randomMediaPath ( File bucket , String extension ) { if ( bucket . exists ( ) && bucket . isFile ( ) ) bucket . delete ( ) ; if ( ! bucket . exists ( ) ) bucket . mkdirs ( ) ; String outFilePath = AlbumUtils . getNowDateTime ( "yyyyMMdd_HHmmssSSS" ) + "_" + getMD5ForString ( UUID . randomUUID ( ) . toString ( ) ) + extension ; File file = new File ( bucket , outFilePath ) ; return file . getAbsolutePath ( ) ; }
Generates a random file path using the specified suffix name in the specified directory .