code: 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);
  		}
  	}
docs: Checks whether the folder exists for fileName, and creates it if necessary.
  
  @param fileName folder name.
  @throws IOException an IO exception.