Package org.trellisldp.dropwizard.config
Class CORSConfiguration
- java.lang.Object
-
- org.trellisldp.dropwizard.config.CORSConfiguration
-
public class CORSConfiguration extends Object
Configuration for CORS headers.
-
-
Constructor Summary
Constructors Constructor Description CORSConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
getAllowCredentials()
Get the value of Allow-Credentials.List<String>
getAllowHeaders()
Get a list of allowed headers.List<String>
getAllowMethods()
Get a list of allowed methods.List<String>
getAllowOrigin()
Get a list of allowed origins.boolean
getEnabled()
Get whether CORS has been enabled.List<String>
getExposeHeaders()
Get a list of exposed headers.int
getMaxAge()
Get the Max-Age header.void
setAllowCredentials(boolean allowCredentials)
Control whether Allow-Credentials should be displayed.void
setAllowHeaders(List<String> headers)
Set the allowed headers.void
setAllowMethods(List<String> methods)
Set the allowed methods.void
setAllowOrigin(List<String> origins)
Set the allowed origins.void
setEnabled(boolean enabled)
Enable or disable CORS.void
setExposeHeaders(List<String> headers)
Set the exposed headers.void
setMaxAge(int maxAge)
Set the Max-Age header.
-
-
-
Method Detail
-
getEnabled
public boolean getEnabled()
Get whether CORS has been enabled.- Returns:
- true if CORS is enabled; false otherwise
-
setEnabled
public void setEnabled(boolean enabled)
Enable or disable CORS.- Parameters:
enabled
- true if CORS is enabled; false otherwise
-
getAllowOrigin
public List<String> getAllowOrigin()
Get a list of allowed origins.- Returns:
- the Allow-Origin values
-
setAllowOrigin
public void setAllowOrigin(List<String> origins)
Set the allowed origins.- Parameters:
origins
- the origins
-
getAllowMethods
public List<String> getAllowMethods()
Get a list of allowed methods.- Returns:
- the Allow-Methods values
-
setAllowMethods
public void setAllowMethods(List<String> methods)
Set the allowed methods.- Parameters:
methods
- the methods
-
getAllowHeaders
public List<String> getAllowHeaders()
Get a list of allowed headers.- Returns:
- the Allow-Headers values
-
setAllowHeaders
public void setAllowHeaders(List<String> headers)
Set the allowed headers.- Parameters:
headers
- the allowed headers
-
getExposeHeaders
public List<String> getExposeHeaders()
Get a list of exposed headers.- Returns:
- the Expose-Header values
-
setExposeHeaders
public void setExposeHeaders(List<String> headers)
Set the exposed headers.- Parameters:
headers
- the exposed headers
-
getMaxAge
public int getMaxAge()
Get the Max-Age header.- Returns:
- the Max-Age header
-
setMaxAge
public void setMaxAge(int maxAge)
Set the Max-Age header.- Parameters:
maxAge
- the max age
-
getAllowCredentials
public boolean getAllowCredentials()
Get the value of Allow-Credentials.- Returns:
- true if Allow-Credentials is set; false otherwise
-
setAllowCredentials
public void setAllowCredentials(boolean allowCredentials)
Control whether Allow-Credentials should be displayed.- Parameters:
allowCredentials
- true if Allow-Credentials should be included; false otherwise
-
-