Package org.owasp.validator.html
Class AntiSamy
- java.lang.Object
-
- org.owasp.validator.html.AntiSamy
-
public class AntiSamy extends java.lang.Object
This is the only class from which the outside world should be calling. Thescan()
method holds the meat and potatoes of AntiSamy. The file contains a number of ways forscan()
'ing depending on the accessibility of the policy file.- Author:
- Arshan Dabirsiaghi
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CleanResults
scan(java.lang.String taintedHTML)
The meat and potatoes.CleanResults
scan(java.lang.String taintedHTML, int scanType)
CleanResults
scan(java.lang.String taintedHTML, java.io.File policyFile)
This method wrapsscan()
using the policy File object passed in.CleanResults
scan(java.lang.String taintedHTML, java.lang.String filename)
This method wrapsscan()
using the Policy object passed in.CleanResults
scan(java.lang.String taintedHTML, Policy policy)
This method wrapsscan()
using the Policy object passed in.CleanResults
scan(java.lang.String taintedHTML, Policy policy, int scanType)
-
-
-
Constructor Detail
-
AntiSamy
public AntiSamy()
-
AntiSamy
public AntiSamy(Policy policy)
-
-
Method Detail
-
scan
public CleanResults scan(java.lang.String taintedHTML) throws ScanException, PolicyException
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
public CleanResults scan(java.lang.String taintedHTML, int scanType) throws ScanException, PolicyException
- Throws:
ScanException
PolicyException
-
scan
public CleanResults scan(java.lang.String taintedHTML, Policy policy) throws ScanException, PolicyException
This method wrapsscan()
using the Policy object passed in.- Throws:
ScanException
PolicyException
-
scan
public CleanResults scan(java.lang.String taintedHTML, Policy policy, int scanType) throws ScanException, PolicyException
- Throws:
ScanException
PolicyException
-
scan
public CleanResults scan(java.lang.String taintedHTML, java.lang.String filename) throws ScanException, PolicyException
This method wrapsscan()
using the Policy object passed in.- Throws:
ScanException
PolicyException
-
scan
public CleanResults scan(java.lang.String taintedHTML, java.io.File policyFile) throws ScanException, PolicyException
This method wrapsscan()
using the policy File object passed in.- Throws:
ScanException
PolicyException
-
-