aboutsummaryrefslogtreecommitdiffstats
path: root/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/HttpServletServer.java
diff options
context:
space:
mode:
authorHengye <yehui.wang@est.tech>2020-02-25 10:43:40 +0800
committerHengye <yehui.wang@est.tech>2020-02-27 13:13:56 +0800
commitd59c619324f5813127e5150e2b3fd5d446cf3a48 (patch)
treeff2a216008c7ac67b7df582e83a194786f16700e /policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/HttpServletServer.java
parentd047a3d38823eca7cf61ee6857e2920623d78b1c (diff)
Adding DefaultServlet to support static resources
Adding DefaultServlet to make embeded jetty not only support Jersey, but also support static resources, like html, css and js. Issue-ID: POLICY-2311 Signed-off-by: Hengye <yehui.wang@est.tech> Change-Id: I71309036627d75dcc56947b395688a4e2f22c0ce
Diffstat (limited to 'policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/HttpServletServer.java')
-rw-r--r--policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/HttpServletServer.java19
1 files changed, 17 insertions, 2 deletions
diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/HttpServletServer.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/HttpServletServer.java
index 0adf782c..030bf93a 100644
--- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/HttpServletServer.java
+++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/HttpServletServer.java
@@ -3,6 +3,7 @@
* ONAP
* ================================================================================
* Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2020 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -83,7 +84,8 @@ public interface HttpServletServer extends Startable {
* @param restClass JAX-RS API Class
*
* @throws IllegalArgumentException unable to process because of invalid input
- * @throws IllegalStateException unable to process because of invalid state
+ * @throws IllegalStateException unable to process because of invalid state, for example
+ * different types of servlets map to the same servletPath
*/
void addServletClass(String servletPath, String restClass);
@@ -94,11 +96,24 @@ public interface HttpServletServer extends Startable {
* @param restPackage JAX-RS package to scan
*
* @throws IllegalArgumentException unable to process because of invalid input
- * @throws IllegalStateException unable to process because of invalid state
+ * @throws IllegalStateException unable to process because of invalid state, for example
+ * different types of servlets map to the same servletPath
*/
void addServletPackage(String servletPath, String restPackage);
/**
+ * Add org.eclipse.jetty.servlet.DefaultServlet into context
+ *
+ * @param servletPath servlet path
+ * @param resourceBase static resources folder
+ *
+ * @throws IllegalArgumentException unable to process because of invalid input
+ * @throws IllegalStateException unable to process because of invalid state, for example
+ * different types of servlets map to the same servletPath
+ */
+ void addServletResource(String servletPath, String resourceBase);
+
+ /**
* Blocking start of the http server.
*
* @param maxWaitTime max time to wait for the start to take place