Package com.exedio.cope.pattern
Class MediaRedirect
- java.lang.Object
-
- com.exedio.cope.Feature
-
- com.exedio.cope.Pattern
-
- com.exedio.cope.pattern.MediaPath
-
- com.exedio.cope.pattern.MediaRedirect
-
- All Implemented Interfaces:
Serializable
public final class MediaRedirect extends MediaPath
Specifies a http redirect (moved permanently) to aMedia
.Common usage is to maintain old urls after renaming a
Media
. For instance, if there is a mediapicture
:static final Media picture = new Media(OPTIONAL);
and this media is renamed toimage
:static final Media image = new Media(OPTIONAL);
then old urls created bypicture
can be supported with an additional:static final MediaRedirect picture = new MediaRedirect(image);
- Author:
- Ralf Wiebicke
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.exedio.cope.pattern.MediaPath
MediaPath.Locator, MediaPath.Log, MediaPath.NotFound
-
-
Constructor Summary
Constructors Constructor Description MediaRedirect(MediaPath target)
Deprecated.UseRedirectFrom
instead
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doGetAndCommit(HttpServletRequest request, HttpServletResponse response, Item item)
The implementor MUSTcommit
the transaction, if the method completes normally (without exception).String
getContentType(Item item)
MediaPath
getTarget()
boolean
isContentTypeWrapped()
boolean
isMandatory()
A MediaPath is "mandatory" ifMediaPath.getContentType(Item)
andMediaPath.getLocator(Item)
will not returnnull
for any item.Condition
isNotNull()
Returns a condition matching all items, for whichMediaPath.getLocator(Item)
does not return null.Condition
isNotNull(Join join)
Returns a condition matching all items, for whichMediaPath.getLocator(Item)
does not return null.Condition
isNull()
Returns a condition matching all items, for whichMediaPath.getLocator(Item)
returns null.Condition
isNull(Join join)
Returns a condition matching all items, for whichMediaPath.getLocator(Item)
returns null.-
Methods inherited from class com.exedio.cope.pattern.MediaPath
commit, getExceptionLogs, getGuessedUrlLogs, getInfo, getInvalidSpecialLogs, getIsNullLogs, getLastModified, getLocator, getNamedURL, getNoSuchItemLogs, getNoSuchPath, getNoSuchPathLogs, getNotAnItemLogs, getNotComputableLogs, getURL, incrementDelivered, isFinal, isUrlFingerPrinted, isUrlGuessingPrevented, isUrlGuessingPreventedSecurely, notFoundIsNull, notFoundNotComputable, onMount
-
Methods inherited from class com.exedio.cope.Pattern
addSource, addSource, addSource, addSource, addSourceFeature, addSourceFeature, addSourceFeature, annotationField, equals, getGeneratedTypes, getSourceFeatures, getSourceFeaturesGather, getSourceFields, getSources, getSourceTypes, getType, hashCode, initialize, newSourceType, newSourceType, newSourceType, newSourceType, newSourceType, newSourceType, newType, newType, registerSource
-
Methods inherited from class com.exedio.cope.Feature
afterModelCreated, getAbstractType, getAnnotation, getID, getLocalizationKeys, getName, getPattern, isAnnotationPresent, isSourceAlready, mount, readResolve, requireMounted, toString, toString, writeReplace
-
-
-
-
Constructor Detail
-
MediaRedirect
@Deprecated public MediaRedirect(MediaPath target)
Deprecated.UseRedirectFrom
instead
-
-
Method Detail
-
getTarget
public MediaPath getTarget()
-
isMandatory
public boolean isMandatory()
Description copied from class:MediaPath
A MediaPath is "mandatory" ifMediaPath.getContentType(Item)
andMediaPath.getLocator(Item)
will not returnnull
for any item.- Specified by:
isMandatory
in classMediaPath
-
getContentType
public String getContentType(Item item)
- Specified by:
getContentType
in classMediaPath
-
isContentTypeWrapped
public boolean isContentTypeWrapped()
- Overrides:
isContentTypeWrapped
in classMediaPath
-
doGetAndCommit
public void doGetAndCommit(HttpServletRequest request, HttpServletResponse response, Item item) throws MediaPath.NotFound
Description copied from class:MediaPath
The implementor MUSTcommit
the transaction, if the method completes normally (without exception). Otherwise the implementor may or may not commit the transaction.- Specified by:
doGetAndCommit
in classMediaPath
- Throws:
MediaPath.NotFound
-
isNull
public Condition isNull()
Description copied from class:MediaPath
Returns a condition matching all items, for whichMediaPath.getLocator(Item)
returns null.
-
isNull
public Condition isNull(Join join)
Description copied from class:MediaPath
Returns a condition matching all items, for whichMediaPath.getLocator(Item)
returns null.
-
isNotNull
public Condition isNotNull()
Description copied from class:MediaPath
Returns a condition matching all items, for whichMediaPath.getLocator(Item)
does not return null.
-
-