C# 클래스 Common.SyncHelper

Implements various methods involved in communication with an ftp server.
파일 보기 프로젝트 열기: Revelations/BaconApp

공개 메소드들

메소드 설명
CompareFileSize ( string fileName, string localDirectory = "", string remoteDirectory = "" ) : bool

Compares a local version of a file with its remote counterpart to check whether or not they are the same size.

CompareLastModified ( string fileName, string localDirectory = "", string remoteDirectory = "" ) : bool

Compares a local version of a file with its remote counterpart to check whether or not they have the same last modified date.

DeleteLocalFile ( string fileName, string localDirectory ) : void

Deletes a local file from the file system.

DeleteRemoteFile ( string fileName, string remoteDirectory = "" ) : void

Deletes a file from a remote FTP server.

DownloadFile ( string fileName, string localDirectory = "", string remoteDirectory = "" ) : void

Downloads a single file from a remote FTP server.

GetLocalDirectoryListing ( string directory = "" ) : List

Gets a list of files stored in a given local directory.

GetLocalDirectoryListing ( string directory, bool subdirectories ) : List
GetLocalFileSize ( string fileName, string localDirectory = "" ) : long?

Gets the size of a file stored on the local file system.

GetLocalLastModified ( string fileName, string localDirectory = "" ) : DateTime?

Gets the time at which a local file was last modified.

GetRemoteDirectoryListing ( ) : List

Gets a listing of all the files in the root directory of the FTP server.

GetRemoteDirectoryListing ( string subDirectory ) : List

Gets a listing of all the files in a subdirectory of the FTP server.

GetRemoteFileSize ( string fileName, string remoteDirectory = "" ) : long?

Gets the size of a file stored on the remote server.

GetRemoteLastModified ( string fileName, string remoteDirectory = "" ) : DateTime?

Gets the time at which a remote file was last modified.

LocalVersionExists ( string fileName, string localDirectory = "" ) : bool

Checks if there is a given file present on the local filesystem.

NeedsDownload ( string filename, string localDirectory = "", string remoteDirectory = "" ) : bool

Determines if a file needs to be downloaded, based on differences between the server and filesystem.

NeedsFeedbackDownload ( string filename, List files ) : bool

NeedsUpload ( string filename, List files, string localDirectory = "", string remoteDirectory = "" ) : bool

NeedsUpload ( string filename, string localDirectory = "", string remoteDirectory = "" ) : bool

Determines if a file needs to be downloaded, based on differences between the server and filesystem.

RemoteVersionExists ( string fileName, string remoteDirectory = "" ) : bool

Checks if there is a given file present on a remote FTP server.

UploadFile ( string fileName, string localDirectory = "", string remoteDirectory = "" ) : void

Uploads a single file to a remote FTP server.

비공개 메소드들

메소드 설명
GetDirectoryDetails ( string directory, string method ) : List

Gets a directory listing from a remote server in a format according to the web request method used.

InitRequest ( string location, string method ) : FtpWebRequest

Initialises an FTPWebRequest to perform operations on a remote FTP server.

ItemIsFile ( string item ) : bool

Checks whether a specified string represents a file or a directory.

메소드 상세

CompareFileSize() 공개 정적인 메소드

Compares a local version of a file with its remote counterpart to check whether or not they are the same size.
public static CompareFileSize ( string fileName, string localDirectory = "", string remoteDirectory = "" ) : bool
fileName string Name of the file.
localDirectory string Directory that local version is stored in. Relative to working directory.
remoteDirectory string Directory that remote version is stored in.
리턴 bool

CompareLastModified() 공개 정적인 메소드

Compares a local version of a file with its remote counterpart to check whether or not they have the same last modified date.
public static CompareLastModified ( string fileName, string localDirectory = "", string remoteDirectory = "" ) : bool
fileName string Name of the file.
localDirectory string Directory that local version is stored in. Relative to working directory.
remoteDirectory string Directory that remote version is stored in.
리턴 bool

DeleteLocalFile() 공개 정적인 메소드

Deletes a local file from the file system.
public static DeleteLocalFile ( string fileName, string localDirectory ) : void
fileName string Name of the file to delete.
localDirectory string Directory relative to working directory that it is stored in.
리턴 void

DeleteRemoteFile() 공개 정적인 메소드

Deletes a file from a remote FTP server.
public static DeleteRemoteFile ( string fileName, string remoteDirectory = "" ) : void
fileName string Name of the file to delete.
remoteDirectory string Optional subdirectory it is located in.
리턴 void

