Exemplo n.º 1
0
        /// <summary>
        /// Given an update file, returns the path to the file in local store
        /// </summary>
        /// <param name="updateFile">The file to get the path for</param>
        /// <returns>Fully qualified path to the file. The path might not exist.</returns>
        private string GetUpdateFilePath(UpdateFile updateFile)
        {
            if (updateFile.Digests.Count == 0)
            {
                throw new Exception("Cannot determine file path for update with no digest");
            }

            var contentSubDirectory = updateFile.GetContentDirectoryName();

            return(Path.Combine(LocalPath, ContentDirectoryName, contentSubDirectory, updateFile.Digests[0].HexString, updateFile.Digests[0].HexString + Path.GetExtension(updateFile.FileName)));
        }