BloomTests.Publish.ExportEpubTests.GetManifestFile C# (CSharp) Method

GetManifestFile() private method

private GetManifestFile ( ZipFile zip ) : string
zip ICSharpCode.SharpZipLib.Zip.ZipFile
return string
        private string GetManifestFile(ZipFile zip)
        {
            // Every ePUB must have a mimetype at the root
            GetZipContent(zip, "mimetype");

            // Every ePUB must have a "META-INF/container.xml." (case matters). Most things we could check about its content
            // would be redundant with the code that produces it, but we can at least verify that it is valid
            // XML and extract the manifest data.
            var containerData = GetZipContent(zip, "META-INF/container.xml");
            var doc = XDocument.Parse(containerData);
            XNamespace ns = doc.Root.Attribute("xmlns").Value;
            return doc.Root.Element(ns + "rootfiles").Element(ns + "rootfile").Attribute("full-path").Value;
        }