Example #1
0
        private static string ContentOf(AbsoluteDirectoryPath workingDirectory)
        {
            try
            {
                if (!workingDirectory.Exists())
                {
                    return($"Directory {workingDirectory} does not exist");
                }
                else
                {
                    var stringWithAllDirectoryEntries = new StringBuilder();
                    foreach (var entry in workingDirectory.EnumerateFileSystemEntries())
                    {
                        stringWithAllDirectoryEntries.AppendLine(entry.ToString());
                    }

                    return(stringWithAllDirectoryEntries.ToString());
                }
            }
            catch (Exception e)
            {
                return(e.ToString());
            }
        }