Skip to content

Commit

Permalink
Rename SftpFileSytemInformation to SftpFileSystemInformation (#1425)
Browse files Browse the repository at this point in the history
  • Loading branch information
fndejan authored Jun 12, 2024
1 parent ac395dd commit 830e504
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 35 deletions.
10 changes: 5 additions & 5 deletions src/Renci.SshNet/ISftpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -665,26 +665,26 @@ public interface ISftpClient : IBaseClient
/// </summary>
/// <param name="path">The path.</param>
/// <returns>
/// A <see cref="SftpFileSytemInformation"/> instance that contains file status information.
/// A <see cref="SftpFileSystemInformation"/> instance that contains file status information.
/// </returns>
/// <exception cref="SshConnectionException">Client is not connected.</exception>
/// <exception cref="ArgumentNullException"><paramref name="path" /> is <see langword="null"/>.</exception>
/// <exception cref="ObjectDisposedException">The method was called after the client was disposed.</exception>
SftpFileSytemInformation GetStatus(string path);
SftpFileSystemInformation GetStatus(string path);

/// <summary>
/// Asynchronously gets status using [email protected] request.
/// </summary>
/// <param name="path">The path.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to observe.</param>
/// <returns>
/// A <see cref="Task{SftpFileSytemInformation}"/> that represents the status operation.
/// The task result contains the <see cref="SftpFileSytemInformation"/> instance that contains file status information.
/// A <see cref="Task{SftpFileSystemInformation}"/> that represents the status operation.
/// The task result contains the <see cref="SftpFileSystemInformation"/> instance that contains file status information.
/// </returns>
/// <exception cref="SshConnectionException">Client is not connected.</exception>
/// <exception cref="ArgumentNullException"><paramref name="path" /> is <see langword="null"/>.</exception>
/// <exception cref="ObjectDisposedException">The method was called after the client was disposed.</exception>
Task<SftpFileSytemInformation> GetStatusAsync(string path, CancellationToken cancellationToken);
Task<SftpFileSystemInformation> GetStatusAsync(string path, CancellationToken cancellationToken);

/// <summary>
/// Retrieves list of files in remote directory.
Expand Down
4 changes: 2 additions & 2 deletions src/Renci.SshNet/Sftp/ISftpSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ internal interface ISftpSession : ISubsystemSession
/// The file system information for the specified path, or <see langword="null"/> when
/// the request failed and <paramref name="nullOnError"/> is <see langword="true"/>.
/// </returns>
SftpFileSytemInformation RequestStatVfs(string path, bool nullOnError = false);
SftpFileSystemInformation RequestStatVfs(string path, bool nullOnError = false);

/// <summary>
/// Asynchronously performs a <c>[email protected]</c> extended request.
Expand All @@ -382,7 +382,7 @@ internal interface ISftpSession : ISubsystemSession
/// <see cref="Task{Task}.Result"/> contains the file system information for the specified
/// path.
/// </returns>
Task<SftpFileSytemInformation> RequestStatVfsAsync(string path, CancellationToken cancellationToken);
Task<SftpFileSystemInformation> RequestStatVfsAsync(string path, CancellationToken cancellationToken);

/// <summary>
/// Performs SSH_FXP_SYMLINK request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ namespace Renci.SshNet.Sftp.Responses
{
internal sealed class StatVfsReplyInfo : ExtendedReplyInfo
{
public SftpFileSytemInformation Information { get; private set; }
public SftpFileSystemInformation Information { get; private set; }

public override void LoadData(SshDataStream stream)
{
Information = new SftpFileSytemInformation(stream.ReadUInt64(), // FileSystemBlockSize
Information = new SftpFileSystemInformation(stream.ReadUInt64(), // FileSystemBlockSize
stream.ReadUInt64(), // BlockSize
stream.ReadUInt64(), // TotalBlocks
stream.ReadUInt64(), // FreeBlocks
Expand Down
6 changes: 3 additions & 3 deletions src/Renci.SshNet/Sftp/SftpFileSystemInformation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Renci.SshNet.Sftp
/// Contains File system information exposed by [email protected] request.
/// </summary>
#pragma warning disable SA1649 // File name should match first type name
public class SftpFileSytemInformation
public class SftpFileSystemInformation
#pragma warning restore SA1649 // File name should match first type name
{
#pragma warning disable SA1310 // Field names should not contain underscore
Expand Down Expand Up @@ -119,7 +119,7 @@ public bool SupportsSetUid
public ulong MaxNameLenght { get; private set; }

/// <summary>
/// Initializes a new instance of the <see cref="SftpFileSytemInformation" /> class.
/// Initializes a new instance of the <see cref="SftpFileSystemInformation" /> class.
/// </summary>
/// <param name="bsize">The bsize.</param>
/// <param name="frsize">The frsize.</param>
Expand All @@ -132,7 +132,7 @@ public bool SupportsSetUid
/// <param name="sid">The sid.</param>
/// <param name="flag">The flag.</param>
/// <param name="namemax">The namemax.</param>
internal SftpFileSytemInformation(ulong bsize, ulong frsize, ulong blocks, ulong bfree, ulong bavail, ulong files, ulong ffree, ulong favail, ulong sid, ulong flag, ulong namemax)
internal SftpFileSystemInformation(ulong bsize, ulong frsize, ulong blocks, ulong bfree, ulong bavail, ulong files, ulong ffree, ulong favail, ulong sid, ulong flag, ulong namemax)
{
FileSystemBlockSize = bsize;
BlockSize = frsize;
Expand Down
20 changes: 10 additions & 10 deletions src/Renci.SshNet/Sftp/SftpSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1987,9 +1987,9 @@ public void RequestPosixRename(string oldPath, string newPath)
/// <param name="path">The path.</param>
/// <param name="nullOnError">if set to <see langword="true"/> [null on error].</param>
/// <returns>
/// A <see cref="SftpFileSytemInformation"/> for the specified path.
/// A <see cref="SftpFileSystemInformation"/> for the specified path.
/// </returns>
public SftpFileSytemInformation RequestStatVfs(string path, bool nullOnError = false)
public SftpFileSystemInformation RequestStatVfs(string path, bool nullOnError = false)
{
if (ProtocolVersion < 3)
{
Expand All @@ -1998,7 +1998,7 @@ public SftpFileSytemInformation RequestStatVfs(string path, bool nullOnError = f

SshException exception = null;

SftpFileSytemInformation information = null;
SftpFileSystemInformation information = null;

using (var wait = new AutoResetEvent(initialState: false))
{
Expand Down Expand Up @@ -2045,7 +2045,7 @@ public SftpFileSytemInformation RequestStatVfs(string path, bool nullOnError = f
/// <see cref="Task{Task}.Result"/> contains the file system information for the specified
/// path.
/// </returns>
public async Task<SftpFileSytemInformation> RequestStatVfsAsync(string path, CancellationToken cancellationToken)
public async Task<SftpFileSystemInformation> RequestStatVfsAsync(string path, CancellationToken cancellationToken)
{
if (ProtocolVersion < 3)
{
Expand All @@ -2054,12 +2054,12 @@ public async Task<SftpFileSytemInformation> RequestStatVfsAsync(string path, Can

cancellationToken.ThrowIfCancellationRequested();

var tcs = new TaskCompletionSource<SftpFileSytemInformation>(TaskCreationOptions.RunContinuationsAsynchronously);
var tcs = new TaskCompletionSource<SftpFileSystemInformation>(TaskCreationOptions.RunContinuationsAsynchronously);

#if NET || NETSTANDARD2_1_OR_GREATER
await using (cancellationToken.Register(s => ((TaskCompletionSource<SftpFileSytemInformation>)s).TrySetCanceled(cancellationToken), tcs, useSynchronizationContext: false).ConfigureAwait(continueOnCapturedContext: false))
await using (cancellationToken.Register(s => ((TaskCompletionSource<SftpFileSystemInformation>)s).TrySetCanceled(cancellationToken), tcs, useSynchronizationContext: false).ConfigureAwait(continueOnCapturedContext: false))
#else
using (cancellationToken.Register(s => ((TaskCompletionSource<SftpFileSytemInformation>)s).TrySetCanceled(cancellationToken), tcs, useSynchronizationContext: false))
using (cancellationToken.Register(s => ((TaskCompletionSource<SftpFileSystemInformation>)s).TrySetCanceled(cancellationToken), tcs, useSynchronizationContext: false))
#endif // NET || NETSTANDARD2_1_OR_GREATER
{
SendRequest(new StatVfsRequest(ProtocolVersion,
Expand All @@ -2079,10 +2079,10 @@ public async Task<SftpFileSytemInformation> RequestStatVfsAsync(string path, Can
/// <param name="handle">The file handle.</param>
/// <param name="nullOnError">if set to <see langword="true"/> [null on error].</param>
/// <returns>
/// A <see cref="SftpFileSytemInformation"/> for the specified path.
/// A <see cref="SftpFileSystemInformation"/> for the specified path.
/// </returns>
/// <exception cref="NotSupportedException">This operation is not supported for the current SFTP protocol version.</exception>
internal SftpFileSytemInformation RequestFStatVfs(byte[] handle, bool nullOnError = false)
internal SftpFileSystemInformation RequestFStatVfs(byte[] handle, bool nullOnError = false)
{
if (ProtocolVersion < 3)
{
Expand All @@ -2091,7 +2091,7 @@ internal SftpFileSytemInformation RequestFStatVfs(byte[] handle, bool nullOnErro

SshException exception = null;

SftpFileSytemInformation information = null;
SftpFileSystemInformation information = null;

using (var wait = new AutoResetEvent(initialState: false))
{
Expand Down
10 changes: 5 additions & 5 deletions src/Renci.SshNet/SftpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1170,12 +1170,12 @@ public void EndUploadFile(IAsyncResult asyncResult)
/// </summary>
/// <param name="path">The path.</param>
/// <returns>
/// A <see cref="SftpFileSytemInformation"/> instance that contains file status information.
/// A <see cref="SftpFileSystemInformation"/> instance that contains file status information.
/// </returns>
/// <exception cref="SshConnectionException">Client is not connected.</exception>
/// <exception cref="ArgumentNullException"><paramref name="path" /> is <see langword="null"/>.</exception>
/// <exception cref="ObjectDisposedException">The method was called after the client was disposed.</exception>
public SftpFileSytemInformation GetStatus(string path)
public SftpFileSystemInformation GetStatus(string path)
{
CheckDisposed();

Expand All @@ -1200,13 +1200,13 @@ public SftpFileSytemInformation GetStatus(string path)
/// <param name="path">The path.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to observe.</param>
/// <returns>
/// A <see cref="Task{SftpFileSytemInformation}"/> that represents the status operation.
/// The task result contains the <see cref="SftpFileSytemInformation"/> instance that contains file status information.
/// A <see cref="Task{SftpFileSystemInformation}"/> that represents the status operation.
/// The task result contains the <see cref="SftpFileSystemInformation"/> instance that contains file status information.
/// </returns>
/// <exception cref="SshConnectionException">Client is not connected.</exception>
/// <exception cref="ArgumentNullException"><paramref name="path" /> is <see langword="null"/>.</exception>
/// <exception cref="ObjectDisposedException">The method was called after the client was disposed.</exception>
public async Task<SftpFileSytemInformation> GetStatusAsync(string path, CancellationToken cancellationToken)
public async Task<SftpFileSystemInformation> GetStatusAsync(string path, CancellationToken cancellationToken)
{
CheckDisposed();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class SftpSessionTest_Connected_RequestStatVfs
private StatVfsResponse _sftpStatVfsResponse;
private ulong _bAvail;
private string _path;
private SftpFileSytemInformation _actual;
private SftpFileSystemInformation _actual;

[TestInitialize]
public void Setup()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ public SftpStatVfsResponseBuilder WithIsReadOnly(bool isReadOnly)
{
if (isReadOnly)
{
_flag &= SftpFileSytemInformation.SSH_FXE_STATVFS_ST_RDONLY;
_flag &= SftpFileSystemInformation.SSH_FXE_STATVFS_ST_RDONLY;
}
else
{
_flag |= SftpFileSytemInformation.SSH_FXE_STATVFS_ST_RDONLY;
_flag |= SftpFileSystemInformation.SSH_FXE_STATVFS_ST_RDONLY;
}

return this;
Expand All @@ -103,11 +103,11 @@ public SftpStatVfsResponseBuilder WithSupportsSetUid(bool supportsSetUid)
{
if (supportsSetUid)
{
_flag |= SftpFileSytemInformation.SSH_FXE_STATVFS_ST_NOSUID;
_flag |= SftpFileSystemInformation.SSH_FXE_STATVFS_ST_NOSUID;
}
else
{
_flag &= SftpFileSytemInformation.SSH_FXE_STATVFS_ST_NOSUID;
_flag &= SftpFileSystemInformation.SSH_FXE_STATVFS_ST_NOSUID;
}

return this;
Expand All @@ -121,7 +121,7 @@ public SftpStatVfsResponseBuilder WithNameMax(ulong nameMax)

public StatVfsResponse Build()
{
var fileSystemInfo = new SftpFileSytemInformation(_bsize,
var fileSystemInfo = new SftpFileSystemInformation(_bsize,
_frsize,
_blocks,
_bfree,
Expand All @@ -148,7 +148,7 @@ public override SftpMessageTypes SftpMessageType
get { return SftpMessageTypes.ExtendedReply; }
}

public SftpFileSytemInformation Information { get; set; }
public SftpFileSystemInformation Information { get; set; }

public StatVfsResponse(uint protocolVersion)
: base(protocolVersion)
Expand All @@ -159,7 +159,7 @@ protected override void LoadData()
{
base.LoadData();

Information = new SftpFileSytemInformation(ReadUInt64(), // FileSystemBlockSize
Information = new SftpFileSystemInformation(ReadUInt64(), // FileSystemBlockSize
ReadUInt64(), // BlockSize
ReadUInt64(), // TotalBlocks
ReadUInt64(), // FreeBlocks
Expand Down

0 comments on commit 830e504

Please sign in to comment.