public void cleanup() { if (td != null) { String dnldPath = td.getDownloadLocalPath(); if (dnldPath != null) { File f = new File(dnldPath); File dir = f.getParentFile(); f.delete(); if (dir != null) { dir.delete(); } } } }
public String getDownloadLocalPath(String jobId) { DownloadJob dj = jobs.get(jobId); if (dj != null) { return dj.getTemplateDownloader().getDownloadLocalPath(); } return null; }
s_logger.info("local: " + td.getDownloadLocalPath() + ", bytes=" + td.getDownloadedBytes() + ", error=" + td.getDownloadError() + ", pct=" + td.getDownloadPercent());
File originalTemplate = new File(td.getDownloadLocalPath()); ChecksumValue oldValue = new ChecksumValue(dnld.getChecksum()); ChecksumValue newValue = null; int imgSizeGigs = (int)Math.ceil(_storage.getSize(td.getDownloadLocalPath()) * 1.0d / (1024 * 1024 * 1024)); scr.add("-f", td.getDownloadLocalPath()); // this is the temporary template file downloaded scr.add("-u"); // cleanup String result;