## org.autoplot.servlet.ServletUtil

Utilities for the servlets

## ServletUtil( )

## checkSecurity

checkSecurity( HttpServletResponse response, String id, String suri, String vap ) → org.autoplot.servlet.ServletUtil.SecurityResponse

This checks the whitelist for the URI, and also inserts headers into the response.

### Parameters

response - a HttpServletResponse
id - null or the id, which is mapped to a URI.
suri - null or the uri.
vap - null or the vap

### Returns:

true if the URI is whitelisted
[search for examples] [view on GitHub] [view on old javadoc]

## dumpWhitelistToLogger

dumpWhitelistToLogger( java.util.logging.Level level ) → void

dump the whitelist to the logger at the given level.

### Parameters

level - the level to log at.

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc]

## getBlackList

getBlackList( ) → java.util.List

return the blacklist, checking no more than once per 5 seconds, and creating the default file if one is not found. See HOME/autoplot_data/server/blacklist.txt

### Returns:

list of regular expressions to allow.
[search for examples] [view on GitHub] [view on old javadoc]

## getIdMap

getIdMap( ) → java.util.Map

return the id map, checking no more than once per 5 seconds, and creating an empty file if one is not found. See HOME/autoplot_data/server/

### Returns:

map from one string to another.
[search for examples] [view on GitHub] [view on old javadoc]
getIntParameter( HttpServletRequest request, String name, int dval ) → int [view source]

## getServletContact

getServletContact( ) → String

return the contact info for the server

### Returns:

a String
[search for examples] [view on GitHub] [view on old javadoc]
getServletHome( ) → java.io.File [view source]
getStringParameter( HttpServletRequest request, String name, String dval ) → String [view source]

## getWhiteList

getWhiteList( ) → java.util.List

return the whitelist, checking no more than once per 5 seconds, and creating the default file if one is not found. See HOME/autoplot_data/server/whitelist.txt

### Returns:

list of regular expressions to allow.
[search for examples] [view on GitHub] [view on old javadoc]

## isBlacklisted

isBlacklisted( String suri ) → boolean

return true if the suri is blacklisted, meaning we do not trust that scripts and other content from from this address could harm the server.

### Parameters

suri - the uri.

### Returns:

true if the suri is blacklisted.
[search for examples] [view on GitHub] [view on old javadoc]

## isWhitelisted

isWhitelisted( String suri ) → boolean

return true if the suri is whitelisted, meaning we trust that scripts and other content from from this address will not harm the server. This also checks the blacklist, and if the item is in the blacklist, then it will not be whitelisted.

### Parameters

suri - the uri.

### Returns:

true if the suri is whitelisted.
[search for examples] [view on GitHub] [view on old javadoc]

## securityCheckPart2

securityCheckPart2( org.autoplot.servlet.ServletUtil.SecurityResponse sr ) → void

this is the part that throws the exception if security violation occurs.

### Parameters

sr - a ServletUtil.SecurityResponse

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc]