public Restore ( BuildKey builder, IFileSystemDirectory targetRoot, bool aggressive, Regex aggressiveExceptions = null ) : ISet |
||
builder | BuildKey | Builder key |
targetRoot | IFileSystemDirectory | Target file system directory |
aggressive | bool | If |
aggressiveExceptions | Regex | Exceptions to the aggresivve mode. Can be |
return | ISet |
public ISet<TargetRelativePath> Restore(BuildKey builder, IFileSystemDirectory targetRoot, bool aggressive, Regex[] aggressiveExceptions = null)
{
MemoryCacheItem item;
lock (cache)
cache.TryGetValue(builder, out item);
if (item != null)
{
var outputs = item.Outputs;
var paths = new HashSet<TargetRelativePath>();
foreach (var pair in outputs)
{
if (pair.Value != null)
{
using (var stream = targetRoot.CreateBinaryFile(pair.Key))
stream.Write(pair.Value, 0, pair.Value.Length);
}
paths.Add(pair.Key);
}
return paths;
}
else
{
return new HashSet<TargetRelativePath>();
}
}