Package org.owasp.validator.html
Class AntiSamy
java.lang.Object
org.owasp.validator.html.AntiSamy
This is the only class from which the outside world should be calling. The
scan()
method holds the meat and potatoes of AntiSamy. The file
contains a number of ways for scan()
'ing depending on the
accessibility of the policy file.- Author:
- Arshan Dabirsiaghi
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe meat and potatoes.This method wrapsscan()
using the policy File object passed in.This method wrapsscan()
using the Policy object passed in.This method wrapsscan()
using the Policy object passed in.
-
Field Details
-
DOM
public static int DOM -
SAX
public static int SAX
-
-
Constructor Details
-
AntiSamy
public AntiSamy() -
AntiSamy
-
-
Method Details
-
scan
The meat and potatoes. Thescan()
family of methods are the only methods the outside world should be calling to invoke AntiSamy.- Parameters:
taintedHTML
- Untrusted HTML which may contain malicious code.- Returns:
- A
CleanResults
object which contains information about the scan (including the results). - Throws:
ScanException
- When there is a problem encountered while scanning the HTML.PolicyException
- When there is a problem reading the policy file.
-
scan
- Throws:
ScanException
PolicyException
-
scan
This method wrapsscan()
using the Policy object passed in.- Throws:
ScanException
PolicyException
-
scan
public CleanResults scan(String taintedHTML, Policy policy, int scanType) throws ScanException, PolicyException - Throws:
ScanException
PolicyException
-
scan
This method wrapsscan()
using the Policy object passed in.- Throws:
ScanException
PolicyException
-
scan
This method wrapsscan()
using the policy File object passed in.- Throws:
ScanException
PolicyException
-