public abstract class FileAndResourceDirectives extends ExecutionDirectives
For the directives in this class, the "default classloader" is defined as the classloader that has loaded the pekko.actor.ActorSystem class.
Constructor and Description |
---|
FileAndResourceDirectives() |
Modifier and Type | Method and Description |
---|---|
ContentTypeResolver |
defaultContentTypeResolver()
Default
ContentTypeResolver . |
DirectoryRenderer |
defaultDirectoryRenderer()
Default
DirectoryRenderer to be used with directory listing directives. |
Route |
getFromBrowseableDirectories(java.lang.Iterable<java.lang.String> directories,
ContentTypeResolver resolver)
Serves the content of the given directories as a file system browser, i.e. files are sent and directories
served as browseable listings.
|
Route |
getFromBrowseableDirectories(java.lang.Iterable<java.lang.String> directories,
DirectoryRenderer renderer)
Serves the content of the given directories as a file system browser, i.e. files are sent and directories
served as browseable listings.
|
Route |
getFromBrowseableDirectories(java.lang.Iterable<java.lang.String> directories,
DirectoryRenderer renderer,
ContentTypeResolver resolver)
Serves the content of the given directories as a file system browser, i.e. files are sent and directories
served as browseable listings.
|
Route |
getFromBrowseableDirectories(scala.collection.immutable.Seq<java.lang.String> directories)
Serves the content of the given directories as a file system browser, i.e. files are sent and directories
served as browseable listings.
|
Route |
getFromBrowseableDirectories(java.lang.String... directories)
Serves the content of the given directories as a file system browser, i.e. files are sent and directories
served as browseable listings.
|
Route |
getFromBrowseableDirectory(java.lang.String directory)
Same as
getFromBrowseableDirectories with only one directory. |
Route |
getFromBrowseableDirectory(java.lang.String directory,
ContentTypeResolver resolver)
Same as
getFromBrowseableDirectories with only one directory. |
Route |
getFromBrowseableDirectory(java.lang.String directory,
DirectoryRenderer renderer)
Same as
getFromBrowseableDirectories with only one directory. |
Route |
getFromBrowseableDirectory(java.lang.String directory,
DirectoryRenderer renderer,
ContentTypeResolver resolver)
Same as
getFromBrowseableDirectories with only one directory. |
Route |
getFromDirectory(java.lang.String directoryPath)
Completes GET requests with the content of a file underneath the given directory, using the default content-type resolver.
|
Route |
getFromDirectory(java.lang.String directoryPath,
ContentTypeResolver resolver)
Completes GET requests with the content of a file underneath the given directory, using the given content-type resolver.
|
Route |
getFromFile(java.io.File file)
Completes GET requests with the content of the given file, resolving the content type using the default resolver.
|
Route |
getFromFile(java.io.File file,
ContentType contentType)
Completes GET requests with the content of the given file, using the content type.
|
Route |
getFromFile(java.io.File file,
ContentTypeResolver resolver)
Completes GET requests with the content of the given file, resolving the content type using the given resolver.
|
Route |
getFromFile(java.lang.String file)
Completes GET requests with the content of the given file, resolving the content type using the default resolver.
|
Route |
getFromFile(java.lang.String file,
ContentTypeResolver resolver)
Completes GET requests with the content of the given file, resolving the content type using the given resolver.
|
Route |
getFromResource(java.lang.String path)
Completes GET requests with the content of the given resource loaded from the default ClassLoader,
using the default content type resolver.
|
Route |
getFromResource(java.lang.String path,
ContentType contentType)
Completes GET requests with the content of the given resource loaded from the default ClassLoader,
with the given content type.
|
Route |
getFromResource(java.lang.String path,
ContentType contentType,
java.lang.ClassLoader classLoader)
Completes GET requests with the content of the given resource loaded from the given ClassLoader,
with the given content type.
|
Route |
getFromResource(java.lang.String path,
ContentTypeResolver resolver)
Completes GET requests with the content of the given resource loaded from the default ClassLoader,
using the given content type resolver.
|
Route |
getFromResourceDirectory(java.lang.String directoryName)
Same as "getFromDirectory" except that the file is not fetched from the file system but rather from a
"resource directory", using the default ClassLoader, resolving content type using the default content type
resolver.
|
Route |
getFromResourceDirectory(java.lang.String directoryName,
java.lang.ClassLoader classLoader)
Same as "getFromDirectory" except that the file is not fetched from the file system but rather from a
"resource directory", using the given ClassLoader, resolving content type using the default content type
resolver.
|
Route |
getFromResourceDirectory(java.lang.String directoryName,
ContentTypeResolver resolver)
Same as "getFromDirectory" except that the file is not fetched from the file system but rather from a
"resource directory", using the default ClassLoader, resolving content type using the given content type
resolver.
|
Route |
getFromResourceDirectory(java.lang.String directoryName,
ContentTypeResolver resolver,
java.lang.ClassLoader classLoader)
Same as "getFromDirectory" except that the file is not fetched from the file system but rather from a
"resource directory", using the given ClassLoader, resolving content type using the given content type
resolver.
|
Route |
listDirectoryContents(DirectoryRenderer directoryRenderer,
scala.collection.immutable.Seq<java.lang.String> directories)
Completes GET requests with a unified listing of the contents of all given directories.
|
Route |
listDirectoryContents(DirectoryRenderer directoryRenderer,
java.lang.String... directories)
Completes GET requests with a unified listing of the contents of all given directories.
|
Route |
listDirectoryContents(scala.collection.immutable.Seq<java.lang.String> directories)
Completes GET requests with a unified listing of the contents of all given directories.
|
Route |
listDirectoryContents(java.lang.String... directories)
Completes GET requests with a unified listing of the contents of all given directories.
|
handleExceptions, handleRejections
logRequest, logRequest, logRequest, logRequestResult, logRequestResultOptional, logResult, logResult, logResult
cookie, deleteCookie, deleteCookie, deleteCookie, deleteCookie, deleteCookie, optionalCookie, setCookie, setCookie
decodeRequest, decodeRequestWith, decodeRequestWith, encodeResponse, encodeResponseWith, requestEncodedWith, responseEncodingAccepted, withPrecompressedMediaTypeSupport
conditional, conditional, conditional, conditional
cancelRejection, cancelRejections, cancelRejections, extract, extractActorSystem, extractDataBytes, extractEntity, extractExecutionContext, extractLog, extractMatchedPath, extractMaterializer, extractParserSettings, extractRequest, extractRequestContext, extractRequestEntity, extractSettings, extractStrictEntity, extractStrictEntity, extractUnmatchedPath, extractUri, mapInnerRoute, mapRejections, mapRequest, mapRequestContext, mapResponse, mapResponseEntity, mapResponseHeaders, mapRouteResult, mapRouteResultFuture, mapRouteResultPF, mapRouteResultWith, mapRouteResultWithPF, mapSettings, mapUnmatchedPath, pass, provide, recoverRejections, recoverRejectionsWith, toStrictEntity, toStrictEntity, withExecutionContext, withLog, withMaterializer, withSettings
public ContentTypeResolver defaultContentTypeResolver()
ContentTypeResolver
.public DirectoryRenderer defaultDirectoryRenderer()
DirectoryRenderer
to be used with directory listing directives.public Route getFromBrowseableDirectories(java.lang.String... directories)
directories
- (undocumented)public Route getFromBrowseableDirectories(java.lang.Iterable<java.lang.String> directories, DirectoryRenderer renderer, ContentTypeResolver resolver)
directories
- (undocumented)renderer
- (undocumented)resolver
- (undocumented)public Route getFromBrowseableDirectories(java.lang.Iterable<java.lang.String> directories, DirectoryRenderer renderer)
directories
- (undocumented)renderer
- (undocumented)public Route getFromBrowseableDirectories(java.lang.Iterable<java.lang.String> directories, ContentTypeResolver resolver)
directories
- (undocumented)resolver
- (undocumented)public Route getFromBrowseableDirectories(scala.collection.immutable.Seq<java.lang.String> directories)
directories
- (undocumented)public Route getFromBrowseableDirectory(java.lang.String directory, DirectoryRenderer renderer, ContentTypeResolver resolver)
getFromBrowseableDirectories
with only one directory.directory
- (undocumented)renderer
- (undocumented)resolver
- (undocumented)public Route getFromBrowseableDirectory(java.lang.String directory, DirectoryRenderer renderer)
getFromBrowseableDirectories
with only one directory.directory
- (undocumented)renderer
- (undocumented)public Route getFromBrowseableDirectory(java.lang.String directory, ContentTypeResolver resolver)
getFromBrowseableDirectories
with only one directory.directory
- (undocumented)resolver
- (undocumented)public Route getFromBrowseableDirectory(java.lang.String directory)
getFromBrowseableDirectories
with only one directory.directory
- (undocumented)public Route getFromDirectory(java.lang.String directoryPath)
directoryPath
- (undocumented)public Route getFromDirectory(java.lang.String directoryPath, ContentTypeResolver resolver)
directoryPath
- (undocumented)resolver
- (undocumented)public Route getFromFile(java.io.File file)
file
- (undocumented)public Route getFromFile(java.io.File file, ContentTypeResolver resolver)
file
- (undocumented)resolver
- (undocumented)public Route getFromFile(java.io.File file, ContentType contentType)
file
- (undocumented)contentType
- (undocumented)public Route getFromFile(java.lang.String file)
file
- (undocumented)public Route getFromFile(java.lang.String file, ContentTypeResolver resolver)
file
- (undocumented)resolver
- (undocumented)public Route getFromResource(java.lang.String path)
path
- (undocumented)public Route getFromResource(java.lang.String path, ContentTypeResolver resolver)
path
- (undocumented)resolver
- (undocumented)public Route getFromResource(java.lang.String path, ContentType contentType)
path
- (undocumented)contentType
- (undocumented)public Route getFromResource(java.lang.String path, ContentType contentType, java.lang.ClassLoader classLoader)
path
- (undocumented)contentType
- (undocumented)classLoader
- (undocumented)public Route getFromResourceDirectory(java.lang.String directoryName)
If the requested resource is itself a directory or cannot be found or read the Route rejects the request.
directoryName
- (undocumented)public Route getFromResourceDirectory(java.lang.String directoryName, java.lang.ClassLoader classLoader)
If the requested resource is itself a directory or cannot be found or read the Route rejects the request.
directoryName
- (undocumented)classLoader
- (undocumented)public Route getFromResourceDirectory(java.lang.String directoryName, ContentTypeResolver resolver)
If the requested resource is itself a directory or cannot be found or read the Route rejects the request.
directoryName
- (undocumented)resolver
- (undocumented)public Route getFromResourceDirectory(java.lang.String directoryName, ContentTypeResolver resolver, java.lang.ClassLoader classLoader)
If the requested resource is itself a directory or cannot be found or read the Route rejects the request.
directoryName
- (undocumented)resolver
- (undocumented)classLoader
- (undocumented)public Route listDirectoryContents(java.lang.String... directories)
Marshaller[DirectoryListing]
.directories
- (undocumented)public Route listDirectoryContents(DirectoryRenderer directoryRenderer, java.lang.String... directories)
Marshaller[DirectoryListing]
.directoryRenderer
- (undocumented)directories
- (undocumented)public Route listDirectoryContents(scala.collection.immutable.Seq<java.lang.String> directories)
Marshaller[DirectoryListing]
.directories
- (undocumented)public Route listDirectoryContents(DirectoryRenderer directoryRenderer, scala.collection.immutable.Seq<java.lang.String> directories)
Marshaller[DirectoryListing]
.directoryRenderer
- (undocumented)directories
- (undocumented)