public static File getStorageDirectory ( File parent_directory , String new_child_directory_name ) { File result = new File ( parent_directory , new_child_directory_name ) ; if ( ! result . exists ( ) ) if ( result . mkdir ( ) ) return result ; else { Log . e ( "getStorageDirectory" , "Error creating " + result . getAbsolutePath ( ) ) ; return null ; } else if ( result . isFile ( ) ) { return null ; } Log . d ( "getStorageDirectory" , "directory ready: " + result . getAbsolutePath ( ) ) ; return result ; }
Returns a Java File initialized to a directory of given name within the given location .