-
-
Notifications
You must be signed in to change notification settings - Fork 940
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Create ISftpFile interface. SftpFile sealed. Return ISftpFile from SftpClient instead of SftpFile. Make ISftpClient interface disposable. Co-authored-by: Wojciech Swieboda <[email protected]>
- Loading branch information
Showing
11 changed files
with
275 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,233 @@ | ||
using System; | ||
|
||
namespace Renci.SshNet.Sftp | ||
{ | ||
/// <summary> | ||
/// Represents SFTP file information | ||
/// </summary> | ||
public interface ISftpFile | ||
{ | ||
/// <summary> | ||
/// Gets the file attributes. | ||
/// </summary> | ||
SftpFileAttributes Attributes { get; } | ||
|
||
/// <summary> | ||
/// Gets the full path of the directory or file. | ||
/// </summary> | ||
string FullName { get; } | ||
|
||
/// <summary> | ||
/// For files, gets the name of the file. For directories, gets the name of the last directory in the hierarchy if a hierarchy exists. | ||
/// Otherwise, the Name property gets the name of the directory. | ||
/// </summary> | ||
string Name { get; } | ||
|
||
/// <summary> | ||
/// Gets or sets the time the current file or directory was last accessed. | ||
/// </summary> | ||
/// <value> | ||
/// The time that the current file or directory was last accessed. | ||
/// </value> | ||
DateTime LastAccessTime { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the time when the current file or directory was last written to. | ||
/// </summary> | ||
/// <value> | ||
/// The time the current file was last written. | ||
/// </value> | ||
DateTime LastWriteTime { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the time, in coordinated universal time (UTC), the current file or directory was last accessed. | ||
/// </summary> | ||
/// <value> | ||
/// The time that the current file or directory was last accessed. | ||
/// </value> | ||
DateTime LastAccessTimeUtc { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the time, in coordinated universal time (UTC), when the current file or directory was last written to. | ||
/// </summary> | ||
/// <value> | ||
/// The time the current file was last written. | ||
/// </value> | ||
DateTime LastWriteTimeUtc { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the size, in bytes, of the current file. | ||
/// </summary> | ||
/// <value> | ||
/// The size of the current file in bytes. | ||
/// </value> | ||
long Length { get; } | ||
|
||
/// <summary> | ||
/// Gets or sets file user id. | ||
/// </summary> | ||
/// <value> | ||
/// File user id. | ||
/// </value> | ||
int UserId { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets file group id. | ||
/// </summary> | ||
/// <value> | ||
/// File group id. | ||
/// </value> | ||
int GroupId { get; set; } | ||
|
||
/// <summary> | ||
/// Gets a value indicating whether file represents a socket. | ||
/// </summary> | ||
/// <value> | ||
/// <c>true</c> if file represents a socket; otherwise, <c>false</c>. | ||
/// </value> | ||
bool IsSocket { get; } | ||
|
||
/// <summary> | ||
/// Gets a value indicating whether file represents a symbolic link. | ||
/// </summary> | ||
/// <value> | ||
/// <c>true</c> if file represents a symbolic link; otherwise, <c>false</c>. | ||
/// </value> | ||
bool IsSymbolicLink { get; } | ||
|
||
/// <summary> | ||
/// Gets a value indicating whether file represents a regular file. | ||
/// </summary> | ||
/// <value> | ||
/// <c>true</c> if file represents a regular file; otherwise, <c>false</c>. | ||
/// </value> | ||
bool IsRegularFile { get; } | ||
|
||
/// <summary> | ||
/// Gets a value indicating whether file represents a block device. | ||
/// </summary> | ||
/// <value> | ||
/// <c>true</c> if file represents a block device; otherwise, <c>false</c>. | ||
/// </value> | ||
bool IsBlockDevice { get; } | ||
|
||
/// <summary> | ||
/// Gets a value indicating whether file represents a directory. | ||
/// </summary> | ||
/// <value> | ||
/// <c>true</c> if file represents a directory; otherwise, <c>false</c>. | ||
/// </value> | ||
bool IsDirectory { get; } | ||
|
||
/// <summary> | ||
/// Gets a value indicating whether file represents a character device. | ||
/// </summary> | ||
/// <value> | ||
/// <c>true</c> if file represents a character device; otherwise, <c>false</c>. | ||
/// </value> | ||
bool IsCharacterDevice { get; } | ||
|
||
/// <summary> | ||
/// Gets a value indicating whether file represents a named pipe. | ||
/// </summary> | ||
/// <value> | ||
/// <c>true</c> if file represents a named pipe; otherwise, <c>false</c>. | ||
/// </value> | ||
bool IsNamedPipe { get; } | ||
|
||
/// <summary> | ||
/// Gets or sets a value indicating whether the owner can read from this file. | ||
/// </summary> | ||
/// <value> | ||
/// <c>true</c> if owner can read from this file; otherwise, <c>false</c>. | ||
/// </value> | ||
bool OwnerCanRead { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets a value indicating whether the owner can write into this file. | ||
/// </summary> | ||
/// <value> | ||
/// <c>true</c> if owner can write into this file; otherwise, <c>false</c>. | ||
/// </value> | ||
bool OwnerCanWrite { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets a value indicating whether the owner can execute this file. | ||
/// </summary> | ||
/// <value> | ||
/// <c>true</c> if owner can execute this file; otherwise, <c>false</c>. | ||
/// </value> | ||
bool OwnerCanExecute { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets a value indicating whether the group members can read from this file. | ||
/// </summary> | ||
/// <value> | ||
/// <c>true</c> if group members can read from this file; otherwise, <c>false</c>. | ||
/// </value> | ||
bool GroupCanRead { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets a value indicating whether the group members can write into this file. | ||
/// </summary> | ||
/// <value> | ||
/// <c>true</c> if group members can write into this file; otherwise, <c>false</c>. | ||
/// </value> | ||
bool GroupCanWrite { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets a value indicating whether the group members can execute this file. | ||
/// </summary> | ||
/// <value> | ||
/// <c>true</c> if group members can execute this file; otherwise, <c>false</c>. | ||
/// </value> | ||
bool GroupCanExecute { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets a value indicating whether the others can read from this file. | ||
/// </summary> | ||
/// <value> | ||
/// <c>true</c> if others can read from this file; otherwise, <c>false</c>. | ||
/// </value> | ||
bool OthersCanRead { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets a value indicating whether the others can write into this file. | ||
/// </summary> | ||
/// <value> | ||
/// <c>true</c> if others can write into this file; otherwise, <c>false</c>. | ||
/// </value> | ||
bool OthersCanWrite { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets a value indicating whether the others can execute this file. | ||
/// </summary> | ||
/// <value> | ||
/// <c>true</c> if others can execute this file; otherwise, <c>false</c>. | ||
/// </value> | ||
bool OthersCanExecute { get; set; } | ||
|
||
/// <summary> | ||
/// Sets file permissions. | ||
/// </summary> | ||
/// <param name="mode">The mode.</param> | ||
void SetPermissions(short mode); | ||
|
||
/// <summary> | ||
/// Permanently deletes a file on remote machine. | ||
/// </summary> | ||
void Delete(); | ||
|
||
/// <summary> | ||
/// Moves a specified file to a new location on remote machine, providing the option to specify a new file name. | ||
/// </summary> | ||
/// <param name="destFileName">The path to move the file to, which can specify a different file name.</param> | ||
/// <exception cref="ArgumentNullException"><paramref name="destFileName"/> is <c>null</c>.</exception> | ||
void MoveTo(string destFileName); | ||
|
||
/// <summary> | ||
/// Updates file status on the server. | ||
/// </summary> | ||
void UpdateStatus(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.