Ejemplo n.º 1
0
        public static FtpObjectInfo ToFtpObjectInfo(this FtpListItem ftpListItem)
        {
            FtpObjectInfo ftpObjectInfo = new FtpObjectInfo();

            ftpObjectInfo.FullName          = ftpListItem.FullName;
            ftpObjectInfo.Name              = ftpListItem.Name;
            ftpObjectInfo.Size              = ftpListItem.Size;
            ftpObjectInfo.Created           = ftpListItem.Created;
            ftpObjectInfo.Modified          = ftpListItem.Modified;
            ftpObjectInfo.Type              = ftpListItem.Type.ToFtpObjectType();
            ftpObjectInfo.GroupPermissions  = ftpListItem.GroupPermissions.ToFtpPermissions();
            ftpObjectInfo.OthersPermissions = ftpListItem.OthersPermissions.ToFtpPermissions();
            ftpObjectInfo.OwnerPermissions  = ftpListItem.OwnerPermissions.ToFtpPermissions();

            return(ftpObjectInfo);
        }
Ejemplo n.º 2
0
        public static FtpObjectInfo ToFtpObjectInfo(this SftpFile sftpFile)
        {
            FtpObjectInfo ftpObjectInfo = new FtpObjectInfo();

            ftpObjectInfo.FullName          = sftpFile.FullName;
            ftpObjectInfo.Name              = sftpFile.Name;
            ftpObjectInfo.Size              = sftpFile.Length;
            ftpObjectInfo.Created           = DateTime.MinValue;
            ftpObjectInfo.Modified          = sftpFile.LastWriteTimeUtc;
            ftpObjectInfo.Type              = sftpFile.GetFtpObjectType();
            ftpObjectInfo.GroupPermissions  = ToFtpPermissions(sftpFile.GroupCanExecute, sftpFile.GroupCanWrite, sftpFile.GroupCanRead);
            ftpObjectInfo.OthersPermissions = ToFtpPermissions(sftpFile.OthersCanExecute, sftpFile.OthersCanWrite, sftpFile.OthersCanRead);
            ftpObjectInfo.OwnerPermissions  = ToFtpPermissions(sftpFile.OwnerCanExecute, sftpFile.OwnerCanWrite, sftpFile.OwnerCanRead);

            return(ftpObjectInfo);
        }