IAbsoluteFilePath GetFilePath(WriteParFileInfo info) { return _parPath.GetChildDirectoryWithName(new ShortGuid(info.GameId).ToString()) .GetChildFileWithName(GetFileName(info)); }
static string GetFileName(WriteParFileInfo info) { var additionalIdentifier = info.AdditionalIdentifier == null ? null : "_" + info.AdditionalIdentifier; return "par" + additionalIdentifier + ".txt"; }
public async Task<IAbsoluteFilePath> WriteParFile(WriteParFileInfo info) { var filePath = GetFilePath(info); this.Logger().Info("Writing par file at: {0}, with:\n{1}", filePath, info.Content); await _writer.WriteFileAsync(filePath.ToString(), info.Content, Encoding.Default).ConfigureAwait(false); return filePath; }