Skip to content

Commit

Permalink
Pass UPath to GetEntry
Browse files Browse the repository at this point in the history
  • Loading branch information
GerardSmit committed May 28, 2024
1 parent 0792412 commit 6967eff
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/Zio/FileSystems/ZipArchiveFileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -516,7 +516,7 @@ protected override bool FileExistsImpl(UPath path)
/// <inheritdoc />
protected override FileAttributes GetAttributesImpl(UPath path)
{
var entry = GetEntry(path.FullName);
var entry = GetEntry(path);
if (entry is null)
{
throw FileSystemExceptionHelper.NewFileNotFoundException(path);
Expand All @@ -543,7 +543,7 @@ protected override FileAttributes GetAttributesImpl(UPath path)
/// <inheritdoc />
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)
{
Expand Down Expand Up @@ -581,7 +581,7 @@ protected override DateTime GetLastAccessTimeImpl(UPath path)
/// <inheritdoc />
protected override DateTime GetLastWriteTimeImpl(UPath path)
{
var entry = GetEntry(path.FullName);
var entry = GetEntry(path);
if (entry == null)
{
return DefaultFileTime;
Expand Down Expand Up @@ -649,14 +649,14 @@ protected override void MoveDirectoryImpl(UPath srcPath, UPath destPath)
/// <inheritdoc />
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.");
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -755,13 +755,13 @@ protected override Stream OpenFileImpl(UPath path, FileMode mode, FileAccess acc
/// <inheritdoc />
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.");
Expand Down Expand Up @@ -837,7 +837,7 @@ protected override void SetLastAccessTimeImpl(UPath path, DateTime time)
/// <inheritdoc />
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);
Expand Down

0 comments on commit 6967eff

Please sign in to comment.