public string Import() { if (!fileAccess.Exists(fileInfo)) { throw new FileNotFoundException(); } string data = fileAccess.ReadAllText(fileInfo); return(data); }
public string ReadFile(string path) { string fullPath = _hostEnv.ContentRootPath + "/Resources" + path; if (_fileAccess.Exists(fullPath)) { return(_fileAccess.ReadAllText(fullPath)); } else { throw new FileNotFoundException(); } }
public bool TryGetPreConsolidationInfo(out PreCompilationReport preCompilationReport) { if (!_fileAccess.Exists(_filePath)) { preCompilationReport = null; return(false); } preCompilationReport = new PreCompilationReport(); XDocument document; using (var reader = _fileAccess.OpenReader(_filePath)) { document = XDocument.Load(reader); } preCompilationReport.Version = (string)document.Root.Attribute("version"); preCompilationReport.Scripts = CollectResourceReport(document.Root.Element("scripts")); preCompilationReport.Stylesheets = CollectResourceReport(document.Root.Element("stylesheets")); preCompilationReport.Dependencies = CollectDependencies(document.Root.Element("dependencies")).ToList(); return(true); }
public static bool Exists(string filename, bool includesExtension) { return(_storage.Exists(GetFilenameWithExtension(filename, includesExtension))); }