public StringBuilder Execute(Dictionary<string, StringBuilder> values, IWorkspace theWorkspace)
{
try
{
string directory = null;
StringBuilder result = new StringBuilder();
if(values == null)
{
throw new InvalidDataContractException("No parameter values provided.");
}
StringBuilder tmp;
values.TryGetValue("Directory", out tmp);
if(tmp != null)
{
directory = tmp.ToString();
}
if(String.IsNullOrEmpty(directory))
{
throw new InvalidDataContractException("No value provided for Directory parameter.");
}
Dev2Logger.Log.Info("Get Directories Relative to Server. "+directory);
result.Append("<JSON>");
var explorerItem = ServerExplorerRepo.Load(ResourceType.Folder, string.Empty);
var jsonTreeNode = new JsonTreeNode(explorerItem);
var serializer = new Dev2JsonSerializer();
var directoryInfoAsJson = serializer.Serialize(jsonTreeNode);
result.Append(directoryInfoAsJson);
result.Append("</JSON>");
return result;
}
catch (Exception e)
{
Dev2Logger.Log.Error(e);
throw;
}
}