11using System . IO . Compression ;
2+ using Microsoft . Extensions . Logging ;
23
34namespace Fiscalapi . XmlDownloader . FileStorage
45{
@@ -72,8 +73,9 @@ public bool FileExists(string fullFilePath)
7273 /// <param name="fullFilePath">Full path to the ZIP file</param>
7374 /// <param name="extractToPath">Path to extract files to</param>
7475 /// <param name="cancellationToken">Cancellation token</param>
76+ /// <param name="logger">Logger</param>
7577 public void ExtractZipFile ( string fullFilePath , string ? extractToPath ,
76- CancellationToken cancellationToken = default )
78+ CancellationToken cancellationToken = default , ILogger ? logger = null )
7779 {
7880 if ( string . IsNullOrWhiteSpace ( fullFilePath ) )
7981 throw new ArgumentException ( "ZIP file path cannot be null or empty" , nameof ( fullFilePath ) ) ;
@@ -141,8 +143,9 @@ public List<FileDetails> GetFiles(string directoryPath, string? fileExtension =
141143 /// <param name="fullFilePath">Full path to the file</param>
142144 /// <param name="data">Binary data to write</param>
143145 /// <param name="cancellationToken">Cancellation token</param>
146+ /// <param name="logger">Logger</param>
144147 public async Task WriteFileAsync ( string fullFilePath , byte [ ] data ,
145- CancellationToken cancellationToken = default )
148+ CancellationToken cancellationToken = default , ILogger ? logger = null )
146149 {
147150 var directory = Path . GetDirectoryName ( fullFilePath ) ;
148151 if ( string . IsNullOrEmpty ( directory ) || ! Directory . Exists ( directory ) )
@@ -159,8 +162,9 @@ public async Task WriteFileAsync(string fullFilePath, byte[] data,
159162 /// <param name="fullFilePath">Full path to the file</param>
160163 /// <param name="base64Data">Base64 encoded data to write</param>
161164 /// <param name="cancellationToken">Cancellation token</param>
165+ /// <param name="logger">Logger</param>
162166 public async Task WriteFileAsync ( string fullFilePath , string base64Data ,
163- CancellationToken cancellationToken = default )
167+ CancellationToken cancellationToken = default , ILogger ? logger = null )
164168 {
165169 var data = Convert . FromBase64String ( base64Data ) ;
166170 await WriteFileAsync ( fullFilePath , data , cancellationToken ) ;
@@ -171,8 +175,10 @@ public async Task WriteFileAsync(string fullFilePath, string base64Data,
171175 /// </summary>
172176 /// <param name="fullFilePath">Full path to the file</param>
173177 /// <param name="cancellationToken">Cancellation token</param>
178+ /// <param name="logger">Logger</param>
174179 /// <returns>File content as byte array</returns>
175- public async Task < byte [ ] > ReadFileAsync ( string fullFilePath , CancellationToken cancellationToken = default )
180+ public async Task < byte [ ] > ReadFileAsync ( string fullFilePath , CancellationToken cancellationToken = default ,
181+ ILogger ? logger = null )
176182 {
177183 return await File . ReadAllBytesAsync ( fullFilePath , cancellationToken ) ;
178184 }
@@ -182,9 +188,10 @@ public async Task<byte[]> ReadFileAsync(string fullFilePath, CancellationToken c
182188 /// </summary>
183189 /// <param name="fullFilePath">Full path to the file</param>
184190 /// <param name="cancellationToken">Cancellation token</param>
191+ /// <param name="logger">Logger</param>
185192 /// <returns>File content as string</returns>
186193 public async Task < string > ReadFileContentAsync ( string fullFilePath ,
187- CancellationToken cancellationToken = default )
194+ CancellationToken cancellationToken = default , ILogger ? logger = null )
188195 {
189196 return await File . ReadAllTextAsync ( fullFilePath , cancellationToken ) ;
190197 }
0 commit comments