/// <summary>
/// Create a new in-core index representation and read an index from disk.
/// <para />
/// The new index will be read before it is returned to the caller. Read
/// failures are reported as exceptions and therefore prevent the method from
/// returning a partially populated index.
/// </summary>
/// <param name="indexLocation">Location of the index file on disk.</param>
/// <returns> a cache representing the contents of the specified index file (if
/// it exists) or an empty cache if the file does not exist.
/// </returns>
/// <exception cref="IOException">
/// The index file is present but could not be read.
/// </exception>
/// <exception cref="CorruptObjectException">
/// The index file is using a format or extension that this
/// library does not support.
/// </exception>
public static DirCache read(FileInfo indexLocation)
{
var c = new DirCache(indexLocation);
c.read();
return(c);
}