public class StaticResourceBuilder<R extends IRequestContext<?>,W extends IWebsocketContext<?>> extends Object implements IStaticResourceBuilder<R>
| Constructor and Description |
|---|
StaticResourceBuilder(boolean isDir,
IStaticResourceFactory<R> staticResourceFactory,
IStaticResourceCorsConfigFactory staticResourceCorsConfigFactory) |
StaticResourceBuilder(IRouter<R,W> router,
boolean isDir,
IStaticResourceFactory<R> staticResourceFactory,
IStaticResourceCorsConfigFactory staticResourceCorsConfigFactory) |
| Modifier and Type | Method and Description |
|---|---|
IStaticResourceBuilder<R> |
classpath(String path) |
IStaticResourceBuilder<R> |
cors() |
IStaticResourceBuilder<R> |
cors(Set<String> allowedOrigins) |
IStaticResourceBuilder<R> |
cors(Set<String> allowedOrigins,
Set<String> extraHeadersAllowedToBeRead) |
IStaticResourceBuilder<R> |
cors(Set<String> allowedOrigins,
Set<String> extraHeadersAllowedToBeRead,
Set<String> extraHeadersAllowedToBeSent) |
IStaticResourceBuilder<R> |
cors(Set<String> allowedOrigins,
Set<String> extraHeadersAllowedToBeRead,
Set<String> extraHeadersAllowedToBeSent,
boolean allowCookies) |
IStaticResourceBuilder<R> |
cors(Set<String> allowedOrigins,
Set<String> extraHeadersAllowedToBeRead,
Set<String> extraHeadersAllowedToBeSent,
boolean allowCookies,
int maxAgeInSeconds) |
IStaticResource<R> |
create() |
IStaticResourceBuilder<R> |
fileSystem(String path) |
IStaticResourceCorsConfig |
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.
|
IHandler<R> |
getGenerator() |
String |
getPath() |
protected IRouter<R,W> |
getRouter() |
protected IStaticResourceCorsConfigFactory |
getStaticResourceCorsConfigFactory() |
protected IStaticResourceFactory<R> |
getStaticResourceFactory() |
String |
getUrl() |
boolean |
isClasspath() |
protected boolean |
isDir() |
void |
save() |
void |
save(IHandler<R> generator) |
IStaticResourceBuilder<R> |
url(String url) |
public StaticResourceBuilder(boolean isDir,
IStaticResourceFactory<R> staticResourceFactory,
IStaticResourceCorsConfigFactory staticResourceCorsConfigFactory)
public StaticResourceBuilder(IRouter<R,W> router, boolean isDir, IStaticResourceFactory<R> staticResourceFactory, IStaticResourceCorsConfigFactory staticResourceCorsConfigFactory)
protected boolean isDir()
protected IStaticResourceFactory<R> getStaticResourceFactory()
protected IStaticResourceCorsConfigFactory getStaticResourceCorsConfigFactory()
public String getUrl()
public String getPath()
public boolean isClasspath()
public IStaticResourceCorsConfig getCorsConfig()
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> fileSystem(String path)
fileSystem 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<?>>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 int getCorsDefaultMaxAgeInSeconds()
protected Set<String> getCorsDefaultAllowedOrigins()
protected Set<String> getCorsDefaultExtraHeadersAllowedToBeRead()
protected Set<String> getCorsDefaultExtraHeadersAllowedToBeSent()
protected boolean getCorsDefaultIsCookiesAllowed()
Copyright © 2016. All rights reserved.