public interface IStaticResourceBuilder<R extends IRequestContext<?>>
| Modifier and Type | Method and Description |
|---|---|
IStaticResourceBuilder<R> |
cache(int seconds)
Adds public cache headers.
|
IStaticResourceBuilder<R> |
cache(int seconds,
boolean isPrivate)
Adds cache headers.
|
IStaticResourceBuilder<R> |
cache(int seconds,
boolean isPrivate,
Integer secondsCdn)
Adds cache headers.
|
IStaticResourceBuilder<R> |
classpath(String path)
The path to the resource, on the classpath.
|
IStaticResourceBuilder<R> |
cors()
Enables Cross-Origin Resource Sharing (Cors)
|
IStaticResourceBuilder<R> |
cors(Set<String> allowedOrigins)
Enables Cross-Origin Resource Sharing (Cors)
|
IStaticResourceBuilder<R> |
cors(Set<String> allowedOrigins,
Set<String> extraHeadersAllowedToBeRead)
Enables Cross-Origin Resource Sharing (Cors)
|
IStaticResourceBuilder<R> |
cors(Set<String> allowedOrigins,
Set<String> extraHeadersAllowedToBeRead,
Set<String> extraHeadersAllowedToBeSent)
Enables Cross-Origin Resource Sharing (Cors)
|
IStaticResourceBuilder<R> |
cors(Set<String> allowedOrigins,
Set<String> extraHeadersAllowedToBeRead,
Set<String> extraHeadersAllowedToBeSent,
boolean allowCookies)
Enables Cross-Origin Resource Sharing (Cors)
|
IStaticResourceBuilder<R> |
cors(Set<String> allowedOrigins,
Set<String> extraHeadersAllowedToBeRead,
Set<String> extraHeadersAllowedToBeSent,
boolean allowCookies,
int maxAgeInSeconds)
Enables Cross-Origin Resource Sharing (Cors)
|
IStaticResource<R> |
create()
Creates and returns the static resource without adding it to
the router.
|
IStaticResourceBuilder<R> |
pathAbsolute(String absolutePath)
The absolute path to the resource, on the file system.
|
IStaticResourceBuilder<R> |
pathRelative(String relativePath)
The path to the resource, on the file system, relative to the
temp Spincast directory, as returned by
ISpincastConfig::getSpincastTempDir() |
void |
save()
Saves the static resource route to the router.
|
void |
save(IHandler<R> generator)
Saves the static resource route.
|
IStaticResourceBuilder<R> |
url(String url)
The URL pointing to the resource.
|
IStaticResourceBuilder<R> url(String url)
IStaticResourceBuilder<R> classpath(String path)
IStaticResourceBuilder<R> pathAbsolute(String absolutePath)
absolutePath - the absolute path to the resource. If this is a file
and not a directory, remember that it will be served as a static resource,
so its extension is important for the
correct Content-Type to be sent!IStaticResourceBuilder<R> pathRelative(String relativePath)
ISpincastConfig::getSpincastTempDir()relativePath - the relative path to the resource. If this is a file
and not a directory, remember that it will be served as a static resource,
so its extension is important for the
correct Content-Type to be sent!IStaticResourceBuilder<R> cors()
ISpincastFilters#cors(R context)IStaticResourceBuilder<R> cors(Set<String> allowedOrigins)
ISpincastFilters#cors(R context,
Set<String> allowedOrigins)IStaticResourceBuilder<R> cors(Set<String> allowedOrigins, Set<String> extraHeadersAllowedToBeRead)
ISpincastFilters#cors(R context,
Set<String> allowedOrigins,
Set<String> extraHeadersAllowedToBeRead)IStaticResourceBuilder<R> cors(Set<String> allowedOrigins, Set<String> extraHeadersAllowedToBeRead, Set<String> extraHeadersAllowedToBeSent)
ISpincastFilters#cors(R context,
Set<String> allowedOrigins,
Set<String> extraHeadersAllowedToBeRead,
Set<String> extraHeadersAllowedToBeSent)IStaticResourceBuilder<R> cors(Set<String> allowedOrigins, Set<String> extraHeadersAllowedToBeRead, Set<String> extraHeadersAllowedToBeSent, boolean allowCookies)
ISpincastFilters#cors(R context,
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)
ISpincastFilters#cors(R context,
Set<String> allowedOrigins,
Set<String> extraHeadersAllowedToBeRead,
Set<String> extraHeadersAllowedToBeSent,
boolean allowCookies,
int maxAgeInSeconds
)IStaticResourceBuilder<R> cache(int seconds)
seconds - The number of seconds the resource associated with
this route should be cached.IStaticResourceBuilder<R> cache(int seconds, boolean isPrivate)
seconds - The number of seconds the resource associated with
this route should be cached.isPrivate - should the cache be private?
(help)IStaticResourceBuilder<R> cache(int seconds, boolean isPrivate, Integer secondsCdn)
seconds - The number of seconds the resource associated with
this route should be cached.isPrivate - should the cache be private?
(help)secondsCdn - The number of seconds the resource associated with
this route should be cached by a CDN/proxy. If null, it
won't be used.void save()
IRouter object, an exception will be
thrown.void save(IHandler<R> generator)
IRouter object, an exception will be
thrown.generator - If the resource is not found, the specified
generator will be used to generate it and
the result will be saved.IStaticResource<R> create()
save(...) instead to save the static resource
to the router at the end of the build process!Copyright © 2016. All rights reserved.