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
Specifies a http redirect (moved permanently) to
a
Media
.
Common usage is to maintain old urls after renaming a Media
.
For instance, if there is a media picture
:
static final Media picture = new Media(OPTIONAL);and this media is renamed to
image
:
static final Media image = new Media(OPTIONAL);then old urls created by
picture
can be supported with an additional:
static final MediaRedirect picture = new MediaRedirect(image);
- Author:
- Ralf Wiebicke
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.exedio.cope.pattern.MediaPath
MediaPath.Locator, MediaPath.Log, MediaPath.NotFound
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
doGetAndCommit
(HttpServletRequest request, HttpServletResponse response, Item item) The implementor MUSTcommit
the transaction, if the method completes normally (without exception).getContentType
(Item item) boolean
boolean
A MediaPath is "mandatory" ifMediaPath.getContentType(Item)
andMediaPath.getLocator(Item)
will not returnnull
for any item.Returns a condition matching all items, for whichMediaPath.getLocator(Item)
does not return null.Returns a condition matching all items, for whichMediaPath.getLocator(Item)
does not return null.isNull()
Returns a condition matching all items, for whichMediaPath.getLocator(Item)
returns null.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 Details
-
MediaRedirect
Deprecated.UseRedirectFrom
instead
-
-
Method Details
-
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
- 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
Description copied from class:MediaPath
Returns a condition matching all items, for whichMediaPath.getLocator(Item)
returns null. -
isNull
Description copied from class:MediaPath
Returns a condition matching all items, for whichMediaPath.getLocator(Item)
returns null. -
isNotNull
Description copied from class:MediaPath
Returns a condition matching all items, for whichMediaPath.getLocator(Item)
does not return null. -
isNotNull
Description copied from class:MediaPath
Returns a condition matching all items, for whichMediaPath.getLocator(Item)
does not return null.
-
RedirectFrom
instead