Package nbbrd.io.xml
Class Sax
- java.lang.Object
-
- nbbrd.io.xml.Sax
-
public class Sax extends Object
- Author:
- Philippe Charles
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSax.Parser<T>
-
Constructor Summary
Constructors Constructor Description Sax()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static @NonNull XMLReadercreateReader()static @NonNull InputSourcenewInputSource(@NonNull File file)Creates a new InputSource from a file.static @NonNull InputSourcenewInputSource(@NonNull File file, @NonNull Charset encoding)Creates a new InputSource from a file.static voidpreventXXE(@NonNull XMLReader reader)Prevents XXE vulnerability by disabling features.static @NonNull IOExceptiontoIOException(@NonNull SAXException ex)
-
-
-
Method Detail
-
preventXXE
public static void preventXXE(@NonNull XMLReader reader)
Prevents XXE vulnerability by disabling features.- Parameters:
reader- non-null reader- See Also:
- XXE
-
createReader
public static @NonNull XMLReader createReader() throws IOException
- Throws:
IOException
-
newInputSource
public static @NonNull InputSource newInputSource(@NonNull File file)
Creates a new InputSource from a file.- Parameters:
file- a non-null file- Returns:
- a new InputSource
- See Also:
SAXParser.parse(java.io.File, org.xml.sax.helpers.DefaultHandler)
-
newInputSource
public static @NonNull InputSource newInputSource(@NonNull File file, @NonNull Charset encoding)
Creates a new InputSource from a file.- Parameters:
file- a non-null fileencoding- a non-null encoding- Returns:
- a new InputSource
- See Also:
SAXParser.parse(java.io.File, org.xml.sax.helpers.DefaultHandler)
-
toIOException
public static @NonNull IOException toIOException(@NonNull SAXException ex)
-
-