Exemplo n.º 1
0
 /// <summary>
 /// FTP 서버의 <paramref name="directory"/>의 상세 정보를 가져옵니다.
 /// </summary>
 /// <param name="ftpClient"></param>
 /// <param name="directory"></param>
 /// <returns></returns>
 public static Task <FtpDirectory> ListDirectoryDetailTask(this FtpClient ftpClient, string directory = null)
 {
     return
         (ftpClient
          .ListDirectoryInternalTask(directory, WebRequestMethods.Ftp.ListDirectoryDetails)
          .ContinueWith(task => new FtpDirectory(task.Result, directory.AsText()),
                        TaskContinuationOptions.ExecuteSynchronously));
 }
Exemplo n.º 2
0
 /// <summary>
 /// FTP 서버의 <paramref name="directory"/>의 하위 디렉토리 및 파일명을 열거합니다.
 /// </summary>
 /// <param name="ftpClient"></param>
 /// <param name="directory"></param>
 /// <returns></returns>
 public static Task <ICollection <string> > ListDirectoryTask(this FtpClient ftpClient, string directory)
 {
     return
         (ftpClient
          .ListDirectoryInternalTask(directory, WebRequestMethods.Ftp.ListDirectory)
          .ContinueWith <ICollection <string> >(
              task => task.Result.Split(new[] { '\r' }, StringSplitOptions.RemoveEmptyEntries).ToList(),
              TaskContinuationOptions.ExecuteSynchronously));
 }