|
1 | 1 | package com.kttdevelopment.simplehttpserver; |
2 | 2 |
|
3 | | -import com.sun.net.httpserver.HttpHandler; |
4 | | -import com.sun.net.httpserver.HttpServer; |
5 | | -import com.sun.net.httpserver.HttpContext; |
| 3 | +import com.sun.net.httpserver.*; |
6 | 4 |
|
7 | 5 | import java.io.IOException; |
8 | 6 | import java.net.InetSocketAddress; |
@@ -271,6 +269,72 @@ public static SimpleHttpServer create(final int port, final int backlog) throws |
271 | 269 | */ |
272 | 270 | public abstract HttpContext createContext(final String context, final SimpleHttpHandler handler); |
273 | 271 |
|
| 272 | + // |
| 273 | + |
| 274 | + /** |
| 275 | + * Creates a context mapped to a specific {@link HttpContext} with an {@link Authenticator}. |
| 276 | + * |
| 277 | + * @param context the context |
| 278 | + * @param authenticator authenticator |
| 279 | + * @return the http context associated with the context |
| 280 | + * @throws IllegalArgumentException if the context is invalid or taken |
| 281 | + * @throws NullPointerException if the context is null |
| 282 | + * |
| 283 | + * @see HttpContext |
| 284 | + * @see Authenticator |
| 285 | + * @see #createContext(String, HttpHandler, Authenticator) |
| 286 | + * @see #createContext(String, SimpleHttpHandler, Authenticator) |
| 287 | + * @see #removeContext(String) |
| 288 | + * @see #removeContext(HttpContext) |
| 289 | + * @since 03.03.00 |
| 290 | + * @author Ktt Development |
| 291 | + */ |
| 292 | + public abstract HttpContext createContext(final String context, final Authenticator authenticator); |
| 293 | + |
| 294 | + /** |
| 295 | + * Creates a context mapped to a specific {@link HttpContext} with an {@link Authenticator}. |
| 296 | + * |
| 297 | + * @param context the context |
| 298 | + * @param handler the handler |
| 299 | + * @param authenticator authenticator |
| 300 | + * @return the http context associated with the context |
| 301 | + * @throws IllegalArgumentException if the context is invalid or taken |
| 302 | + * @throws NullPointerException if the context is null |
| 303 | + * |
| 304 | + * @see HttpContext |
| 305 | + * @see HttpHandler |
| 306 | + * @see Authenticator |
| 307 | + * @see #createContext(String, Authenticator) |
| 308 | + * @see #createContext(String, SimpleHttpHandler, Authenticator) |
| 309 | + * @see #removeContext(String) |
| 310 | + * @see #removeContext(HttpContext) |
| 311 | + * @since 03.03.00 |
| 312 | + * @author Ktt Development |
| 313 | + */ |
| 314 | + public abstract HttpContext createContext(final String context, final HttpHandler handler, final Authenticator authenticator); |
| 315 | + |
| 316 | + /** |
| 317 | + * Creates a context mapped to a specific {@link HttpContext} with an {@link Authenticator}. |
| 318 | + * |
| 319 | + * @param context the context |
| 320 | + * @param handler the handler |
| 321 | + * @param authenticator authenticator |
| 322 | + * @return the http context associated with the context |
| 323 | + * @throws IllegalArgumentException if the context is invalid or taken |
| 324 | + * @throws NullPointerException if the context is null |
| 325 | + * |
| 326 | + * @see HttpContext |
| 327 | + * @see SimpleHttpHandler |
| 328 | + * @see Authenticator |
| 329 | + * @see #createContext(String, Authenticator) |
| 330 | + * @see #createContext(String, HttpHandler, Authenticator) |
| 331 | + * @see #removeContext(String) |
| 332 | + * @see #removeContext(HttpContext) |
| 333 | + * @since 03.03.00 |
| 334 | + * @author Ktt Development |
| 335 | + */ |
| 336 | + public abstract HttpContext createContext(final String context, final SimpleHttpHandler handler, final Authenticator authenticator); |
| 337 | + |
274 | 338 | // |
275 | 339 |
|
276 | 340 | /** |
|
0 commit comments