Package org.pathvisio.libgpml.util
Class RootElementFinder
java.lang.Object
org.pathvisio.libgpml.util.RootElementFinder
public class RootElementFinder
extends java.lang.Object
This is similar to com.sun.xml.internal.ws.message.RootElementSniffer,
perhaps can be re-used.
- Author:
- unknown
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
RootElementFinder.RootElementHandler
Root element handler class. -
Constructor Summary
Constructors Constructor Description RootElementFinder()
-
Method Summary
Modifier and Type Method Description static java.lang.String
getRootUri(java.io.File file)
Returns root URI.private static java.io.Reader
inputStreamToReader(java.io.InputStream xin)
Special reader that works around problem with UTF-BOMprivate static RootElementFinder.RootElementHandler
parse(java.io.File file)
Handles root element.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
RootElementFinder
public RootElementFinder()
-
-
Method Details
-
inputStreamToReader
private static java.io.Reader inputStreamToReader(java.io.InputStream xin) throws java.io.IOExceptionSpecial reader that works around problem with UTF-BOM- Parameters:
xin
-- Returns:
- Throws:
java.io.IOException
-
parse
private static RootElementFinder.RootElementHandler parse(java.io.File file) throws java.io.FileNotFoundException, java.io.IOException, org.xml.sax.SAXExceptionHandles root element.- Parameters:
file
-- Returns:
- Throws:
java.io.FileNotFoundException
java.io.IOException
org.xml.sax.SAXException
-
getRootUri
public static java.lang.String getRootUri(java.io.File file) throws org.xml.sax.SAXException, java.io.FileNotFoundException, java.io.IOExceptionReturns root URI.- Parameters:
file
-- Returns:
- Throws:
org.xml.sax.SAXException
java.io.FileNotFoundException
java.io.IOException
-