Class StaticResourceBinding
java.lang.Object
com.persequor.extension.staticresource.StaticResourceBinding
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a HTTP header to the response when serving this static resourceReturns the HTTP headers to be added to the response when serving this static resource, including any headers added by the system by default, except for the Content-Type headervoid
overrideHeader
(String headerName, String headerValue) Overrides a HTTP header to the response when serving this static resourcevoid
Specifies the root directory in which the resources are stored.void
validate()
-
Field Details
-
rootURI
-
-
Constructor Details
-
StaticResourceBinding
-
-
Method Details
-
to
Specifies the root directory in which the resources are stored. NB! Resource folder is not just a folder on the disk, but a Java resource folder which would normally reside inside the jar file, read more here: https://docs.oracle.com/javase/8/docs/technotes/guides/lang/resources.html#res_name_contextMust be prefixed with '/'.
- Parameters:
resourceDirectoryRoot
- - root directory bound to the URI prefix
-
getResourceDirectoryRoot
-
getRootURI
-
validate
public void validate() -
addHeader
Adds a HTTP header to the response when serving this static resourceIf the header already exists, the value will be appended to the existing value
- Parameters:
headerName
- the name of the HTTP headerheaderValue
- the value of the HTTP header
-
overrideHeader
Overrides a HTTP header to the response when serving this static resourceIf the header already exists, the value will be replaced
If the header does not exist, it will be added
- Parameters:
headerName
- the name of the HTTP headerheaderValue
- the value of the HTTP header
-
getHeaders
Returns the HTTP headers to be added to the response when serving this static resource, including any headers added by the system by default, except for the Content-Type header- Returns:
- an unmodifiable map of HTTP headers
-