public class StaticResourceBuilder<R extends IRequestContext<?>,W extends IWebsocketContext<?>> extends Object implements IStaticResourceBuilder<R>
| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
StaticResourceBuilder(boolean isDir,
IStaticResourceFactory<R> staticResourceFactory,
IStaticResourceCorsConfigFactory staticResourceCorsConfigFactory,
IStaticResourceCacheConfigFactory staticResourceCacheConfigFactory,
ISpincastConfig spincastConfig,
ISpincastUtils spincastUtils,
ISpincastRouterConfig spincastRouterConfig) |
StaticResourceBuilder(IRouter<R,W> router,
boolean isDir,
IStaticResourceFactory<R> staticResourceFactory,
IStaticResourceCorsConfigFactory staticResourceCorsConfigFactory,
IStaticResourceCacheConfigFactory staticResourceCacheConfigFactory,
ISpincastConfig spincastConfig,
ISpincastUtils spincastUtils,
ISpincastRouterConfig spincastRouterConfig) |
public StaticResourceBuilder(boolean isDir,
IStaticResourceFactory<R> staticResourceFactory,
IStaticResourceCorsConfigFactory staticResourceCorsConfigFactory,
IStaticResourceCacheConfigFactory staticResourceCacheConfigFactory,
ISpincastConfig spincastConfig,
ISpincastUtils spincastUtils,
ISpincastRouterConfig spincastRouterConfig)
public StaticResourceBuilder(IRouter<R,W> router, boolean isDir, IStaticResourceFactory<R> staticResourceFactory, IStaticResourceCorsConfigFactory staticResourceCorsConfigFactory, IStaticResourceCacheConfigFactory staticResourceCacheConfigFactory, ISpincastConfig spincastConfig, ISpincastUtils spincastUtils, ISpincastRouterConfig spincastRouterConfig)
protected boolean isDir()
protected IStaticResourceFactory<R> getStaticResourceFactory()
protected IStaticResourceCorsConfigFactory getStaticResourceCorsConfigFactory()
protected IStaticResourceCacheConfigFactory getStaticResourceCacheConfigFactory()
protected ISpincastConfig getSpincastConfig()
protected ISpincastUtils getSpincastUtils()
protected ISpincastRouterConfig getSpincastRouterConfig()
public String getUrl()
public String getPath()
public boolean isClasspath()
public IStaticResourceCorsConfig getCorsConfig()
public IStaticResourceCacheConfig getCacheConfig()
public IStaticResourceBuilder<R> url(String url)
url in interface IStaticResourceBuilder<R extends IRequestContext<?>>public IStaticResourceBuilder<R> classpath(String path)
classpath in interface IStaticResourceBuilder<R extends IRequestContext<?>>public IStaticResourceBuilder<R> pathAbsolute(String absolutePath)
pathAbsolute in interface IStaticResourceBuilder<R extends IRequestContext<?>>public IStaticResourceBuilder<R> pathRelative(String relativePath)
pathRelative in interface IStaticResourceBuilder<R extends IRequestContext<?>>public IStaticResourceBuilder<R> cors()
cors in interface IStaticResourceBuilder<R extends IRequestContext<?>>public IStaticResourceBuilder<R> cors(Set<String> allowedOrigins)
cors in interface IStaticResourceBuilder<R extends IRequestContext<?>>public IStaticResourceBuilder<R> cors(Set<String> allowedOrigins, Set<String> extraHeadersAllowedToBeRead)
cors in interface IStaticResourceBuilder<R extends IRequestContext<?>>public IStaticResourceBuilder<R> cors(Set<String> allowedOrigins, Set<String> extraHeadersAllowedToBeRead, Set<String> extraHeadersAllowedToBeSent)
cors in interface IStaticResourceBuilder<R extends IRequestContext<?>>public IStaticResourceBuilder<R> cors(Set<String> allowedOrigins, Set<String> extraHeadersAllowedToBeRead, Set<String> extraHeadersAllowedToBeSent, boolean allowCookies)
cors in interface IStaticResourceBuilder<R extends IRequestContext<?>>public IStaticResourceBuilder<R> cors(Set<String> allowedOrigins, Set<String> extraHeadersAllowedToBeRead, Set<String> extraHeadersAllowedToBeSent, boolean allowCookies, int maxAgeInSeconds)
cors in interface IStaticResourceBuilder<R extends IRequestContext<?>>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 IStaticResourceBuilder<R> cache(int seconds)
cache in interface IStaticResourceBuilder<R extends IRequestContext<?>>public IStaticResourceBuilder<R> cache(int seconds, boolean isCachePrivate)
cache in interface IStaticResourceBuilder<R extends IRequestContext<?>>public IStaticResourceBuilder<R> cache(int seconds, boolean isCachePrivate, Integer cdnSeconds)
cache in interface IStaticResourceBuilder<R extends IRequestContext<?>>public void save()
save in interface IStaticResourceBuilder<R extends IRequestContext<?>>public void save(IHandler<R> generator)
save in interface IStaticResourceBuilder<R extends IRequestContext<?>>public IStaticResource<R> create()
create in interface IStaticResourceBuilder<R extends IRequestContext<?>>protected IStaticResourceCacheConfig getDefaultCacheConfig()
null and,
in that case, no cache header will be used.Copyright © 2016. All rights reserved.