CodeLiturgy.Dashboard/CodeLiturgy.Views/Augeas/AugeasManager.cs

35 lines
902 B
C#

using Sharp.Augeas;
namespace CodeLiturgy.Views.Augeas
{
public class AugeasManager
{
private readonly Sharp.Augeas.Augeas _augeas;
private AugSettings _augSettings;
public AugeasManager()
{
_augeas = new Sharp.Augeas.Augeas(AugeasExtensions.GetSettings());
}
public string GetPreview()
{
var preview = _augeas.GetPreview("/files/etc/apache2/sites-available/example.com.conf");
return preview;
}
public List<string> GetApacheAvailableConfigurations()
{
DirectoryInfo d = new DirectoryInfo(_augSettings.); //Assuming Test is your Folder
FileInfo[] Files = d.GetFiles("*.txt"); //Getting Text files
string str = "";
foreach(FileInfo file in Files )
{
str = str + ", " +
}
}
}