// temp folder (in the SDK base folder) and use the archive name for the\r
// download. This allows us to reuse or continue downloads.\r
\r
- File tmpFile = new File(getTempFolder(osSdkRoot), base);\r
+ File tmpFolder = getTempFolder(osSdkRoot);\r
+ if (!tmpFolder.isDirectory()) {\r
+ if (tmpFolder.isFile()) {\r
+ deleteFileOrFolder(tmpFolder);\r
+ }\r
+ if (!tmpFolder.mkdirs()) {\r
+ monitor.setResult("Failed to create directory %1$s", tmpFolder.getPath());\r
+ return null;\r
+ }\r
+ }\r
+ File tmpFile = new File(tmpFolder, base);\r
\r
// if the file exists, check if its checksum & size. Use it if complete\r
if (tmpFile.exists()) {\r
File baseTempFolder = getTempFolder(osBasePath);\r
\r
if (!baseTempFolder.isDirectory()) {\r
+ if (baseTempFolder.isFile()) {\r
+ deleteFileOrFolder(baseTempFolder);\r
+ }\r
if (!baseTempFolder.mkdirs()) {\r
return null;\r
}\r