Requirements
- A Java Runtime (version 5 or above).
- An application to make use of the library.
Usage
- Add the atomsphere-<version>.jar to the java classpath.
- For a maven project, add the atomsphere library as a maven dependency to your project.
<dependency>
<groupId>com.colorfulsoftware</groupId>
<artifactId>atomsphere</artifactId>
<version>3.0.1</version>
</dependency>
Highlights
- Atomsphere is designed to be easy-to-use for solving Atom feed issues quickly.
- It comes with an intuitive, developer-friendly API.
- All objects in the library are serializable, immutable and thread-safe.
- Fully tested for accuracy (See the distributed test-sources.jar for reference).
- Minimal dependencies. Atomsphere only requires a stax-api implementation to work.
- In the spirit of Open Source Software, Atomsphere is licensed with the terms of the Apache License, Version 2.0.
Examples
- Read a file from disk into a Feed bean.
Feed myFeed = new FeedDoc().readFeedToBean(new File("/myPath/myFeed.xml"); - Read a file from the web into a Feed bean.
Feed myFeed = new FeedDoc().readFeedToBean(new URL("http://www.abcdefg.net/myFeed.xml"); - Read a Feed bean into a String.
String myFeedStr = myFeed.toString(); - Read a Feed bean into a formatted String.
String myFeedStr = new FeedDoc().readFeedToString(myFeed, "javanet.staxutils.IndentingXMLStreamWriter"); - Write a Feed bean to disk.
new FeedDoc().writeFeedDoc(new File("/somewhere/myFeed.xml"), myFeed, "UTF-8", "1.0"); - Write a formatted Feed bean to disk.
new FeedDoc().writeFeedDoc(new javanet.staxutils.IndentingXMLStreamWriter( XMLOutputFactory.newInstance().createXMLStreamWriter( new FileOutputStream("/somewhere/myFeed.xml"), "UTF-8")), myFeed, "UTF-8", "1.0");
See Also
- Visit the sister project RSSpect for using RSS 2.0 feeds.