public.javadoc.org.spincast.plugins.routing.StaticResourceDefault.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spincast-website Show documentation
Show all versions of spincast-website Show documentation
Source code for the https://www.spincast.org website.
StaticResourceDefault (org.spincast:spincast-framework 1.14.0 API)
org.spincast.plugins.routing
Class StaticResourceDefault<R extends RequestContext<?>>
- java.lang.Object
-
- org.spincast.plugins.routing.StaticResourceDefault<R>
-
- All Implemented Interfaces:
- StaticResource<R>
public class StaticResourceDefault<R extends RequestContext<?>>
extends Object
implements StaticResource<R>
Represents a static resource.
-
-
Constructor Summary
Constructors
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)
-
Method Summary
All Methods Instance Methods Concrete Methods
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()
-
-
Constructor Detail
-
StaticResourceDefault
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)
-
Method Detail
-
getSpincastUtils
protected SpincastUtils getSpincastUtils()
-
isSpicastOrPluginAddedResource
public boolean isSpicastOrPluginAddedResource()
Description copied from interface: StaticResource
Is this a resource added by Spincast itself
or by a plugin? Otherwise, the resource is
considered as an application resource.
- Specified by:
isSpicastOrPluginAddedResource
in interface StaticResource<R extends RequestContext<?>>
-
getStaticResourceType
public StaticResourceType getStaticResourceType()
Description copied from interface: StaticResource
The type of static resource.
- Specified by:
getStaticResourceType
in interface StaticResource<R extends RequestContext<?>>
-
getUrlPath
public String getUrlPath()
Description copied from interface: StaticResource
The URL to reach this static resource.
- Specified by:
getUrlPath
in interface StaticResource<R extends RequestContext<?>>
-
getResourcePath
public String getResourcePath()
Description copied from interface: StaticResource
The path of the resource on the classpath or on the
file system.
- Specified by:
getResourcePath
in interface StaticResource<R extends RequestContext<?>>
-
isCanBeGenerated
public boolean isCanBeGenerated()
Description copied from interface: StaticResource
Can this resource be generated?
- Specified by:
isCanBeGenerated
in interface StaticResource<R extends RequestContext<?>>
-
getGenerator
public Handler<R> getGenerator()
Description copied from interface: StaticResource
The generator to call to generate this resource if it
doesn't exist yet.
- Specified by:
getGenerator
in interface StaticResource<R extends RequestContext<?>>
- Returns:
- the generator or
null
if there are none.
-
getCorsConfig
public StaticResourceCorsConfig getCorsConfig()
Description copied from interface: StaticResource
The cors configurations for the static resource.
If null
, cors won't be enabled for that
resource.
- Specified by:
getCorsConfig
in interface StaticResource<R extends RequestContext<?>>
-
getCacheConfig
public StaticResourceCacheConfig getCacheConfig()
Description copied from interface: StaticResource
The cache configurations for the static resource.
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.
- Specified by:
getCacheConfig
in interface StaticResource<R extends RequestContext<?>>
-
isFileResource
public boolean isFileResource()
Description copied from interface: StaticResource
Is the resource a file?
- Specified by:
isFileResource
in interface StaticResource<R extends RequestContext<?>>
-
isDirResource
public boolean isDirResource()
Description copied from interface: StaticResource
Is the resource a directory?
- Specified by:
isDirResource
in interface StaticResource<R extends RequestContext<?>>
-
isClasspath
public boolean isClasspath()
Description copied from interface: StaticResource
Is the resource on the classpath?
- Specified by:
isClasspath
in interface StaticResource<R extends RequestContext<?>>
-
isFileSytem
public boolean isFileSytem()
Description copied from interface: StaticResource
Is the resource on the file system?
- Specified by:
isFileSytem
in interface StaticResource<R extends RequestContext<?>>
-
isIgnoreQueryString
public boolean isIgnoreQueryString()
Description copied from interface: StaticResource
If true
, 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.
- Specified by:
isIgnoreQueryString
in interface StaticResource<R extends RequestContext<?>>
-
isHotlinkingProtected
public boolean isHotlinkingProtected()
Description copied from interface: StaticResource
Is the resource hotlinking protected?
- Specified by:
isHotlinkingProtected
in interface StaticResource<R extends RequestContext<?>>
-
getHotlinkingManager
public HotlinkingManager getHotlinkingManager()
Description copied from interface: StaticResource
If a static resource is hotlinking protected
(StaticResource.isHotlinkingProtected()
), then this is the
component responsible to that protection.
Will be null
if the resource
is not hotlinking protected.
- Specified by:
getHotlinkingManager
in interface StaticResource<R extends RequestContext<?>>
Copyright © 2019. All rights reserved.