예제 #1
0
 public FtpDirectory(Sync sync, FileOrDirectory parent, Uri url)
 {
     Sync = sync;
     Parent = parent;
     if (url.Scheme != "ftp" && url.Scheme != "ftps") throw new NotSupportedException();
     Url = url;
     Name = url.File();
     Class = ObjectClass.Directory;
     Changed = DateTime.Now.AddDays(2);
     if (parent is FtpDirectory) TransferProgress = ((FtpDirectory)parent).TransferProgress;
 }
예제 #2
0
 public LocalDirectory(Sync sync, FileOrDirectory parent, Uri url)
 {
     Sync = sync;
     Parent = parent;
     if (!url.ToString().Contains(':')) {
         if (url.ToString() == ".") url = new Uri(Environment.CurrentDirectory);
         else url = new Uri(System.IO.Path.Combine(Environment.CurrentDirectory, url.ToString()));
     }
     if (!url.IsFile) throw new NotSupportedException("url is no local file.");
     Url = url;
     var info = new DirectoryInfo(Path);
     Name = info.Name;
     Class = ObjectClass.Directory;
     ChangedUtc = info.LastWriteTimeUtc;
 }
예제 #3
0
 public FtpClient(Sync sync, string host, int port, FtpSecurityProtocol protocol, int Index, bool isSource)
     : base(host, port, protocol)
 {
     Sync = sync; this.Index = Index; this.IsSource = isSource; SupportsFXP = false;
 }
예제 #4
0
 public static IDirectory Parse(Sync sync, Uri url)
 {
     if (url.IsFile || !url.ToString().Contains(':')) return new LocalDirectory(sync, null, url);
     else return new FtpDirectory(sync, null, url);
 }
예제 #5
0
 public Log(string file, Sync sync)
 {
     Sync = sync; LogFile = file;
 }
예제 #6
0
 public FtpConnections(Sync sync)
 {
     Sync = sync;
 }