Esempio n. 1
0
        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;
            }
        }
Esempio n. 2
0
 internal FtpFile(FtpDirectory parent, ref ItemInfo info)
 {
     m_parent     = parent;
     m_name       = info.name;
     m_size       = info.size;
     m_permission = info.permission;
 }
        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;
            }
        }
Esempio n. 4
0
 internal FtpFile(FtpDirectory parent, ref ItemInfo info)
 {
     m_parent = parent;
     m_name = info.name;
     m_size = info.size;
     m_permission = info.permission;
 }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
        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);
        }
Esempio n. 7
0
 internal FtpFile(FtpDirectory parent, string name)
 {
     m_parent = parent;
     m_name   = name;
 }
Esempio n. 8
0
 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;
        }
Esempio n. 10
0
 internal FtpFile(FtpDirectory parent, string name)
 {
     m_parent = parent;
     m_name = name;
 }