public class StaticResourceBuilderDefault<R extends RequestContext<?>,W extends WebsocketContext<?>> extends Object implements StaticResourceBuilder<R>
| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
StaticResourceBuilderDefault(boolean isDir,
StaticResourceFactory<R> staticResourceFactory,
StaticResourceCorsConfigFactory staticResourceCorsConfigFactory,
StaticResourceCacheConfigFactory staticResourceCacheConfigFactory,
SpincastConfig spincastConfig,
SpincastUtils spincastUtils,
SpincastRouterConfig spincastRouterConfig) |
StaticResourceBuilderDefault(Router<R,W> router,
boolean isDir,
StaticResourceFactory<R> staticResourceFactory,
StaticResourceCorsConfigFactory staticResourceCorsConfigFactory,
StaticResourceCacheConfigFactory staticResourceCacheConfigFactory,
SpincastConfig spincastConfig,
SpincastUtils spincastUtils,
SpincastRouterConfig spincastRouterConfig) |
| Modifier and Type | Method and Description |
|---|---|
StaticResourceBuilder<R> |
cache(int seconds) |
StaticResourceBuilder<R> |
cache(int seconds,
boolean isCachePrivate) |
StaticResourceBuilder<R> |
cache(int seconds,
boolean isCachePrivate,
Integer cdnSeconds) |
StaticResourceBuilder<R> |
classpath(String path) |
StaticResourceBuilder<R> |
cors() |
StaticResourceBuilder<R> |
cors(Set<String> allowedOrigins) |
StaticResourceBuilder<R> |
cors(Set<String> allowedOrigins,
Set<String> extraHeadersAllowedToBeRead) |
StaticResourceBuilder<R> |
cors(Set<String> allowedOrigins,
Set<String> extraHeadersAllowedToBeRead,
Set<String> extraHeadersAllowedToBeSent) |
StaticResourceBuilder<R> |
cors(Set<String> allowedOrigins,
Set<String> extraHeadersAllowedToBeRead,
Set<String> extraHeadersAllowedToBeSent,
boolean allowCookies) |
StaticResourceBuilder<R> |
cors(Set<String> allowedOrigins,
Set<String> extraHeadersAllowedToBeRead,
Set<String> extraHeadersAllowedToBeSent,
boolean allowCookies,
int maxAgeInSeconds) |
StaticResource<R> |
create() |
protected Integer |
getCacheCdnSecondsDefault() |
StaticResourceCacheConfig |
getCacheConfig() |
StaticResourceCorsConfig |
getCorsConfig() |
protected Set<String> |
getCorsDefaultAllowedOrigins()
The origins allowed, by default.
|
protected Set<String> |
getCorsDefaultExtraHeadersAllowedToBeRead()
The extra headers allowed to be read, by default,
|
protected Set<String> |
getCorsDefaultExtraHeadersAllowedToBeSent()
The extra headers allowed to be sent, by default,
|
protected boolean |
getCorsDefaultIsCookiesAllowed()
Are cookies allowed by default?
|
protected int |
getCorsDefaultMaxAgeInSeconds()
If <= 0, the "Access-Control-Max-Age" header
won't be sent.
|
protected StaticResourceCacheConfig |
getDefaultCacheConfig()
The default cache configurations to use if it is
not specified.
|
Handler<R> |
getGenerator() |
String |
getPath() |
protected Router<R,W> |
getRouter() |
protected SpincastConfig |
getSpincastConfig() |
protected SpincastRouterConfig |
getSpincastRouterConfig() |
protected SpincastUtils |
getSpincastUtils() |
protected StaticResourceCacheConfigFactory |
getStaticResourceCacheConfigFactory() |
protected StaticResourceCorsConfigFactory |
getStaticResourceCorsConfigFactory() |
protected StaticResourceFactory<R> |
getStaticResourceFactory() |
String |
getUrl() |
protected boolean |
isCachePrivateDefault()
Is the cache private by default?
|
boolean |
isClasspath() |
protected boolean |
isDir() |
boolean |
isIgnoreQueryString() |
StaticResourceBuilder<R> |
pathAbsolute(String absolutePath) |
StaticResourceBuilder<R> |
pathRelative(String relativePath) |
void |
save() |
void |
save(Handler<R> generator) |
void |
save(Handler<R> generator,
boolean ignoreQueryString) |
StaticResourceBuilder<R> |
url(String url) |
public StaticResourceBuilderDefault(boolean isDir,
StaticResourceFactory<R> staticResourceFactory,
StaticResourceCorsConfigFactory staticResourceCorsConfigFactory,
StaticResourceCacheConfigFactory staticResourceCacheConfigFactory,
SpincastConfig spincastConfig,
SpincastUtils spincastUtils,
SpincastRouterConfig spincastRouterConfig)
public StaticResourceBuilderDefault(Router<R,W> router, boolean isDir, StaticResourceFactory<R> staticResourceFactory, StaticResourceCorsConfigFactory staticResourceCorsConfigFactory, StaticResourceCacheConfigFactory staticResourceCacheConfigFactory, SpincastConfig spincastConfig, SpincastUtils spincastUtils, SpincastRouterConfig spincastRouterConfig)
protected boolean isDir()
protected StaticResourceFactory<R> getStaticResourceFactory()
protected StaticResourceCorsConfigFactory getStaticResourceCorsConfigFactory()
protected StaticResourceCacheConfigFactory getStaticResourceCacheConfigFactory()
protected SpincastConfig getSpincastConfig()
protected SpincastUtils getSpincastUtils()
protected SpincastRouterConfig getSpincastRouterConfig()
public String getUrl()
public String getPath()
public boolean isClasspath()
public StaticResourceCorsConfig getCorsConfig()
public StaticResourceCacheConfig getCacheConfig()
public boolean isIgnoreQueryString()
public StaticResourceBuilder<R> url(String url)
url in interface StaticResourceBuilder<R extends RequestContext<?>>public StaticResourceBuilder<R> classpath(String path)
classpath in interface StaticResourceBuilder<R extends RequestContext<?>>public StaticResourceBuilder<R> pathAbsolute(String absolutePath)
pathAbsolute in interface StaticResourceBuilder<R extends RequestContext<?>>public StaticResourceBuilder<R> pathRelative(String relativePath)
pathRelative in interface StaticResourceBuilder<R extends RequestContext<?>>public StaticResourceBuilder<R> cors()
cors in interface StaticResourceBuilder<R extends RequestContext<?>>public StaticResourceBuilder<R> cors(Set<String> allowedOrigins)
cors in interface StaticResourceBuilder<R extends RequestContext<?>>public StaticResourceBuilder<R> cors(Set<String> allowedOrigins, Set<String> extraHeadersAllowedToBeRead)
cors in interface StaticResourceBuilder<R extends RequestContext<?>>public StaticResourceBuilder<R> cors(Set<String> allowedOrigins, Set<String> extraHeadersAllowedToBeRead, Set<String> extraHeadersAllowedToBeSent)
cors in interface StaticResourceBuilder<R extends RequestContext<?>>public StaticResourceBuilder<R> cors(Set<String> allowedOrigins, Set<String> extraHeadersAllowedToBeRead, Set<String> extraHeadersAllowedToBeSent, boolean allowCookies)
cors in interface StaticResourceBuilder<R extends RequestContext<?>>public StaticResourceBuilder<R> cors(Set<String> allowedOrigins, Set<String> extraHeadersAllowedToBeRead, Set<String> extraHeadersAllowedToBeSent, boolean allowCookies, int maxAgeInSeconds)
cors in interface StaticResourceBuilder<R extends RequestContext<?>>protected int getCorsDefaultMaxAgeInSeconds()
protected Set<String> getCorsDefaultAllowedOrigins()
protected Set<String> getCorsDefaultExtraHeadersAllowedToBeRead()
protected Set<String> getCorsDefaultExtraHeadersAllowedToBeSent()
protected boolean getCorsDefaultIsCookiesAllowed()
protected boolean isCachePrivateDefault()
protected Integer getCacheCdnSecondsDefault()
public StaticResourceBuilder<R> cache(int seconds)
cache in interface StaticResourceBuilder<R extends RequestContext<?>>public StaticResourceBuilder<R> cache(int seconds, boolean isCachePrivate)
cache in interface StaticResourceBuilder<R extends RequestContext<?>>public StaticResourceBuilder<R> cache(int seconds, boolean isCachePrivate, Integer cdnSeconds)
cache in interface StaticResourceBuilder<R extends RequestContext<?>>public void save()
save in interface StaticResourceBuilder<R extends RequestContext<?>>public void save(Handler<R> generator)
save in interface StaticResourceBuilder<R extends RequestContext<?>>public void save(Handler<R> generator, boolean ignoreQueryString)
save in interface StaticResourceBuilder<R extends RequestContext<?>>public StaticResource<R> create()
create in interface StaticResourceBuilder<R extends RequestContext<?>>protected StaticResourceCacheConfig getDefaultCacheConfig()
null and,
in that case, no cache header will be used.Copyright © 2018. All rights reserved.