Package com.blackrook.small
Interface SmallConfiguration
public interface SmallConfiguration
Small Configuration class.
- Author:
- Matthew Tropiano
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if the OPTIONS HTTP method is allowed for all endpoints.boolean
Checks if the TRACE HTTP method is allowed for all endpoints.boolean
Checks if the bootstrap should attempt to configure itself to support WebSockets.boolean
Checks if Multipart requests are auto-parsed if detected as "multipart" on POST, PUT, or PATCH requests.String[]
default Object
getAttribute
(String attributeName) Fetches the value of an arbitrary attribute set that may be specific to the application.<T> T
getAttribute
(String attributeName, T def) Fetches the value of an arbitrary attribute set that may be specific to the application.Gets the port to use for secure connections.int
String[]
Provides the path to the temporary directory.
-
Method Details
-
getServerPort
int getServerPort()- Returns:
- the server port.
-
getSecureServerPort
Integer getSecureServerPort()Gets the port to use for secure connections. Can be null for no secure connections.- Returns:
- the secure server port, or null for no secure sockets.
-
getContextPath
String getContextPath()- Returns:
- the context path for the application.
-
getTempPath
String getTempPath()Provides the path to the temporary directory. If this returns null, it will defer to the context attribute"javax.servlet.context.tempdir"
, and if that isn't set, the"java.io.tmpdir"
system property is used.- Returns:
- the path for temporary files (usually multipart form files), or null.
-
getServletPaths
String[] getServletPaths()- Returns:
- the path patterns for the application's servlet entrypoint.
-
getApplicationPackageRoots
String[] getApplicationPackageRoots()- Returns:
- the list of root packages to scan.
-
allowOptions
boolean allowOptions()Checks if the OPTIONS HTTP method is allowed for all endpoints.- Returns:
- true if allowed, false if not.
-
allowTrace
boolean allowTrace()Checks if the TRACE HTTP method is allowed for all endpoints.- Returns:
- true if allowed, false if not.
-
allowWebSockets
boolean allowWebSockets()Checks if the bootstrap should attempt to configure itself to support WebSockets.- Returns:
- true if so, false if not.
-
autoParseMultipart
boolean autoParseMultipart()Checks if Multipart requests are auto-parsed if detected as "multipart" on POST, PUT, or PATCH requests.- Returns:
- true if so, false if not.
-
getAttribute
Fetches the value of an arbitrary attribute set that may be specific to the application. Returns a default value if it is not set.- Type Parameters:
T
- the return type (should be attribute type).- Parameters:
attributeName
- the attribute name.def
- the default value to return if it is not set.- Returns:
- the corresponding attribute value, or
def
if not set.
-
getAttribute
Fetches the value of an arbitrary attribute set that may be specific to the application. Returnsnull
if it is not set.- Parameters:
attributeName
- the attribute name.- Returns:
- the corresponding attribute value, or
null
if not set.
-