/// <summary>
        /// Creates a new <see cref="FileInstance"/> for the specified file.
        /// </summary>
        private FileInstance createFileInstance(IDirectoryInfo baseDirectory, IFileInfo file)
        {
            string relativePath = file.GetRelativePath(baseDirectory);

            using (System.IO.Stream stream = file.OpenRead())
            {
                long    fileSize         = stream.Length;
                Hash256 fileContentsHash = Hash256.GetContentsHash(stream);
                return(new FileInstance(relativePath, fileSize, fileContentsHash));
            }
        }