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 TypeMethodDescriptionvoiddoGetAndCommit(HttpServletRequest request, HttpServletResponse response, Item item) The implementor MUSTcommitthe transaction, if the method completes normally (without exception).getContentType(Item item) booleanbooleanA MediaPath is "mandatory" ifMediaPath.getContentType(Item)andMediaPath.getLocator(Item)will not returnnullfor 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, onMountMethods 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, registerSourceMethods 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.UseRedirectFrominstead
-
-
Method Details
-
getTarget
-
isMandatory
public boolean isMandatory()Description copied from class:MediaPathA MediaPath is "mandatory" ifMediaPath.getContentType(Item)andMediaPath.getLocator(Item)will not returnnullfor any item.- Specified by:
isMandatoryin classMediaPath
-
getContentType
- Specified by:
getContentTypein classMediaPath
-
isContentTypeWrapped
public boolean isContentTypeWrapped()- Overrides:
isContentTypeWrappedin classMediaPath
-
doGetAndCommit
public void doGetAndCommit(HttpServletRequest request, HttpServletResponse response, Item item) throws MediaPath.NotFound Description copied from class:MediaPathThe implementor MUSTcommitthe transaction, if the method completes normally (without exception). Otherwise the implementor may or may not commit the transaction.- Specified by:
doGetAndCommitin classMediaPath- Throws:
MediaPath.NotFound
-
isNull
Description copied from class:MediaPathReturns a condition matching all items, for whichMediaPath.getLocator(Item)returns null. -
isNull
Description copied from class:MediaPathReturns a condition matching all items, for whichMediaPath.getLocator(Item)returns null. -
isNotNull
Description copied from class:MediaPathReturns a condition matching all items, for whichMediaPath.getLocator(Item)does not return null. -
isNotNull
Description copied from class:MediaPathReturns a condition matching all items, for whichMediaPath.getLocator(Item)does not return null.
-
RedirectFrominstead