Package com.exedio.cope.pattern
Class MediaPath
java.lang.Object
com.exedio.cope.Feature
com.exedio.cope.Pattern
com.exedio.cope.pattern.MediaPath
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
Media,MediaFilter,MediaRedirect
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classRepresents a resource to be delivered the media servlet.static final classDeprecated.static final class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidcommit()abstract voiddoGetAndCommit(HttpServletRequest request, HttpServletResponse response, Item item) The implementor MUSTcommitthe transaction, if the method completes normally (without exception).abstract StringgetContentType(Item item) final List<MediaRequestLog>final List<MediaRequestLog>final MediaInfogetInfo()final List<MediaRequestLog>final List<MediaRequestLog>getLastModified(Item item) The default implementation returns null.final MediaPath.LocatorgetLocator(Item item) Returns a locator the content of this media path is available under, if aMediaServletis properly installed.final StringgetNamedURL(Item item, String name) Deprecated.final List<MediaRequestLog>static final intstatic final List<MediaRequestLog>final List<MediaRequestLog>final List<MediaRequestLog>final StringReturns a URL the content of this media path is available under, if aMediaServletis properly installed.final voidFor testing only.booleanbooleanisFinal()Returns, whether the contents of this media path may change or not.abstract booleanA MediaPath is "mandatory" ifgetContentType(Item)andgetLocator(Item)will not returnnullfor any item.Returns a condition matching all items, for whichgetLocator(Item)does not return null.Returns a condition matching all items, for whichgetLocator(Item)does not return null.isNull()Returns a condition matching all items, for whichgetLocator(Item)returns null.Returns a condition matching all items, for whichgetLocator(Item)returns null.final booleanfinal booleanstatic final booleanisUrlGuessingPreventedSecurely(ConnectProperties properties) protected final MediaPath.NotFoundprotected final MediaPath.NotFoundprotected voidonMount()Here you can do additional initialization not yet done in the constructor.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, 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
-
MediaPath
public MediaPath()
-
-
Method Details
-
onMount
protected void onMount()Description copied from class:PatternHere you can do additional initialization not yet done in the constructor. In this method you can call methodsPattern.getType()andFeature.getName()for the first time. -
isUrlGuessingPrevented
public final boolean isUrlGuessingPrevented() -
isUrlFingerPrinted
public final boolean isUrlFingerPrinted() -
isContentTypeWrapped
public boolean isContentTypeWrapped() -
getLocator
Returns a locator the content of this media path is available under, if aMediaServletis properly installed. Returns null, if there is no such content. -
getURL
Returns a URL the content of this media path is available under, if aMediaServletis properly installed. Returns null, if there is no such content.- See Also:
-
isUrlGuessingPreventedSecurely
-
notFoundIsNull
-
notFoundNotComputable
-
getNoSuchPath
public static final int getNoSuchPath() -
getInfo
-
incrementDelivered
public final void incrementDelivered()For testing only. TODO -
getNoSuchPathLogs
-
getExceptionLogs
-
getInvalidSpecialLogs
-
getGuessedUrlLogs
-
getNotAnItemLogs
-
getNoSuchItemLogs
-
getIsNullLogs
-
getNotComputableLogs
-
commit
protected final void commit() -
isMandatory
public abstract boolean isMandatory()A MediaPath is "mandatory" ifgetContentType(Item)andgetLocator(Item)will not returnnullfor any item. -
getContentType
-
isFinal
public boolean isFinal()Returns, whether the contents of this media path may change or not. The default implementation returns false. -
getLastModified
The default implementation returns null.- Parameters:
item- the item which has the LastModified information
-
doGetAndCommit
public abstract void doGetAndCommit(HttpServletRequest request, HttpServletResponse response, Item item) throws IOException, MediaPath.NotFound The implementor MUSTcommitthe transaction, if the method completes normally (without exception). Otherwise the implementor may or may not commit the transaction.- Throws:
IOExceptionMediaPath.NotFound
-
isNull
Returns a condition matching all items, for whichgetLocator(Item)returns null.- Throws:
UnsupportedOperationException- if the condition is not supported by this path
-
isNull
Returns a condition matching all items, for whichgetLocator(Item)returns null.- Parameters:
join- the join the returned condition should be bound to- Throws:
UnsupportedOperationException- if the condition is not supported by this path
-
isNotNull
Returns a condition matching all items, for whichgetLocator(Item)does not return null.- Throws:
UnsupportedOperationException- if the condition is not supported by this path
-
isNotNull
Returns a condition matching all items, for whichgetLocator(Item)does not return null.- Parameters:
join- the join the returned condition should be bound to- Throws:
UnsupportedOperationException- if the condition is not supported by this path
-
getNamedURL
Deprecated.- Parameters:
name- is ignored
-
getURL(Item)andMediaUrlCatchphraseProvider.getMediaUrlCatchphrase(MediaPath)instead.