示例#1
0
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)
}
示例#2
0
func downloadFileIfNeeded(f vmlist.ChunkFile) error {
	return downloadMd5AndFileIfMd5NotMatch(f.Md5url, f.Url, f.GetLocalFileName())
}