DownloadFile() 공개 정적인 메소드

Downloads a single file from a remote FTP server.
public static DownloadFile ( string fileName, string localDirectory = "", string remoteDirectory = "" ) : void
fileName string Name of the file to download.
localDirectory string Directory relative to the working directory to store it in once downloaded.
remoteDirectory string Subdirectory the file is located in on the server.
리턴 void

GetLocalDirectoryListing() 공개 정적인 메소드

Gets a list of files stored in a given local directory.
public static GetLocalDirectoryListing ( string directory = "" ) : List
directory string Optional subdirectory to retrieve list for instead.
리턴 List

GetLocalDirectoryListing() 공개 정적인 메소드

public static GetLocalDirectoryListing ( string directory, bool subdirectories ) : List
directory string
subdirectories bool
리턴 List

GetLocalFileSize() 공개 정적인 메소드

Gets the size of a file stored on the local file system.
public static GetLocalFileSize ( string fileName, string localDirectory = "" ) : long?
fileName string Name of the file.
localDirectory string Directory it is located in. Relative to the working directory.
리턴 long?

GetLocalLastModified() 공개 정적인 메소드

Gets the time at which a local file was last modified.
public static GetLocalLastModified ( string fileName, string localDirectory = "" ) : DateTime?
fileName string Name of the file.
localDirectory string Directory it is located in. Relative to the working directory.
리턴 DateTime?

GetRemoteDirectoryListing() 공개 정적인 메소드

Gets a listing of all the files in the root directory of the FTP server.
public static GetRemoteDirectoryListing ( ) : List
리턴 List

GetRemoteDirectoryListing() 공개 정적인 메소드

Gets a listing of all the files in a subdirectory of the FTP server.
public static GetRemoteDirectoryListing ( string subDirectory ) : List
subDirectory string Name of the subdirectory to index.
리턴 List

GetRemoteFileSize() 공개 정적인 메소드

Gets the size of a file stored on the remote server.
public static GetRemoteFileSize ( string fileName, string remoteDirectory = "" ) : long?
fileName string Name of the file.
remoteDirectory string Directory it is located in. Relative to the root directory.
리턴 long?

GetRemoteLastModified() 공개 정적인 메소드

Gets the time at which a remote file was last modified.
public static GetRemoteLastModified ( string fileName, string remoteDirectory = "" ) : DateTime?
fileName string Name of the file.
remoteDirectory string Directory it is located in. Relative to the root directory.
리턴 DateTime?

LocalVersionExists() 공개 정적인 메소드

Checks if there is a given file present on the local filesystem.
public static LocalVersionExists ( string fileName, string localDirectory = "" ) : bool
fileName string Name of the file.
localDirectory string Directory it is located in. Relative to working directory.
리턴 bool

NeedsDownload() 공개 정적인 메소드

Determines if a file needs to be downloaded, based on differences between the server and filesystem.
public static NeedsDownload ( string filename, string localDirectory = "", string remoteDirectory = "" ) : bool
filename string Name of the file.
localDirectory string Optional additional directory it is stored in.
remoteDirectory string Directory it is located in on the server.
리턴 bool

NeedsFeedbackDownload() 공개 정적인 메소드

public static NeedsFeedbackDownload ( string filename, List files ) : bool
filename string
files List
리턴 bool

NeedsUpload() 공개 정적인 메소드

public static NeedsUpload ( string filename, List files, string localDirectory = "", string remoteDirectory = "" ) : bool
filename string
files List
localDirectory string
remoteDirectory string
리턴 bool

NeedsUpload() 공개 정적인 메소드

Determines if a file needs to be downloaded, based on differences between the server and filesystem.
public static NeedsUpload ( string filename, string localDirectory = "", string remoteDirectory = "" ) : bool
filename string Name of the file.
localDirectory string Optional additional directory it is stored in.
remoteDirectory string Directory it is located in on the server.
리턴 bool

RemoteVersionExists() 공개 정적인 메소드

Checks if there is a given file present on a remote FTP server.
public static RemoteVersionExists ( string fileName, string remoteDirectory = "" ) : bool
fileName string Name of the file.
remoteDirectory string Remote subdirectory it resides in.
리턴 bool

UploadFile() 공개 정적인 메소드

Uploads a single file to a remote FTP server.
public static UploadFile ( string fileName, string localDirectory = "", string remoteDirectory = "" ) : void
fileName string Name of the file.
localDirectory string Directory relative to the working directory that file is currently stored in.
remoteDirectory string Remote directory to store the file in once uploaded.
리턴 void