Class StaticFiles.Builder
java.lang.Object
org.apache.juneau.rest.server.staticfile.StaticFiles.Builder
- Enclosing interface:
- StaticFiles
Builder class.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddMimeTypes(String mimeTypes) Prepend the MIME type values to the MIME types registry.Returns the bean store used by this builder.build()Builds the static files.caching(long cachingLimit) Enables in-memory caching of files for quicker retrieval.Adds a class subpackage to the lookup paths.Adds a file system directory to the lookup paths.Specifies the regular expression file name pattern to use to exclude files from being retrieved from the file source.headers(HttpHeader... headers) Appends headers to add to HTTP responses.Specifies the regular expression file name patterns to use to include files being retrieved from the file source.mimeTypes(MimeTypeDetector value) Replaces the MIME types registry used for determining content types.Adds a file system directory to the lookup paths.
-
Constructor Details
-
Builder
Constructor.- Parameters:
beanStore- The bean store to use for creating beans.
-
-
Method Details
-
beanStore
Returns the bean store used by this builder.- Returns:
- The bean store used by this builder.
-
addMimeTypes
Prepend the MIME type values to the MIME types registry.- Parameters:
mimeTypes- A .mime.types formatted string of entries. SeeMimeTypeDetector.Builder#addTypes(String...).- Returns:
- This object.
-
caching
Enables in-memory caching of files for quicker retrieval.- Parameters:
cachingLimit- The maximum file size in bytes.- Returns:
- This object.
-
cp
Adds a class subpackage to the lookup paths.- Parameters:
c- The class whose package will be added to the lookup paths. Must not benull .path- The absolute or relative subpath.recursive- Iftrue , also recursively adds all the paths of the parent classes as well.- Returns:
- This object.
-
dir
Adds a file system directory to the lookup paths.- Parameters:
path- The path relative to the working directory. Must not benull - Returns:
- This object.
-
exclude
Specifies the regular expression file name pattern to use to exclude files from being retrieved from the file source.- Parameters:
patterns- The regular expression exclude patterns.
If none are specified, no files will be excluded.- Returns:
- This object.
-
headers
Appends headers to add to HTTP responses.Can be called multiple times to add multiple headers.
- Parameters:
headers- The headers to add.- Returns:
- This object.
-
include
Specifies the regular expression file name patterns to use to include files being retrieved from the file source.- Parameters:
patterns- The regular expression include patterns.
The default is".*" .- Returns:
- This object.
-
mimeTypes
Replaces the MIME types registry used for determining content types.- Parameters:
value- The new MIME types registry.- Returns:
- This object.
-
path
Adds a file system directory to the lookup paths.- Parameters:
value- The directory path.- Returns:
- This object.
-
build
Builds the static files.- Returns:
- A new
BasicStaticFiles.
-