From 6967eff5b49c9c557a1444ee44f9ff62186e37d1 Mon Sep 17 00:00:00 2001 From: Gerard Smit Date: Tue, 28 May 2024 20:07:43 +0200 Subject: [PATCH] Pass UPath to GetEntry --- src/Zio/FileSystems/ZipArchiveFileSystem.cs | 24 ++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Zio/FileSystems/ZipArchiveFileSystem.cs b/src/Zio/FileSystems/ZipArchiveFileSystem.cs index 3899073..8fb7260 100644 --- a/src/Zio/FileSystems/ZipArchiveFileSystem.cs +++ b/src/Zio/FileSystems/ZipArchiveFileSystem.cs @@ -187,7 +187,7 @@ protected override void CopyFileImpl(UPath srcPath, UPath destPath, bool overwri throw new IOException("Source and destination path must be different."); } - var srcEntry = GetEntry(srcPath.FullName, out var isDirectory); + var srcEntry = GetEntry(srcPath, out var isDirectory); if (isDirectory) { @@ -218,7 +218,7 @@ protected override void CopyFileImpl(UPath srcPath, UPath destPath, bool overwri } } - var destEntry = GetEntry(destPath.FullName); + var destEntry = GetEntry(destPath); if (destEntry != null) { #if NETSTANDARD2_1_OR_GREATER || NET6_0_OR_GREATER @@ -386,7 +386,7 @@ protected override void DeleteFileImpl(UPath path) throw new IOException("Cannot delete a directory"); } - var entry = GetEntry(path.FullName); + var entry = GetEntry(path); if (entry == null) { return; @@ -516,7 +516,7 @@ protected override bool FileExistsImpl(UPath path) /// protected override FileAttributes GetAttributesImpl(UPath path) { - var entry = GetEntry(path.FullName); + var entry = GetEntry(path); if (entry is null) { throw FileSystemExceptionHelper.NewFileNotFoundException(path); @@ -543,7 +543,7 @@ protected override FileAttributes GetAttributesImpl(UPath path) /// protected override long GetFileLengthImpl(UPath path) { - var entry = GetEntry(path.FullName, out var isDirectory); + var entry = GetEntry(path, out var isDirectory); if (entry == null || isDirectory) { @@ -581,7 +581,7 @@ protected override DateTime GetLastAccessTimeImpl(UPath path) /// protected override DateTime GetLastWriteTimeImpl(UPath path) { - var entry = GetEntry(path.FullName); + var entry = GetEntry(path); if (entry == null) { return DefaultFileTime; @@ -649,14 +649,14 @@ protected override void MoveDirectoryImpl(UPath srcPath, UPath destPath) /// protected override void MoveFileImpl(UPath srcPath, UPath destPath) { - var srcEntry = GetEntry(srcPath.FullName) ?? throw FileSystemExceptionHelper.NewFileNotFoundException(srcPath); + var srcEntry = GetEntry(srcPath) ?? throw FileSystemExceptionHelper.NewFileNotFoundException(srcPath); if (!DirectoryExistsImpl(destPath.GetDirectory())) { throw FileSystemExceptionHelper.NewDirectoryNotFoundException(destPath.GetDirectory()); } - var destEntry = GetEntry(destPath.FullName); + var destEntry = GetEntry(destPath); if (destEntry != null) { throw new IOException("Cannot overwrite existing file."); @@ -687,7 +687,7 @@ protected override Stream OpenFileImpl(UPath path, FileMode mode, FileAccess acc throw new ArgumentException("Cannot write in a read-only access."); } - var entry = GetEntry(path.FullName, out var isDirectory); + var entry = GetEntry(path, out var isDirectory); if (isDirectory) { @@ -755,13 +755,13 @@ protected override Stream OpenFileImpl(UPath path, FileMode mode, FileAccess acc /// protected override void ReplaceFileImpl(UPath srcPath, UPath destPath, UPath destBackupPath, bool ignoreMetadataErrors) { - var sourceEntry = GetEntry(srcPath.FullName); + var sourceEntry = GetEntry(srcPath); if (sourceEntry is null) { throw FileSystemExceptionHelper.NewFileNotFoundException(srcPath); } - var destEntry = GetEntry(destPath.FullName); + var destEntry = GetEntry(destPath); if (destEntry == sourceEntry) { throw new IOException("Cannot replace the file with itself."); @@ -837,7 +837,7 @@ protected override void SetLastAccessTimeImpl(UPath path, DateTime time) /// protected override void SetLastWriteTimeImpl(UPath path, DateTime time) { - var entry = GetEntry(path.FullName); + var entry = GetEntry(path); if (entry is null) { throw FileSystemExceptionHelper.NewFileNotFoundException(path);