|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.rssowl.util.shop.XMLShop
Factory class for XML concerns in RSSOwl
Field Summary | |
static String |
DOCTYPE_HTML_TRANSITIONAL
Doctype for the generated HTML |
static String |
NULL_DTD
A DTD URI to use for a non existing DTD |
private static String[] |
stripDoubleTags
Some HTML tags do strip (doubles) |
private static String[] |
stripSingleTags
Some HTML tags do strip (singles) |
Constructor Summary | |
private |
XMLShop()
This utility class constructor is hidden |
Method Summary | |
private static String |
getEncodingFromXML(InputStreamReader inputReader)
This Method will read the first line of the given Reader and try to read out the Encoding. |
private static String |
getTitleFromFeed(BufferedReader inputReader)
Get the title from an InputStream. |
static String |
getTitleFromFeed(String url)
Try to grab the title from the given feed |
static org.jdom.Document |
getXMLDocument(String url)
Retrieve the parsed XML document from a URL / Path |
private static org.jdom.output.Format |
getXMLFormat()
Create a Format to use with the XMLOutputter |
static InputStream |
getXMLStream(String url)
Method to get the contents of XML as InputStream |
static boolean |
isEncodingSupported(String encoding)
Check if the given Encoding is known to Apache Xerces XML Parser |
static boolean |
isValidUserXML(org.jdom.Document document)
Check if the given document is a valid "user.xml" |
static boolean |
isValidUserXML(InputStream inputStream)
Check if the file at the given inputstream is a valid "user.xml" |
static boolean |
isValidUserXML(String path)
Check if the file at the given path is a valid "user.xml" |
private static String |
parseString(String str)
Parse a String as XML to have possible entities resolved. |
static void |
setDefaultEntityResolver(org.jdom.input.SAXBuilder builder)
Ignore the DTD of the XML and set the default DTD "entities.dtd" that provides common entities taken from the HTML 4.01 Spec (W3C). |
static String |
stripSimpleHTMLTags(String text)
Strip some HTML tags from the given text. |
static void |
writeXML(org.jdom.Document document,
File file)
Write the document as XML file to the given path |
static void |
writeXML(org.jdom.Document document,
String filePath)
Write the document as XML file to the given path |
static void |
writeXML(org.jdom.Document document,
String filePath,
boolean deleteOnExit)
Write the document as XML file to the given path |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String DOCTYPE_HTML_TRANSITIONAL
public static final String NULL_DTD
private static String[] stripDoubleTags
private static String[] stripSingleTags
Constructor Detail |
private XMLShop()
Method Detail |
public static String getTitleFromFeed(String url) throws IOException
url
- Url to the RSS or RDF feed
IOException
- if an error occurspublic static org.jdom.Document getXMLDocument(String url) throws org.jdom.JDOMException, IOException, NewsfeedFactoryException, IllegalArgumentException
url
- The URL / Path to the XML
org.jdom.JDOMException
- If an error occurs
IOException
- If an error occurs
NewsfeedFactoryException
- If an error occurs
IllegalArgumentException
- If an error occurspublic static InputStream getXMLStream(String url)
url
- Url / Path to the XML
public static boolean isEncodingSupported(String encoding)
encoding
- The encoding name as String
public static boolean isValidUserXML(org.jdom.Document document)
document
- The document to check for valid user xml
public static boolean isValidUserXML(InputStream inputStream)
inputStream
- InputStream holding the contents of the XML
public static boolean isValidUserXML(String path)
path
- Path to the import file
public static void setDefaultEntityResolver(org.jdom.input.SAXBuilder builder)
builder
- The builder to set the default Entityresolverpublic static String stripSimpleHTMLTags(String text)
text
- The text to strip the HTML tags from
public static void writeXML(org.jdom.Document document, File file)
document
- The XML Documentfile
- The file where to write the XML contentspublic static void writeXML(org.jdom.Document document, String filePath)
document
- The XML DocumentfilePath
- The file where to write the XML contentspublic static void writeXML(org.jdom.Document document, String filePath, boolean deleteOnExit)
document
- The XML DocumentfilePath
- The file where to write the XML contentsdeleteOnExit
- If TRUE, delete the XML on exitprivate static String getEncodingFromXML(InputStreamReader inputReader) throws IOException
inputReader
- The Reader that should have a XML as content.
IOException
- In case of an Error.private static String getTitleFromFeed(BufferedReader inputReader) throws IOException
inputReader
- A BufferedReader for the input
IOException
- if an error occursprivate static org.jdom.output.Format getXMLFormat()
private static String parseString(String str)
str
- The String to parse
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |