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 class
Represents a resource to be delivered the media servlet.static final class
Deprecated.static final class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final void
commit()
abstract void
doGetAndCommit
(HttpServletRequest request, HttpServletResponse response, Item item) The implementor MUSTcommit
the transaction, if the method completes normally (without exception).abstract String
getContentType
(Item item) final List<MediaRequestLog>
final List<MediaRequestLog>
final MediaInfo
getInfo()
final List<MediaRequestLog>
final List<MediaRequestLog>
getLastModified
(Item item) The default implementation returns null.final MediaPath.Locator
getLocator
(Item item) Returns a locator the content of this media path is available under, if aMediaServlet
is properly installed.final String
getNamedURL
(Item item, String name) Deprecated.final List<MediaRequestLog>
static final int
static final List<MediaRequestLog>
final List<MediaRequestLog>
final List<MediaRequestLog>
final String
Returns a URL the content of this media path is available under, if aMediaServlet
is properly installed.final void
For testing only.boolean
boolean
isFinal()
Returns, whether the contents of this media path may change or not.abstract boolean
A MediaPath is "mandatory" ifgetContentType(Item)
andgetLocator(Item)
will not returnnull
for 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 boolean
final boolean
static final boolean
isUrlGuessingPreventedSecurely
(ConnectProperties properties) protected final MediaPath.NotFound
protected final MediaPath.NotFound
protected void
onMount()
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, 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
-
MediaPath
public MediaPath()
-
-
Method Details
-
onMount
protected void onMount()Description copied from class:Pattern
Here 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 aMediaServlet
is properly installed. Returns null, if there is no such content. -
getURL
Returns a URL the content of this media path is available under, if aMediaServlet
is 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 returnnull
for 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 MUSTcommit
the transaction, if the method completes normally (without exception). Otherwise the implementor may or may not commit the transaction.- Throws:
IOException
MediaPath.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.