internal FtpFileTransferer(FtpDirectory transferStarter, string localFile, string remoteFile, long totalBytes, TransferDirection dir) { m_transferStarter = transferStarter; m_transferDirection = dir; m_session = transferStarter.FtpSession; m_localFile = localFile; m_remoteFile = remoteFile; m_totalBytes = totalBytes; if (dir == TransferDirection.Upload) { m_beginEvent = new FileEventDelegate(m_session.Host.RaiseBeginPutFileEvent); m_endEvent = new FileEventDelegate(m_session.Host.RaiseEndPutFile); m_streamCopyRoutine = new StreamCopyDelegate(LocalToRemote); m_ftpFileCommandRoutine = new FtpDelegate(m_session.ControlChannel.STOR); m_localFileOpenMode = FileMode.Open; } else { m_beginEvent = new FileEventDelegate(m_session.Host.RaiseBeginGetFileEvent); m_endEvent = new FileEventDelegate(m_session.Host.RaiseEndGetFile); m_streamCopyRoutine = new StreamCopyDelegate(RemoteToLocal); m_ftpFileCommandRoutine = new FtpDelegate(m_session.ControlChannel.RETR); m_localFileOpenMode = FileMode.Create; } }
internal FtpFile(FtpDirectory parent, ref ItemInfo info) { m_parent = parent; m_name = info.name; m_size = info.size; m_permission = info.permission; }
public FtpDirectory CreateSubdir(string dirName) { CheckSessionCurrentDirectory(); m_session.ControlChannel.MKD(dirName); var dir = new FtpDirectory(FtpSession, this.FullName, dirName); m_subDirectories.Add(dirName, dir); return(dir); }
public FtpDirectory FindSubdirectory(string dirName, bool ignoreCase) { InitHashtable(); FtpDirectory d = (FtpDirectory)m_subDirectories[dirName]; if (d != null) { return(d); } else if (ignoreCase) { string upperCase = dirName.ToUpper(); foreach (string s in m_subDirectories.Keys) { if (s.ToUpper() == upperCase) { return((FtpDirectory)m_subDirectories[s]); } } } return(null); }
internal FtpFile(FtpDirectory parent, string name) { m_parent = parent; m_name = name; }
internal void InitRootDirectory() { m_root = new FtpDirectory(this); m_current = m_root; }
public FtpDirectory CreateSubdir(string dirName) { CheckSessionCurrentDirectory(); m_session.ControlChannel.MKD(dirName); var dir = new FtpDirectory(FtpSession, this.FullName, dirName); m_subDirectories.Add(dirName, dir); return dir; }