public List<FileInfo> GetFiles(HostInfo host, FolderInfo directory) { var directoryInfo = GetDirectoryInfo(host, directory); if (directoryInfo.Exists) { return directoryInfo.GetFiles(directory.Filter ?? "*").ToList(); } return new List<FileInfo>(); }
public List<DirectoryInfo> GetFolders(HostInfo host, FolderInfo directory) { if (!string.IsNullOrWhiteSpace(directory.SubfolderSearchPattern)) { var directoryInfo = GetDirectoryInfo(host, directory); if (directoryInfo.Exists) { return directoryInfo.GetDirectories(directory.SubfolderSearchPattern).ToList(); } } return new List<DirectoryInfo>(); }
private string GetDirectoryPath(HostInfo host, FolderInfo directory) { return directory.Absolute ? directory.Path : GetUncDirectory(host.Unc, directory.Path); }
private DirectoryInfo GetDirectoryInfo(HostInfo host, FolderInfo directory) { string directoryPath = GetDirectoryPath(host, directory); return new DirectoryInfo(directoryPath); }
public bool Exists(HostInfo host, FolderInfo directory) { return GetDirectoryInfo(host, directory).Exists; }