/// <summary> /// Retrieves a list of the files from current working directory on the remote FTP /// server using the LIST command. /// </summary> /// <returns>FtpItemList collection object.</returns> /// <remarks> /// This method returns a FtpItemList collection of FtpItem objects. /// </remarks> /// <seealso cref="GetDirListAsync(string)"/> /// <seealso cref="GetDirListAsText(string)"/> /// <seealso cref="GetDirListDeep"/> /// <seealso cref="GetDirListDeepAsync(string)"/> /// <seealso cref="GetNameList(string)"/> public virtual FtpItemCollection GetDirList() { var items = new FtpItemCollection(_currentDirectory, base.TransferText(new FtpRequest(base.CharacterEncoding, FtpCmd.List, "-al")), _itemParser); items.SetTimeOffset(ServerTimeOffset); return items; }
/// <summary> /// Retrieves a list of the files from a specified path on the remote FTP /// server using the LIST command. /// </summary> /// <param name="path">The path to a directory on the remote FTP server.</param> /// <returns>FtpFileCollection collection object.</returns> /// <remarks> /// This method returns a FtpFileCollection object containing a collection of /// FtpItem objects. Some FTP server implementations will not accept a full path to a resource. On those /// systems it is best to change the working directory using the ChangeDirectoryMultiPath(string) method and then call /// the method GetDirList(). /// </remarks> /// <seealso cref="GetDirListAsync(string)"/> /// <seealso cref="GetDirListAsText(string)"/> /// <seealso cref="GetDirListDeep"/> /// <seealso cref="GetDirListDeepAsync(string)"/> /// <seealso cref="GetNameList(string)"/> public virtual FtpItemCollection GetDirList(string path) { if (path == null) throw new ArgumentNullException("path"); var items = new FtpItemCollection(path, base.TransferText(new FtpRequest(base.CharacterEncoding, FtpCmd.List, "-al", path)), _itemParser); items.SetTimeOffset(ServerTimeOffset); return items; }
/// <summary> /// Deeply retrieves a list of all files and all sub directories from a specified path on the remote FTP /// server using the LIST command. /// </summary> /// <param name="path">The path to a directory on the remote FTP server.</param> /// <returns>FtpFileCollection collection object.</returns> /// <remarks> /// This method returns a FtpFileCollection object containing a collection of /// FtpItem objects. /// Note that some FTP servers will not accept a full path. On those systems you must navigate to /// the parent directory you wish to get the directory list using with the ChangeDirectory() or ChangeDirectoryMultiPath() /// method. /// </remarks> /// <seealso cref="GetDirListDeepAsync(string)"/> /// <seealso cref="GetDirList(string)"/> /// <seealso cref="GetDirListAsync(string)"/> /// <seealso cref="GetDirListAsText(string)"/> /// <seealso cref="GetNameList(string)"/> public virtual FtpItemCollection GetDirListDeep(string path) { if (path == null) throw new ArgumentNullException("path"); FtpItemCollection deepCol = new FtpItemCollection(); ParseDirListDeep(path, deepCol); deepCol.SetTimeOffset(ServerTimeOffset); return deepCol; }