Beispiel #1
0
        private XrdLink GetLRDDLink(XrdDocument hostMeta)
        {
            XrdLink LRDDLink = hostMeta.Links.Where(l => l.Rel == "lrdd").FirstOrDefault();

            if (LRDDLink == null)
            {
                throw new MissingResourceException(string.Format("No 'lrdd' link found in host-meta file for host {0}.", HostName));
            }
            return(LRDDLink);
        }
Beispiel #2
0
        public XrdDocument GetAccountDocument()
        {
            XrdDocument hostMeta        = GetHostMeta();
            XrdLink     LRDDLink        = GetLRDDLink(hostMeta);
            string      emailUrl        = "acct:" + EMail;
            string      fingerUrl       = LRDDLink.Template.Replace("{uri}", HttpUtility.UrlEncode(emailUrl));
            XrdDocument accountDocument = XrdDocument.GetFromUrl(fingerUrl);

            return(accountDocument);
        }
Beispiel #3
0
        public void CanGetAndParseXrdDocument()
        {
            XrdDocument doc = XrdDocument.GetFromUrl(Utility.GetTestUri("xrdexamples/index"));

            Assert.IsNotNull(doc);

            Assert.AreEqual("testserver.xyperico.dk", doc.Subject);

            XrdProperty p1 = doc.Properties.First();

            Assert.AreEqual("http://test", p1.Type);
            Assert.AreEqual("Blah", p1.Value);

            XrdLink vCard = doc.Links.Where(l => l.Rel == "http://microformats/vCard").First();

            Assert.AreEqual("http://test/vCard", vCard.HRef);
            Assert.AreEqual("Host vCard", vCard.Title);

            XrdLink describedBy = doc.Links.Where(l => l.Rel == "lrdd").First();

            Assert.AreEqual("http://test?uri={uri}", describedBy.Template);
            Assert.AreEqual("Resource Template", describedBy.Title);
        }