func DownloadAndBuildOvaFile(file vmlist.ChunkFile) error { if err := downloadFileIfNeeded(file); err != nil { return err } filename := file.GetLocalFileName() if err := unzipFile(filename); err != nil { return err } return os.Remove(filename) }
func downloadFileIfNeeded(f vmlist.ChunkFile) error { return downloadMd5AndFileIfMd5NotMatch(f.Md5url, f.Url, f.GetLocalFileName()) }