File (String link) { File linkFile = new File(link); if (!linkFile.isAbsolute()) { linkFile = new File(getTempDirectory(), link); } assertTrue(link, !linkFile.exists() || linkFile.delete()); File parentDir = linkFile.getParentFile(); assertTrue("link=" + link + ", parent=" + parentDir, parentDir != null && (parentDir.isDirectory() || parentDir.mkdirs())); return linkFile; }