Example #1
0
        /// <summary>
        /// Creates the specified sub directory
        /// </summary>
        /// <param name="name"></param>
        public FtpDirectory CreateDirectory(string name)
        {
            FtpDirectory fd = new FtpDirectory(this.Client, string.Format("{0}/{1}", this.FullName, name));

            fd.Parent = this;
            this.Client.CreateDirectory(string.Format("{0}/{1}", this.FullName, name));
            if (_dirs.Count > 0)
            {
                _dirs.Add(fd);
            }

            return(fd);
        }
Example #2
0
        /// <summary>
        /// Loads the file and directory listing
        /// </summary>
        void LoadListing()
        {
            FtpFileSystemObjectList <FtpDirectory> dirs  = new FtpFileSystemObjectList <FtpDirectory>();
            FtpFileSystemObjectList <FtpFile>      files = new FtpFileSystemObjectList <FtpFile>();

            foreach (FtpListItem i in this.Client.GetListing(this.FullName))
            {
                if (i.Type == FtpObjectType.Directory)
                {
                    dirs.Add(new FtpDirectory(this.Client, this, i));
                }
                else if (i.Type == FtpObjectType.File)
                {
                    files.Add(new FtpFile(this.Client, this, i));
                }
            }

            this._dirs  = dirs;
            this._files = files;
        }