|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.rssowl.util.shop.XMLShop
public class XMLShop
Factory class for XML concerns in RSSOwl
| Field Summary | |
|---|---|
static java.lang.String |
ALLOW_JAVA_ENCODING
Feature in Xerces to allow Java Encoding Names |
static java.lang.String |
DOCTYPE_HTML_TRANSITIONAL
Doctype for the generated HTML |
static java.lang.String |
NULL_DTD
A DTD URI to use for a non existing DTD |
private static java.lang.String[] |
stripDoubleTags
Some HTML tags do strip (doubles) |
private static java.lang.String[] |
stripSingleTags
Some HTML tags do strip (singles) |
| Constructor Summary | |
|---|---|
private |
XMLShop()
This utility class constructor is hidden |
| Method Summary | |
|---|---|
private static java.lang.String |
getEncodingFromXML(java.io.InputStreamReader inputReader)
This Method will read the first line of the given Reader and try to read out the Encoding. |
private static java.lang.String |
getTitleFromFeed(java.io.BufferedReader inputReader)
Get the title from an InputStream. |
static java.lang.String |
getTitleFromFeed(java.lang.String url,
boolean useProxy)
Try to grab the title from the given feed |
private static org.jdom.output.Format |
getXMLFormat()
Create a Format to use with the XMLOutputter |
static java.io.InputStream |
getXMLStream(java.lang.String url)
Method to get the contents of XML as InputStream |
static boolean |
isEncodingSupported(java.lang.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(java.io.InputStream inputStream)
Check if the file at the given inputstream is a valid "user.xml" |
static boolean |
isValidUserXML(java.lang.String path)
Check if the file at the given path is a valid "user.xml" |
private static java.lang.String |
parseString(java.lang.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 java.lang.String |
stripSimpleHTMLTags(java.lang.String text)
Strip some HTML tags from the given text. |
static void |
writeXML(org.jdom.Document document,
java.io.File file)
Write the document as XML file to the given path |
static void |
writeXML(org.jdom.Document document,
java.lang.String filePath)
Write the document as XML file to the given path |
static void |
writeXML(org.jdom.Document document,
java.lang.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 java.lang.String DOCTYPE_HTML_TRANSITIONAL
public static final java.lang.String NULL_DTD
public static final java.lang.String ALLOW_JAVA_ENCODING
private static java.lang.String[] stripDoubleTags
private static java.lang.String[] stripSingleTags
| Constructor Detail |
|---|
private XMLShop()
| Method Detail |
|---|
public static java.lang.String getTitleFromFeed(java.lang.String url,
boolean useProxy)
throws java.io.IOException
url - Url to the RSS or RDF feeduseProxy - Flag indicating wether a proxy should be used to lookup the
title
java.io.IOException - if an error occurspublic static java.io.InputStream getXMLStream(java.lang.String url)
url - Url / Path to the XML
public static boolean isEncodingSupported(java.lang.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(java.io.InputStream inputStream)
inputStream - InputStream holding the contents of the XML
public static boolean isValidUserXML(java.lang.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 java.lang.String stripSimpleHTMLTags(java.lang.String text)
text - The text to strip the HTML tags from
public static void writeXML(org.jdom.Document document,
java.io.File file)
document - The XML Documentfile - The file where to write the XML contents
public static void writeXML(org.jdom.Document document,
java.lang.String filePath)
document - The XML DocumentfilePath - The file where to write the XML contents
public static void writeXML(org.jdom.Document document,
java.lang.String filePath,
boolean deleteOnExit)
document - The XML DocumentfilePath - The file where to write the XML contentsdeleteOnExit - If TRUE, delete the XML on exit
private static java.lang.String getEncodingFromXML(java.io.InputStreamReader inputReader)
throws java.io.IOException
inputReader - The Reader that should have a XML as content.
java.io.IOException - In case of an Error.
private static java.lang.String getTitleFromFeed(java.io.BufferedReader inputReader)
throws java.io.IOException
inputReader - A BufferedReader for the input
java.io.IOException - if an error occursprivate static org.jdom.output.Format getXMLFormat()
private static java.lang.String parseString(java.lang.String str)
str - The String to parse
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||