No.Use tmp.getParentFile().mkdirs() before you create the file.
tmp.getParentFile().mkdirs()
File theDir = new File(DirectoryPath);if (!theDir.exists()) theDir.mkdirs();
File directory = new File(tmp.getParentFile().getAbsolutePath());directory.mkdirs();
If the directories already exist, nothing will happen, so you don't need any checks.