public static FTPFile CreateFromPath(string path, int accountId) { FTPFile file = new FTPFile(accountId); file.fullName = path; file.name = PathExt.GetName(path); return(file); }
public static FTPFile CreateFromServerCall(edtFTPFile fileInfo, string baseDir, int accountId) { var file = new FTPFile(accountId); file.LastModifiedTime = fileInfo.LastModified; file.IsDirectory = fileInfo.Dir; file.Size = FileSize.CreateFromBytes(fileInfo.Size); file.name = fileInfo.Name; file.fullName = PathExt.Combine(baseDir, fileInfo.Name, false); return(file); }
public static FTPFile CreateFromServerCall(edtFTPFile fileInfo, string baseDir, int accountId) { var file = new FTPFile(accountId); file.LastModifiedTime = fileInfo.LastModified; file.IsDirectory = fileInfo.Dir; file.Size = FileSize.CreateFromBytes(fileInfo.Size); file.name = fileInfo.Name; file.fullName = PathExt.Combine(baseDir, fileInfo.Name, false); return file; }
public static FTPFile CreateFromPath(string path, int accountId) { FTPFile file = new FTPFile(accountId); file.fullName = path; file.name = PathExt.GetName(path); return file; }
public override IEnumerable <IDirectoryViewItem> GetDirectoryContent(string dirPath) { var content = new List <IDirectoryViewItem>(); if (!IsRootPath(dirPath)) { content.Add(new MoveUpObject()); } var infos = connection.GetFileInfos(dirPath); var ftpFiles = infos.Where(x => x.Name != "." && x.Name != "..").Select(x => FTPFile.CreateFromServerCall(x, dirPath, account.Id)).OrderByDescending(x => x.IsDirectory); content.AddRange(ftpFiles); connection.ChangeWorkingDirectory(dirPath); return(content); }
public void Download(FTPFile file, string destination) { connection.DownloadFile(destination, file.Name); }
public override void LoadDirectory(string dirPath) { Items.Clear(); Items.AddRange(GetDirectoryContent(dirPath)); CurrentPlace = FTPFile.CreateFromPath(dirPath, account.Id); }