public final class TsClasspath extends Object implements Takes
This "takes" is trying to find the requested resource in classpath and return it as an HTTP response with binary body, for example:
new TsClasspath("/my");
This object will take query part of the arrived HTTP
Request
and concatenate it with the "/my"
prefix.
For example, a request comes it and its query equals to
"/css/style.css?eot"
. TsClasspath
will try to find a resource "/my/css/style.css"
in classpath.
If such a resource is not found, NotFoundException
will be thrown.
The class is immutable and thread-safe.
Constructor and Description |
---|
TsClasspath()
Ctor.
|
TsClasspath(Class<?> base)
Ctor.
|
TsClasspath(String pfx)
Ctor.
|
public TsClasspath()
public TsClasspath(Class<?> base)
base
- Base classpublic TsClasspath(String pfx)
pfx
- Prefixpublic Take route(Request request) throws IOException
Takes
route
in interface Takes
request
- The request to dispatchIOException
- If failsCopyright © 2015 Takes. All rights reserved.