Skip to content

Commit

Permalink
[NOISSUE] format
Browse files Browse the repository at this point in the history
  • Loading branch information
BalintBende committed Jul 22, 2024
1 parent 65f4fd7 commit 52f22af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/bcf-toolkit/Converter/Bcf30/FileWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public static void SerializeAndWriteBcfToStream(IBcf bcf, ZipArchive zip,
zip.CreateEntryFromObject("extensions.xml", bcfObject.Extensions);
zip.CreateEntryFromObject("project.bcfp", bcfObject.Project);
zip.CreateEntryFromObject("documents.xml", bcfObject.Document);

if (bcfObject.Document?.Documents is null) return;
foreach (var document in bcfObject.Document.Documents) {
var documentFileName = document.Guid;
Expand Down Expand Up @@ -229,22 +229,22 @@ public static async Task<string> SerializeAndWriteBcfToFolder(
"project.bcfp", bcfObject.Project));
writeTasks.Add(BcfExtensions.SerializeAndWriteXmlFile(tmpFolder,
"documents.xml", bcfObject.Document));

var documentFolder = $"{tmpFolder}/documents";
if (bcfObject.Document?.Documents is not null)
foreach (var document in bcfObject.Document.Documents) {
var documentFileName = document.Guid;
var base64String = document.DocumentData?.Data;
if (documentFileName is null || base64String is null) continue;

if (Directory.Exists(documentFolder) is not true)
Directory.CreateDirectory(documentFolder);

writeTasks.Add(File.WriteAllBytesAsync(
$"{documentFolder}/{documentFileName}",
Convert.FromBase64String(base64String)));
}

await Task.WhenAll(writeTasks);

Log.Debug($"Zipping the output: {target}");
Expand Down
2 changes: 1 addition & 1 deletion src/tests/Converter/Bcf30/ConverterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public async Task BuildSimpleV30BcfFromStreamTest() {
Assert.That(1, Is.EqualTo(bcf.Markups.Count));
Assert.That("3.0", Is.EqualTo(bcf.Version?.VersionId));
}

/// <summary>
/// It should generate a bcf with internal documents.
/// </summary>
Expand Down

0 comments on commit 52f22af

Please sign in to comment.