public.javadoc.org.spincast.core.routing.StaticResource.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.
StaticResource (org.spincast:spincast-framework 1.0.0 API)
org.spincast.core.routing
Interface StaticResource<R extends RequestContext<?>>
-
- All Known Implementing Classes:
- StaticResourceDefault
public interface StaticResource<R extends RequestContext<?>>
A static resource, from the classpath or the
file system.
A static resource is served directly
by the HTTP server. But if the resource is not found
and a generator
exists, then the server will call
the framework instead of returning 404.
-
-
Method Summary
All Methods Instance Methods Abstract 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
(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.
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.
-
-
Method Detail
-
isSpicastOrPluginAddedResource
boolean isSpicastOrPluginAddedResource()
Is this a resource added by Spincast itself
or by a plugin? Otherwise, the resource is
considered as an application resource.
-
getStaticResourceType
StaticResourceType getStaticResourceType()
The type of static resource.
-
getUrlPath
String getUrlPath()
The URL to reach this static resource.
-
getResourcePath
String getResourcePath()
The path of the resource on the classpath or on the
file system.
-
getGenerator
Handler<R> getGenerator()
The generator to call to generate this resource if it
doesn't exist yet.
- Returns:
- the generator or
null
if there are none.
-
isIgnoreQueryString
boolean isIgnoreQueryString()
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.
-
isHotlinkingProtected
boolean isHotlinkingProtected()
Is the resource hotlinking protected?
-
getHotlinkingManager
HotlinkingManager getHotlinkingManager()
If a static resource is hotlinking protected
(isHotlinkingProtected()
), then this is the
component responsible to that protection.
Will be null
if the resource
is not hotlinking protected.
-
getCorsConfig
StaticResourceCorsConfig getCorsConfig()
The cors configurations for the static resource.
If null
, cors won't be enabled for that
resource.
-
getCacheConfig
StaticResourceCacheConfig getCacheConfig()
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.
-
isClasspath
boolean isClasspath()
Is the resource on the classpath?
-
isFileSytem
boolean isFileSytem()
Is the resource on the file system?
-
isFileResource
boolean isFileResource()
Is the resource a file?
-
isDirResource
boolean isDirResource()
Is the resource a directory?
-
isCanBeGenerated
boolean isCanBeGenerated()
Can this resource be generated?
Copyright © 2019. All rights reserved.