-
-
Notifications
You must be signed in to change notification settings - Fork 940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add interface to SftpFile #120 #812
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make SftpFile sealed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done