1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
URL feedUrl = new URL("http://localhost:8080/uPortal/atomU2.xml");
File feedToFile = new File(feedUrl.toURI());
//construit un flux à partir de l'URL
WireFeedInput input = new WireFeedInput();
WireFeed feed = input.build(new XmlReader(feedToFile));
//construit un flux de type atom
Feed feedAtom = new Feed("atom_1.0");
//clone le flux WireFeed en Feed(atom)
feedAtom = (Feed) feed.clone();
List<Entry> listInEntry = feedAtom.getEntries();
listInEntry.add(entry);
feedAtom.setEntries(listInEntry);
WireFeedOutput output = new WireFeedOutput();
output.output(feedAtom,feedToFile); |