Package spark.resource
Class ClassPathResourceHandler
- java.lang.Object
-
- spark.resource.AbstractResourceHandler
-
- spark.resource.ClassPathResourceHandler
-
public class ClassPathResourceHandler extends AbstractResourceHandler
Locates resources in classpath 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 ClassPathResourceHandler(java.lang.String baseResource)ConstructorClassPathResourceHandler(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
-
ClassPathResourceHandler
public ClassPathResourceHandler(java.lang.String baseResource)
Constructor- Parameters:
baseResource- the base resource path
-
ClassPathResourceHandler
public ClassPathResourceHandler(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.
-
-