Package | Description |
---|---|
io.muserver.handlers |
Some pre-built handlers for common tasks such as file handling.
|
Modifier and Type | Method and Description |
---|---|
static ResourceHandlerBuilder |
ResourceHandlerBuilder.classpathHandler(String classpathRoot)
Creates a handler that serves files from the classpath..
|
static ResourceHandlerBuilder |
ResourceHandlerBuilder.fileHandler(File baseDirectory)
Creates a handler that serves files from the given directory.
|
static ResourceHandlerBuilder |
ResourceHandlerBuilder.fileHandler(Path path)
Creates a handler that serves files from the given directory.
|
static ResourceHandlerBuilder |
ResourceHandlerBuilder.fileHandler(String directoryPath)
Creates a handler that serves files from the given directory.
|
static ResourceHandlerBuilder |
ResourceHandlerBuilder.fileOrClasspath(String fileRootIfExists,
String classpathRoot)
Creates a resource handler that serves from the file system if the directory exists; otherwise from the class path.
|
ResourceHandlerBuilder |
ResourceHandlerBuilder.withDefaultFile(String defaultFile)
Specifies the file to use when a request such as
/web/ is made. |
ResourceHandlerBuilder |
ResourceHandlerBuilder.withDirectoryListing(boolean enabled)
Specifies whether or not to allow directory listing.
|
ResourceHandlerBuilder |
ResourceHandlerBuilder.withDirectoryListingCSS(String css)
Specifies CSS to use for the HTML directory listing page, if directory listing is enabled.
|
ResourceHandlerBuilder |
ResourceHandlerBuilder.withDirectoryListingDateFormatter(DateTimeFormatter dateTimeFormatter)
Specifies a custom date format for the "Last modified" column when directory listing is enabled.
|
ResourceHandlerBuilder |
ResourceHandlerBuilder.withExtensionToResourceType(Map<String,ResourceType> extensionToResourceType)
Specify custom filename extension to mime-type mappings.
|
ResourceHandlerBuilder |
ResourceHandlerBuilder.withPathToServeFrom(String pathToServeFrom)
Deprecated.
Please use
ContextHandlerBuilder.context(pathToServeFrom).addHandler(resourceHandler) instead. |
Copyright © 2017–2019. All rights reserved.