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; }
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; }
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; }
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); }
public Log(string file, Sync sync) { Sync = sync; LogFile = file; }
public FtpConnections(Sync sync) { Sync = sync; }