Package spark.resource
Class ExternalResourceHandler
- java.lang.Object
-
- spark.resource.AbstractResourceHandler
-
- spark.resource.ExternalResourceHandler
-
public class ExternalResourceHandler extends AbstractResourceHandler
Locates resources from external folder Code snippets copied from Eclipse Jetty source. Modifications made by Per Wendel.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringbaseResourceprivate static org.slf4j.LoggerLOGprivate java.lang.StringwelcomeFile-
Fields inherited from class spark.resource.AbstractResourceHandler
SLASH
-
-
Constructor Summary
Constructors Constructor Description ExternalResourceHandler(java.lang.String baseResource)ConstructorExternalResourceHandler(java.lang.String baseResource, java.lang.String welcomeFile)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected AbstractFileResolvingResourcegetResource(java.lang.String path)Gets resource from path-
Methods inherited from class spark.resource.AbstractResourceHandler
addPaths, getResource
-
-
-
-
Constructor Detail
-
ExternalResourceHandler
public ExternalResourceHandler(java.lang.String baseResource)
Constructor- Parameters:
baseResource- the base resource path
-
ExternalResourceHandler
public ExternalResourceHandler(java.lang.String baseResource, java.lang.String welcomeFile)Constructor- Parameters:
baseResource- the base resource pathwelcomeFile- the welcomeFile
-
-
Method Detail
-
getResource
protected AbstractFileResolvingResource getResource(java.lang.String path) throws java.net.MalformedURLException
Description copied from class:AbstractResourceHandlerGets resource from path- Specified by:
getResourcein classAbstractResourceHandler- Parameters:
path- the path- Returns:
- the resource or null if resource doesn't exist
- Throws:
java.net.MalformedURLException- thrown when malformed URL.
-
-