/// <summary>
 /// Does some basic checks on the given folder to make sure it exists and is writable.
 /// </summary>
 /// <param name="folder"></param>
 private void CheckFolder(string folder)
 {
     if (fileController.DirectoryExists(folder) == false)
     {
         fileController.CreateDirectory(folder);
     }
     if (fileController.CanCreateFilesIn(folder) == false)
     {
         throw new IOException("Functions folder is not writeable");
     }
 }
        public virtual OutputFolder LoadOutputsFile(string folder)
        {
            string outputsFilePath = folder.PathSlash(ProjectSerialiserV1.OutputsFileName);

            if (controller.DirectoryExists(folder) == false)
            {
                throw new DirectoryNotFoundException(string.Format("Could not find Outputs folder at path {0}", folder));
            }
            if (controller.FileExists(outputsFilePath) == false)
            {
                throw new FileNotFoundException(string.Format("Could not find Outputs file at path {0}", outputsFilePath));
            }
            if (controller.CanReadFile(outputsFilePath) == false)
            {
                throw new IOException(string.Format("Cannot read from file {0}: Access Denied.", outputsFilePath));
            }

            string outputsFileXML = controller.ReadAllText(outputsFilePath);

            return(ReadOutputs(outputsFileXML.GetXmlDocRoot()));
        }