Modifier and Type | Field and Description |
---|---|
protected static String |
DEFAULT_ACCEPT_TYPE |
protected static String |
externalStaticFileFolder |
protected static boolean |
initialized |
protected static String |
ipAddress |
protected static String |
keystoreFile |
protected static String |
keystorePassword |
protected static int |
port |
protected static SimpleRouteMatcher |
routeMatcher |
protected static SparkServer |
server |
static int |
SPARK_DEFAULT_PORT |
protected static String |
staticFileFolder |
protected static String |
truststoreFile |
protected static String |
truststorePassword |
Constructor and Description |
---|
SparkBase() |
Modifier and Type | Method and Description |
---|---|
protected static void |
addFilter(String httpMethod,
FilterImpl filter) |
protected static void |
addRoute(String httpMethod,
RouteImpl route) |
static void |
externalStaticFileLocation(String externalFolder)
Sets the external folder serving static files.
|
static void |
ipAddress(String ipAddress)
Set the IP address that Spark should listen on.
|
static void |
port(int port)
Set the port that Spark should listen on.
|
static void |
secure(String keystoreFile,
String keystorePassword,
String truststoreFile,
String truststorePassword)
Set the connection to be secure, using the specified keystore and
truststore.
|
static void |
setIpAddress(String ipAddress)
Deprecated.
replaced by
ipAddress(String) |
static void |
setPort(int port)
Deprecated.
replaced by
port(int) |
static void |
setSecure(String keystoreFile,
String keystorePassword,
String truststoreFile,
String truststorePassword)
Deprecated.
replaced by
secure(String, String, String, String) |
static void |
staticFileLocation(String folder)
Sets the folder in classpath serving static files.
|
static void |
stop()
Stops the Spark server and clears all routes
|
protected static FilterImpl |
wrap(String path,
Filter filter)
Wraps the filter in FilterImpl
|
protected static RouteImpl |
wrap(String path,
Route route)
Wraps the route in RouteImpl
|
protected static FilterImpl |
wrap(String path,
String acceptType,
Filter filter)
Wraps the filter in FilterImpl
|
protected static RouteImpl |
wrap(String path,
String acceptType,
Route route)
Wraps the route in RouteImpl
|
public static final int SPARK_DEFAULT_PORT
protected static final String DEFAULT_ACCEPT_TYPE
protected static boolean initialized
protected static int port
protected static String ipAddress
protected static String keystoreFile
protected static String keystorePassword
protected static String truststoreFile
protected static String truststorePassword
protected static String staticFileFolder
protected static String externalStaticFileFolder
protected static SparkServer server
protected static SimpleRouteMatcher routeMatcher
public static void setIpAddress(String ipAddress)
ipAddress(String)
ipAddress
- The ipAddresspublic static void ipAddress(String ipAddress)
ipAddress
- The ipAddresspublic static void setPort(int port)
port(int)
port
- The port numberpublic static void port(int port)
port
- The port numberpublic static void setSecure(String keystoreFile, String keystorePassword, String truststoreFile, String truststorePassword)
secure(String, String, String, String)
keystoreFile
- The keystore file location as stringkeystorePassword
- the password for the keystoretruststoreFile
- the truststore file location as string, leave null to reuse
keystoretruststorePassword
- the trust store passwordpublic static void secure(String keystoreFile, String keystorePassword, String truststoreFile, String truststorePassword)
keystoreFile
- The keystore file location as stringkeystorePassword
- the password for the keystoretruststoreFile
- the truststore file location as string, leave null to reuse
keystoretruststorePassword
- the trust store passwordpublic static void staticFileLocation(String folder)
folder
- the folder in classpath.public static void externalStaticFileLocation(String externalFolder)
externalFolder
- the external folder serving static files.public static void stop()
protected static RouteImpl wrap(String path, Route route)
path
- the pathroute
- the routeprotected static RouteImpl wrap(String path, String acceptType, Route route)
path
- the pathacceptType
- the accept typeroute
- the routeprotected static FilterImpl wrap(String path, Filter filter)
path
- the pathfilter
- the filterprotected static FilterImpl wrap(String path, String acceptType, Filter filter)
path
- the pathacceptType
- the accept typefilter
- the filterprotected static void addFilter(String httpMethod, FilterImpl filter)
Copyright © 2014. All rights reserved.