File file=new File(filePath);if (file.exists()) {}else { File fileParent =new File(file.getParent()); fileParent.mkdirs();}