コード例 #1
0
 /// <summary>
 /// Split a multi-line file list text response and add the parsed items to the collection.
 /// </summary>
 /// <param name="ftpCmdInstance"></param>
 /// <param name="path">Path to the item on the FTP server.</param>
 /// <param name="dirResults">The multi-line file list text from the FTP server.</param>
 public MlstCollection(FtpClientExt ftpCmdInstance, string path, FtpResponseCollection dirResults)
 {
     if (ftpCmdInstance == null)
     {
         throw new ArgumentNullException("ftpCmdInstance");
     }
     this.ftpCmdInstance = ftpCmdInstance;
     this.path           = path;
     Parse(dirResults);
 }
コード例 #2
0
 private void ConnectFTP()
 {
     try
     {
         ftpFileClient = new FtpClientExt(new FtpClient(csd.TargetMachineName, csd.Port, csd.SecurityProtocol), csd.BufferWireTransferSize);
         ftpFileClient.Open(csd.UserName, csd.Password);
         fsi.Open((FileMode)rawCreationDisposition);
         completedOpen = true;
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #3
0
 public DirectoryFTPInfo(FtpClientExt ftpCmdInstance, string path)
     : base(ftpCmdInstance, path)
 {
 }
コード例 #4
0
ファイル: FileSystemFTPInfo.cs プロジェクト: jokalee/Amalgam
 protected FileSystemFTPInfo(FtpClientExt ftpCmdInstance, string path)
 {
     this.path      = path;
     FtpCmdInstance = ftpCmdInstance;
 }
コード例 #5
0
ファイル: FileSystemFTPInfo.cs プロジェクト: jokalee/Amalgam
        public static List <FileSystemFTPInfo> ConvertFrom(FtpItemCollection results, FtpClientExt ftpCmdInstance)
        {
            List <FileSystemFTPInfo> _list = new List <FileSystemFTPInfo>(results.Count);

            foreach (FtpItem item in results)
            {
                FileSystemFTPInfo info = (item.ItemType == FtpItemType.Directory)
               ? (FileSystemFTPInfo) new DirectoryFTPInfo(ftpCmdInstance, item.FullPath)
               : new FileFTPInfo(ftpCmdInstance, item.FullPath);
                // Set it to be offline to allow explorer some extra time to find details before timg out.
                info.attributes = (item.ItemType == FtpItemType.Directory) ? FileAttributes.Directory : FileAttributes.Offline;
                if (item.Attributes[0] == 'l')
                {
                    info.attributes |= FileAttributes.ReparsePoint;
                }
                // drwx-
                if ((item.Attributes[1] == 'r') &&
                    (item.Attributes[2] != 'w')
                    )
                {
                    info.attributes |= FileAttributes.ReadOnly;
                }
                info.length           = item.Size;
                info.creationTimeUtc  = item.Modified;
                info.lastWriteTimeUtc = item.Modified;
                _list.Add(info);
            }
            return(_list);
        }
コード例 #6
0
 public FileFTPInfo(FtpClientExt ftpCmdInstance, string path)
     : base(ftpCmdInstance, path)
 {
 }