public static void checkFolderForFile ( String fileName ) throws IOException { if ( fileName . lastIndexOf ( File . separator ) > 0 ) { String folder = fileName . substring ( 0 , fileName . lastIndexOf ( File . separator ) ) ; directoryCheck ( folder ) ; } }
Checks whether the folder exists for fileName and creates it if necessary .