HttpHandler, which processes requests to a static resources.
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| protected final ArraySet | |
| private static final Logger |
| Access | Constructor and Description |
|---|---|
| public | StaticHttpHandler()
Create HttpHandler, which, by default, will handle requests to the static resources located in the current directory. |
| public | StaticHttpHandler(String...
the folder(s) where the static resource are located. If the docRoot is null -
static pages won't be served by this HttpHandler docRoots)Create a new instance which will look for static pages located under the docRoot. |
| public | StaticHttpHandler(Set<String>
the folders where the static resource are located. If the docRoot is empty - static pages
won't be served by this HttpHandler docRoots)Create a new instance which will look for static pages located under the docRoot. |
| Modifier and Type | Method and Description |
|---|---|
| public final File | addDocRoot(String
the directory to be added to the list of directories where files will be serviced from. docRoot)Add the directory to the list of directories where files will be serviced from. |
| public final void | addDocRoot(File
the directory to be added to the list of directories where files will be serviced from. docRoot)Add the directory to the list of directories where files will be serviced from. |
| public File | Returns: the default directory from where file will be serviced.Return the default directory from where files will be serviced. |
| public ArraySet | Returns: the list of directories where files will be serviced from.Return the list of directories where files will be serviced from. |
| protected boolean | handle(final String uri, final Request request, final Response response)
Implements abstract org. Lookup a resource based on the request URI, and process it. |
| public boolean | isDirectorySlashOff()
Returns: true if HTTP 301 redirect shouldn't be sent when requested static resource is a directory, or false otherwise |
| public void | removeDocRoot(File
the directory to remove. docRoot)Removes the directory from the list of directories where static files will be serviced from. |
| public void | setDirectorySlashOff(boolean directorySlashOff)
If the directorySlashOff is true HTTP 301 redirect will not be sent when requested static resource is a directory. |
| directorySlashOff | back to summary |
|---|---|
| private boolean directorySlashOff | |
| docRoots | back to summary |
|---|---|
| protected final ArraySet<File> docRoots | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER Hides org. | |
| StaticHttpHandler | back to summary |
|---|---|
| public StaticHttpHandler() Create HttpHandler, which, by default, will handle requests to the static resources located in the current directory. | |
| StaticHttpHandler | back to summary |
|---|---|
| public StaticHttpHandler(String... docRoots) Create a new instance which will look for static pages located under the docRoot. If the docRoot is null - static pages won't be served by this HttpHandler
| |
| StaticHttpHandler | back to summary |
|---|---|
| public StaticHttpHandler(Set<String> docRoots) Create a new instance which will look for static pages located under the docRoot. If the docRoot is null - static pages won't be served by this HttpHandler
| |
| addDocRoot | back to summary |
|---|---|
| public final File addDocRoot(String docRoot) Add the directory to the list of directories where files will be serviced from. | |
| addDocRoot | back to summary |
|---|---|
| public final void addDocRoot(File docRoot) Add the directory to the list of directories where files will be serviced from.
| |
| getDefaultDocRoot | back to summary |
|---|---|
| public File getDefaultDocRoot() Return the default directory from where files will be serviced.
| |
| getDocRoots | back to summary |
|---|---|
| public ArraySet Return the list of directories where files will be serviced from. | |
| handle | back to summary |
|---|---|
| protected boolean handle(final String uri, final Request request, final Response response) throws Exception Implements abstract org. Doc from org. Lookup a resource based on the request URI, and process it.
| |
| isDirectorySlashOff | back to summary |
|---|---|
public boolean isDirectorySlashOff()
| |
| removeDocRoot | back to summary |
|---|---|
| public void removeDocRoot(File docRoot) Removes the directory from the list of directories where static files will be serviced from.
| |
| setDirectorySlashOff | back to summary |
|---|---|
| public void setDirectorySlashOff(boolean directorySlashOff) If the directorySlashOff is true HTTP 301 redirect will not be sent when requested static resource is a directory. | |