public class StaticResourceDefault<R extends RequestContext<?>> extends Object implements StaticResource<R>
| Constructor and Description |
|---|
StaticResourceDefault(boolean isSpicastOrPluginAddedResource,
StaticResourceType staticResourceType,
String urlPath,
String resourcePath,
Handler<R> generator,
StaticResourceCorsConfig corsConfig,
StaticResourceCacheConfig cacheConfig,
boolean ignoreQueryString,
boolean hotlinkingProtected,
HotlinkingManager hotlinkingManager,
SpincastUtils spincastUtils,
HotlinkingManagerDefault hotlinkingManagerDefault) |
| Modifier and Type | Method and Description |
|---|---|
StaticResourceCacheConfig |
getCacheConfig()
The cache configurations for the static resource.
|
StaticResourceCorsConfig |
getCorsConfig()
The cors configurations for the static resource.
|
Handler<R> |
getGenerator()
The generator to call to generate this resource if it
doesn't exist yet.
|
HotlinkingManager |
getHotlinkingManager()
If a static resource is hotlinking protected
(
StaticResource.isHotlinkingProtected()), then this is the
component responsible to that protection. |
String |
getResourcePath()
The path of the resource on the classpath or on the
file system.
|
protected SpincastUtils |
getSpincastUtils() |
StaticResourceType |
getStaticResourceType()
The type of static resource.
|
String |
getUrlPath()
The URL to reach this static resource.
|
boolean |
isCanBeGenerated()
Can this resource be generated?
|
boolean |
isClasspath()
Is the resource on the classpath?
|
boolean |
isDirResource()
Is the resource a directory?
|
boolean |
isFileResource()
Is the resource a file?
|
boolean |
isFileSytem()
Is the resource on the file system?
|
boolean |
isHotlinkingProtected()
Is the resource hotlinking protected?
|
boolean |
isIgnoreQueryString()
If
true, only one
instance of the resource will be generated and cached. |
boolean |
isSpicastOrPluginAddedResource()
Is this a resource added by Spincast itself
or by a plugin? Otherwise, the resource is
considered as an application resource.
|
String |
toString() |
public StaticResourceDefault(boolean isSpicastOrPluginAddedResource,
StaticResourceType staticResourceType,
String urlPath,
String resourcePath,
@Nullable
Handler<R> generator,
@Nullable
StaticResourceCorsConfig corsConfig,
@Nullable
StaticResourceCacheConfig cacheConfig,
boolean ignoreQueryString,
boolean hotlinkingProtected,
@Nullable
HotlinkingManager hotlinkingManager,
SpincastUtils spincastUtils,
HotlinkingManagerDefault hotlinkingManagerDefault)
protected SpincastUtils getSpincastUtils()
public boolean isSpicastOrPluginAddedResource()
StaticResourceisSpicastOrPluginAddedResource in interface StaticResource<R extends RequestContext<?>>public StaticResourceType getStaticResourceType()
StaticResourcegetStaticResourceType in interface StaticResource<R extends RequestContext<?>>public String getUrlPath()
StaticResourcegetUrlPath in interface StaticResource<R extends RequestContext<?>>public String getResourcePath()
StaticResourcegetResourcePath in interface StaticResource<R extends RequestContext<?>>public boolean isCanBeGenerated()
StaticResourceisCanBeGenerated in interface StaticResource<R extends RequestContext<?>>public Handler<R> getGenerator()
StaticResourcegetGenerator in interface StaticResource<R extends RequestContext<?>>null if there are none.public StaticResourceCorsConfig getCorsConfig()
StaticResource
If null, cors won't be enabled for that
resource.
getCorsConfig in interface StaticResource<R extends RequestContext<?>>public StaticResourceCacheConfig getCacheConfig()
StaticResource
If null, no caching headers will be sent,
but the last modification-date of the resource will be
validated and 304 - Not modified will be
returned if applicable.
getCacheConfig in interface StaticResource<R extends RequestContext<?>>public boolean isFileResource()
StaticResourceisFileResource in interface StaticResource<R extends RequestContext<?>>public boolean isDirResource()
StaticResourceisDirResource in interface StaticResource<R extends RequestContext<?>>public boolean isClasspath()
StaticResourceisClasspath in interface StaticResource<R extends RequestContext<?>>public boolean isFileSytem()
StaticResourceisFileSytem in interface StaticResource<R extends RequestContext<?>>public boolean isIgnoreQueryString()
StaticResourcetrue, only one
instance of the resource will be generated and cached. If
false (the default), the resource will always be
generated if there is a queryString.isIgnoreQueryString in interface StaticResource<R extends RequestContext<?>>public boolean isHotlinkingProtected()
StaticResourceisHotlinkingProtected in interface StaticResource<R extends RequestContext<?>>public HotlinkingManager getHotlinkingManager()
StaticResourceStaticResource.isHotlinkingProtected()), then this is the
component responsible to that protection.
Will be null if the resource
is not hotlinking protected.
getHotlinkingManager in interface StaticResource<R extends RequestContext<?>>Copyright © 2019. All rights reserved.