summaryrefslogtreecommitdiff
path: root/src/instrumentationTest/de/test/antennapod/util/syndication/feedgenerator/GeneratorUtil.java
blob: d8bef235424c75789db4106daf1c1f108c5cc4f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package instrumentationTest.de.test.antennapod.util.syndication.feedgenerator;

import org.xmlpull.v1.XmlSerializer;

import java.io.IOException;

/**
 * Utility methods for FeedGenerator
 */
public class GeneratorUtil {

    public static void addPaymentLink(XmlSerializer xml, String paymentLink, boolean withNamespace) throws IOException {
        String ns = (withNamespace) ? "http://www.w3.org/2005/Atom" : null;
        xml.startTag(ns, "link");
        xml.attribute(null, "rel", "payment");
        xml.attribute(null, "title", "Flattr this!");
        xml.attribute(null, "href", paymentLink);
        xml.attribute(null, "type", "text/html");
        xml.endTag(ns, "link");
    }
}