FileServiceBuilder.@Deprecated public class HttpFileServiceBuilder extends FileServiceBuilder
FileService and its FileServiceConfig. Use the factory methods in
FileService if you do not override the default settings.| Modifier and Type | Method and Description |
|---|---|
HttpFileServiceBuilder |
addHeader(CharSequence name,
Object value)
Deprecated.
Adds the specified HTTP header.
|
HttpFileServiceBuilder |
addHeaders(Iterable<? extends Map.Entry<? extends CharSequence,?>> headers)
Deprecated.
Adds the specified HTTP headers.
|
HttpFileServiceBuilder |
autoIndex(boolean autoIndex)
Deprecated.
Sets whether
FileService auto-generates a directory listing for a directory without an
index.html file. |
HttpFileService |
build()
Deprecated.
Returns a newly-created
HttpFileService based on the properties of this builder. |
HttpFileServiceBuilder |
cacheControl(CacheControl cacheControl)
Deprecated.
Sets the
"cache-control" header. |
HttpFileServiceBuilder |
cacheControl(CharSequence cacheControl)
Deprecated.
Sets the
"cache-control" header. |
HttpFileServiceBuilder |
clock(Clock clock)
Deprecated.
Sets the
Clock that provides the current date and time. |
HttpFileServiceBuilder |
entryCacheSpec(String entryCacheSpec)
Deprecated.
Sets the cache spec for caching file entries.
|
static HttpFileServiceBuilder |
forClassPath(ClassLoader classLoader,
String rootDir)
Deprecated.
|
static HttpFileServiceBuilder |
forClassPath(String rootDir)
Deprecated.
|
static HttpFileServiceBuilder |
forFileSystem(Path rootDir)
Deprecated.
|
static HttpFileServiceBuilder |
forFileSystem(String rootDir)
Deprecated.
|
static HttpFileServiceBuilder |
forVfs(HttpVfs vfs)
Deprecated.
|
HttpFileServiceBuilder |
maxCacheEntries(int maxCacheEntries)
Deprecated.
Sets the maximum allowed number of cached file entries.
|
HttpFileServiceBuilder |
maxCacheEntrySizeBytes(int maxCacheEntrySizeBytes)
Deprecated.
Sets the maximum allowed size of a cached file entry.
|
HttpFileServiceBuilder |
serveCompressedFiles(boolean serveCompressedFiles)
Deprecated.
Sets whether pre-compressed files should be served.
|
HttpFileServiceBuilder |
setHeader(CharSequence name,
Object value)
Deprecated.
Sets the specified HTTP header.
|
HttpFileServiceBuilder |
setHeaders(Iterable<? extends Map.Entry<? extends CharSequence,?>> headers)
Deprecated.
Sets the specified HTTP headers.
|
toString@Deprecated public static HttpFileServiceBuilder forFileSystem(String rootDir)
FileService.builder(Path).FileServiceBuilder with the specified rootDir in an O/S file system.@Deprecated public static HttpFileServiceBuilder forFileSystem(Path rootDir)
FileService.builder(Path).FileServiceBuilder with the specified rootDir in an O/S file system.@Deprecated public static HttpFileServiceBuilder forClassPath(String rootDir)
FileService.builder(ClassLoader, String).FileServiceBuilder with the specified rootDir in the current class
path.@Deprecated public static HttpFileServiceBuilder forClassPath(ClassLoader classLoader, String rootDir)
FileService.builder(ClassLoader, String).FileServiceBuilder with the specified rootDir in the current class
path.@Deprecated public static HttpFileServiceBuilder forVfs(HttpVfs vfs)
FileService.builder(HttpVfs).FileServiceBuilder with the specified HttpVfs.public HttpFileServiceBuilder clock(Clock clock)
FileServiceBuilderClock that provides the current date and time.clock in class FileServiceBuilderpublic HttpFileServiceBuilder maxCacheEntries(int maxCacheEntries)
FileServiceBuilder1024 entries
are cached by default.maxCacheEntries in class FileServiceBuilderpublic HttpFileServiceBuilder entryCacheSpec(String entryCacheSpec)
FileServiceBuilder"maximumSize=1024" is used by default.entryCacheSpec in class FileServiceBuilderpublic HttpFileServiceBuilder serveCompressedFiles(boolean serveCompressedFiles)
FileServiceBuilderFileService supports serving files
compressed with gzip, with the extension ".gz", and brotli, with the extension ".br".
The extension should be appended to the original file. For example, to serve index.js either
raw, gzip-compressed, or brotli-compressed, there should be three files, index.js,
index.js.gz, and index.js.br. By default, this feature is disabled.
Some tools for precompressing resources during a build process include gulp-zopfli and
gulp-brotli, which by default create files with the correct extension.
serveCompressedFiles in class FileServiceBuilderpublic HttpFileServiceBuilder maxCacheEntrySizeBytes(int maxCacheEntrySizeBytes)
FileServiceBuildermaxCacheEntrySizeBytes in class FileServiceBuilderpublic HttpFileServiceBuilder autoIndex(boolean autoIndex)
FileServiceBuilderFileService auto-generates a directory listing for a directory without an
index.html file. By default, this feature is disabled. Consider the security implications of
when enabling this feature.autoIndex in class FileServiceBuilderpublic HttpFileServiceBuilder addHeader(CharSequence name, Object value)
FileServiceBuilderaddHeader in class FileServiceBuilderpublic HttpFileServiceBuilder addHeaders(Iterable<? extends Map.Entry<? extends CharSequence,?>> headers)
FileServiceBuilderaddHeaders in class FileServiceBuilderpublic HttpFileServiceBuilder setHeader(CharSequence name, Object value)
FileServiceBuildersetHeader in class FileServiceBuilderpublic HttpFileServiceBuilder setHeaders(Iterable<? extends Map.Entry<? extends CharSequence,?>> headers)
FileServiceBuildersetHeaders in class FileServiceBuilderpublic HttpFileServiceBuilder cacheControl(CacheControl cacheControl)
FileServiceBuilder"cache-control" header. This method is a shortcut for:
builder.setHeader(HttpHeaderNames.CACHE_CONTROL, cacheControl);
cacheControl in class FileServiceBuilderpublic HttpFileServiceBuilder cacheControl(CharSequence cacheControl)
FileServiceBuilder"cache-control" header. This method is a shortcut for:
builder.setHeader(HttpHeaderNames.CACHE_CONTROL, cacheControl);
cacheControl in class FileServiceBuilderpublic HttpFileService build()
HttpFileService based on the properties of this builder.build in class FileServiceBuilderCopyright © 2020 LeanCloud. All rights reserved.