private FileInfo GetSystemFileInfo(IBiosFile biosFile) { var fileInfo = new FileInfo(Path.Combine(this.SystemFileRoot.FullName, $"{biosFile.Md5Hash}.{biosFile.FileName}")); return(fileInfo); }
public void AddSystemFile(IBiosFile biosFile, Stream systemFileStream) { using (FileStream stream = File.Create(this.GetSystemFileInfo(biosFile).FullName)) { stream.Position = 0; systemFileStream.Position = 0; systemFileStream.CopyTo(stream); stream.Close(); } }
public async Task AddSystemFileAsync(IBiosFile biosFile, Stream systemFileStream) { using (FileStream stream = File.Create(this.GetSystemFileInfo(biosFile).FullName)) { stream.Position = 0; systemFileStream.Position = 0; await systemFileStream.CopyToAsync(stream); stream.Close(); } }
public FileInfo GetSystemFilePath(IBiosFile biosFile) { var fileInfo = this.GetSystemFileInfo(biosFile); if (!fileInfo.Exists) { throw new FileNotFoundException($"BIOS File with hash {biosFile.Md5Hash} does not exist."); } return(fileInfo); }
public bool ContainsSystemFile(IBiosFile biosFile) { return(this.GetSystemFileInfo(biosFile).Exists); }
public Stream GetSystemFile(IBiosFile biosFile) { return(File.OpenRead(this.GetSystemFileInfo(biosFile).FullName)); }
public void AddSystemFile(IBiosFile biosFile, FileInfo systemFilePath) { systemFilePath.CopyTo(this.GetSystemFileInfo(biosFile).FullName, true); }