public.javadoc.org.spincast.core.routing.hotlinking.HotlinkingManagerDefault.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.
HotlinkingManagerDefault (org.spincast:spincast-framework 1.0.0 API)
org.spincast.core.routing.hotlinking
Class HotlinkingManagerDefault
- java.lang.Object
-
- org.spincast.core.routing.hotlinking.HotlinkingManagerDefault
-
- All Implemented Interfaces:
- HotlinkingManager
public class HotlinkingManagerDefault
extends Object
implements HotlinkingManager
Default HotlinkingManager
. Will return
a FORBIDDEN
status code.
-
-
Constructor Summary
Constructors
Constructor and Description
HotlinkingManagerDefault(SpincastConfig spincastConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
HotlinkingStategy
getHotlinkingStategy(Object serverExchange,
URI resourceURI,
StaticResource<?> resource)
The strategy to use to protect the hotlinked resource.
String
getRedirectUrl(Object serverExchange,
URI resourceURI,
StaticResource<?> resource)
The URL to redirect the protected resource when the
HotlinkingManager.getHotlinkingStategy(Object, URI, StaticResource)
returns
HotlinkingStategy.REDIRECT
.
protected SpincastConfig
getSpincastConfig()
protected boolean
isHostAndRefererValid(Object serverExchange,
URI resourceUri,
String requestOriginHeader,
String requestRefererHeader,
StaticResource<?> resource)
boolean
mustHotlinkingProtect(Object serverExchange,
URI resourceUri,
String requestOriginHeader,
String requestRefererHeader,
StaticResource<?> resource)
This must return true
if the current
resource has to be hotlinking protected.
-
-
Constructor Detail
-
HotlinkingManagerDefault
@Inject
public HotlinkingManagerDefault(SpincastConfig spincastConfig)
-
Method Detail
-
getSpincastConfig
protected SpincastConfig getSpincastConfig()
-
getHotlinkingStategy
public HotlinkingStategy getHotlinkingStategy(Object serverExchange,
URI resourceURI,
StaticResource<?> resource)
Description copied from interface: HotlinkingManager
The strategy to use to protect the hotlinked resource.
- Specified by:
getHotlinkingStategy
in interface HotlinkingManager
-
getRedirectUrl
public String getRedirectUrl(Object serverExchange,
URI resourceURI,
StaticResource<?> resource)
Description copied from interface: HotlinkingManager
The URL to redirect the protected resource when the
HotlinkingManager.getHotlinkingStategy(Object, URI, StaticResource)
returns
HotlinkingStategy.REDIRECT
. Won't be used otherwise.
- Specified by:
getRedirectUrl
in interface HotlinkingManager
-
mustHotlinkingProtect
public boolean mustHotlinkingProtect(Object serverExchange,
URI resourceUri,
String requestOriginHeader,
String requestRefererHeader,
StaticResource<?> resource)
Description copied from interface: HotlinkingManager
This must return true
if the current
resource has to be hotlinking protected.
- Specified by:
mustHotlinkingProtect
in interface HotlinkingManager
-
isHostAndRefererValid
protected boolean isHostAndRefererValid(Object serverExchange,
URI resourceUri,
String requestOriginHeader,
String requestRefererHeader,
StaticResource<?> resource)
Copyright © 2019. All rights reserved.