Package org.spincast.plugins.routing
Class StaticResourceBuilderDefault<R extends org.spincast.core.exchange.RequestContext<?>,W extends org.spincast.core.websocket.WebsocketContext<?>>
java.lang.Object
org.spincast.plugins.routing.StaticResourceBuilderDefault<R,W>
- All Implemented Interfaces:
org.spincast.core.routing.StaticResourceBuilder<R>
public class StaticResourceBuilderDefault<R extends org.spincast.core.exchange.RequestContext<?>,W extends org.spincast.core.websocket.WebsocketContext<?>>
extends Object
implements org.spincast.core.routing.StaticResourceBuilder<R>
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionStaticResourceBuilderDefault(boolean isDir, org.spincast.core.routing.StaticResourceFactory<R> staticResourceFactory, StaticResourceCorsConfigFactory staticResourceCorsConfigFactory, StaticResourceCacheConfigFactory staticResourceCacheConfigFactory, org.spincast.core.config.SpincastConfig spincastConfig, org.spincast.core.utils.SpincastUtils spincastUtils, SpincastRouterConfig spincastRouterConfig) StaticResourceBuilderDefault(org.spincast.core.routing.Router<R, W> router, boolean isDir, org.spincast.core.routing.StaticResourceFactory<R> staticResourceFactory, StaticResourceCorsConfigFactory staticResourceCorsConfigFactory, StaticResourceCacheConfigFactory staticResourceCacheConfigFactory, org.spincast.core.config.SpincastConfig spincastConfig, org.spincast.core.utils.SpincastUtils spincastUtils, SpincastRouterConfig spincastRouterConfig) -
Method Summary
Modifier and TypeMethodDescriptionorg.spincast.core.routing.StaticResourceBuilder<R>cache(int seconds) org.spincast.core.routing.StaticResourceBuilder<R>cache(int seconds, boolean isCachePrivate) org.spincast.core.routing.StaticResourceBuilder<R>org.spincast.core.routing.StaticResourceBuilder<R>org.spincast.core.routing.StaticResourceBuilder<R>cors()org.spincast.core.routing.StaticResourceBuilder<R>org.spincast.core.routing.StaticResourceBuilder<R>org.spincast.core.routing.StaticResourceBuilder<R>cors(Set<String> allowedOrigins, Set<String> extraHeadersAllowedToBeRead, Set<String> extraHeadersAllowedToBeSent) org.spincast.core.routing.StaticResourceBuilder<R>cors(Set<String> allowedOrigins, Set<String> extraHeadersAllowedToBeRead, Set<String> extraHeadersAllowedToBeSent, boolean allowCookies) org.spincast.core.routing.StaticResourceBuilder<R>cors(Set<String> allowedOrigins, Set<String> extraHeadersAllowedToBeRead, Set<String> extraHeadersAllowedToBeSent, boolean allowCookies, int maxAgeInSeconds) org.spincast.core.routing.StaticResource<R>create()protected Integerorg.spincast.core.routing.StaticResourceCacheConfigorg.spincast.core.routing.StaticResourceCorsConfigThe origins allowed, by default.The extra headers allowed to be read, by default,The extra headers allowed to be sent, by default,protected booleanAre cookies allowed by default?protected intIf <= 0, the "Access-Control-Max-Age" header won't be sent.protected org.spincast.core.routing.StaticResourceCacheConfigThe default cache configurations to use if it is not specified.org.spincast.core.routing.Handler<R>org.spincast.core.routing.hotlinking.HotlinkingManagergetPath()protected org.spincast.core.config.SpincastConfigprotected SpincastRouterConfigprotected org.spincast.core.utils.SpincastUtilsprotected StaticResourceCacheConfigFactoryprotected StaticResourceCorsConfigFactoryprotected org.spincast.core.routing.StaticResourceFactory<R>getUrl()voidhandle()voidvoidorg.spincast.core.routing.StaticResourceBuilder<R>org.spincast.core.routing.StaticResourceBuilder<R>hotlinkingProtected(org.spincast.core.routing.hotlinking.HotlinkingManager hotlinkingManager) protected booleanIs the cache private by default?booleanprotected booleanisDir()booleanbooleanprotected booleanorg.spincast.core.routing.StaticResourceBuilder<R>pathAbsolute(String absolutePath) org.spincast.core.routing.StaticResourceBuilder<R>pathRelative(String relativePath) org.spincast.core.routing.StaticResourceBuilder<R>org.spincast.core.routing.StaticResourceBuilder<R>
-
Field Details
-
logger
protected static final org.slf4j.Logger logger
-
-
Constructor Details
-
StaticResourceBuilderDefault
public StaticResourceBuilderDefault(boolean isDir, org.spincast.core.routing.StaticResourceFactory<R> staticResourceFactory, StaticResourceCorsConfigFactory staticResourceCorsConfigFactory, StaticResourceCacheConfigFactory staticResourceCacheConfigFactory, org.spincast.core.config.SpincastConfig spincastConfig, org.spincast.core.utils.SpincastUtils spincastUtils, SpincastRouterConfig spincastRouterConfig) -
StaticResourceBuilderDefault
public StaticResourceBuilderDefault(org.spincast.core.routing.Router<R, W> router, boolean isDir, org.spincast.core.routing.StaticResourceFactory<R> staticResourceFactory, StaticResourceCorsConfigFactory staticResourceCorsConfigFactory, StaticResourceCacheConfigFactory staticResourceCacheConfigFactory, org.spincast.core.config.SpincastConfig spincastConfig, org.spincast.core.utils.SpincastUtils spincastUtils, SpincastRouterConfig spincastRouterConfig)
-
-
Method Details
-
isDir
protected boolean isDir() -
isSpicastOrPluginAddedResource
protected boolean isSpicastOrPluginAddedResource() -
getRouter
-
getStaticResourceFactory
-
getStaticResourceCorsConfigFactory
-
getStaticResourceCacheConfigFactory
-
getSpincastConfig
protected org.spincast.core.config.SpincastConfig getSpincastConfig() -
getSpincastUtils
protected org.spincast.core.utils.SpincastUtils getSpincastUtils() -
getSpincastRouterConfig
-
getUrl
-
getPath
-
isHotlinkingProtected
public boolean isHotlinkingProtected() -
getHotlinkingManager
public org.spincast.core.routing.hotlinking.HotlinkingManager getHotlinkingManager() -
isClasspath
public boolean isClasspath() -
getGenerator
-
getCorsConfig
public org.spincast.core.routing.StaticResourceCorsConfig getCorsConfig() -
getCacheConfig
public org.spincast.core.routing.StaticResourceCacheConfig getCacheConfig() -
isIgnoreQueryString
public boolean isIgnoreQueryString() -
spicastOrPluginAddedResource
- Specified by:
spicastOrPluginAddedResourcein interfaceorg.spincast.core.routing.StaticResourceBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
-
url
- Specified by:
urlin interfaceorg.spincast.core.routing.StaticResourceBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
-
classpath
- Specified by:
classpathin interfaceorg.spincast.core.routing.StaticResourceBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
-
pathAbsolute
- Specified by:
pathAbsolutein interfaceorg.spincast.core.routing.StaticResourceBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
-
pathRelative
- Specified by:
pathRelativein interfaceorg.spincast.core.routing.StaticResourceBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
-
cors
- Specified by:
corsin interfaceorg.spincast.core.routing.StaticResourceBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
-
cors
- Specified by:
corsin interfaceorg.spincast.core.routing.StaticResourceBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
-
cors
public org.spincast.core.routing.StaticResourceBuilder<R> cors(Set<String> allowedOrigins, Set<String> extraHeadersAllowedToBeRead) - Specified by:
corsin interfaceorg.spincast.core.routing.StaticResourceBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
-
cors
public org.spincast.core.routing.StaticResourceBuilder<R> cors(Set<String> allowedOrigins, Set<String> extraHeadersAllowedToBeRead, Set<String> extraHeadersAllowedToBeSent) - Specified by:
corsin interfaceorg.spincast.core.routing.StaticResourceBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
-
cors
public org.spincast.core.routing.StaticResourceBuilder<R> cors(Set<String> allowedOrigins, Set<String> extraHeadersAllowedToBeRead, Set<String> extraHeadersAllowedToBeSent, boolean allowCookies) - Specified by:
corsin interfaceorg.spincast.core.routing.StaticResourceBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
-
cors
public org.spincast.core.routing.StaticResourceBuilder<R> cors(Set<String> allowedOrigins, Set<String> extraHeadersAllowedToBeRead, Set<String> extraHeadersAllowedToBeSent, boolean allowCookies, int maxAgeInSeconds) - Specified by:
corsin interfaceorg.spincast.core.routing.StaticResourceBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
-
getCorsDefaultMaxAgeInSeconds
protected int getCorsDefaultMaxAgeInSeconds()If <= 0, the "Access-Control-Max-Age" header won't be sent. -
getCorsDefaultAllowedOrigins
The origins allowed, by default. -
getCorsDefaultExtraHeadersAllowedToBeRead
The extra headers allowed to be read, by default, -
getCorsDefaultExtraHeadersAllowedToBeSent
The extra headers allowed to be sent, by default, -
getCorsDefaultIsCookiesAllowed
protected boolean getCorsDefaultIsCookiesAllowed()Are cookies allowed by default? -
isCachePrivateDefault
protected boolean isCachePrivateDefault()Is the cache private by default? -
getCacheCdnSecondsDefault
-
cache
- Specified by:
cachein interfaceorg.spincast.core.routing.StaticResourceBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
-
cache
public org.spincast.core.routing.StaticResourceBuilder<R> cache(int seconds, boolean isCachePrivate) - Specified by:
cachein interfaceorg.spincast.core.routing.StaticResourceBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
-
cache
public org.spincast.core.routing.StaticResourceBuilder<R> cache(int seconds, boolean isCachePrivate, Integer cdnSeconds) - Specified by:
cachein interfaceorg.spincast.core.routing.StaticResourceBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
-
handle
public void handle()- Specified by:
handlein interfaceorg.spincast.core.routing.StaticResourceBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
-
handle
- Specified by:
handlein interfaceorg.spincast.core.routing.StaticResourceBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
-
handle
- Specified by:
handlein interfaceorg.spincast.core.routing.StaticResourceBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
-
create
- Specified by:
createin interfaceorg.spincast.core.routing.StaticResourceBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
-
getDefaultCacheConfig
protected org.spincast.core.routing.StaticResourceCacheConfig getDefaultCacheConfig()The default cache configurations to use if it is not specified. It can still benulland, in that case, no cache header will be used. -
hotlinkingProtected
- Specified by:
hotlinkingProtectedin interfaceorg.spincast.core.routing.StaticResourceBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
-
hotlinkingProtected
public org.spincast.core.routing.StaticResourceBuilder<R> hotlinkingProtected(org.spincast.core.routing.hotlinking.HotlinkingManager hotlinkingManager) - Specified by:
hotlinkingProtectedin interfaceorg.spincast.core.routing.StaticResourceBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
-