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
public abstract class MediaPath extends Pattern
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
MediaPath.Locator
Represents a resource to be delivered the media servlet.static class
MediaPath.Log
Deprecated.static class
MediaPath.NotFound
-
Constructor Summary
Constructors Constructor Description MediaPath()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected 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)
List<MediaRequestLog>
getExceptionLogs()
List<MediaRequestLog>
getGuessedUrlLogs()
MediaInfo
getInfo()
List<MediaRequestLog>
getInvalidSpecialLogs()
List<MediaRequestLog>
getIsNullLogs()
Date
getLastModified(Item item)
The default implementation returns null.MediaPath.Locator
getLocator(Item item)
Returns a locator the content of this media path is available under, if aMediaServlet
is properly installed.String
getNamedURL(Item item, String name)
Deprecated.List<MediaRequestLog>
getNoSuchItemLogs()
static int
getNoSuchPath()
static List<MediaRequestLog>
getNoSuchPathLogs()
List<MediaRequestLog>
getNotAnItemLogs()
List<MediaRequestLog>
getNotComputableLogs()
String
getURL(Item item)
Returns a URL the content of this media path is available under, if aMediaServlet
is properly installed.void
incrementDelivered()
For testing only.boolean
isContentTypeWrapped()
boolean
isFinal()
Returns, whether the contents of this media path may change or not.abstract boolean
isMandatory()
A MediaPath is "mandatory" ifgetContentType(Item)
andgetLocator(Item)
will not returnnull
for any item.Condition
isNotNull()
Returns a condition matching all items, for whichgetLocator(Item)
does not return null.Condition
isNotNull(Join join)
Returns a condition matching all items, for whichgetLocator(Item)
does not return null.Condition
isNull()
Returns a condition matching all items, for whichgetLocator(Item)
returns null.Condition
isNull(Join join)
Returns a condition matching all items, for whichgetLocator(Item)
returns null.boolean
isUrlFingerPrinted()
boolean
isUrlGuessingPrevented()
static boolean
isUrlGuessingPreventedSecurely(ConnectProperties properties)
protected MediaPath.NotFound
notFoundIsNull()
protected MediaPath.NotFound
notFoundNotComputable()
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
-
-
-
-
Method Detail
-
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
public final MediaPath.Locator getLocator(@Nonnull Item item)
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
public final String getURL(@Nonnull Item item)
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:
MediaPath.Locator.getURLByConnect()
-
isUrlGuessingPreventedSecurely
public static final boolean isUrlGuessingPreventedSecurely(ConnectProperties properties)
-
notFoundIsNull
protected final MediaPath.NotFound notFoundIsNull()
-
notFoundNotComputable
protected final MediaPath.NotFound notFoundNotComputable()
-
getNoSuchPath
public static final int getNoSuchPath()
-
getInfo
public final MediaInfo getInfo()
-
incrementDelivered
public final void incrementDelivered()
For testing only. TODO
-
getNoSuchPathLogs
public static final List<MediaRequestLog> getNoSuchPathLogs()
-
getExceptionLogs
public final List<MediaRequestLog> getExceptionLogs()
-
getInvalidSpecialLogs
public final List<MediaRequestLog> getInvalidSpecialLogs()
-
getGuessedUrlLogs
public final List<MediaRequestLog> getGuessedUrlLogs()
-
getNotAnItemLogs
public final List<MediaRequestLog> getNotAnItemLogs()
-
getNoSuchItemLogs
public final List<MediaRequestLog> getNoSuchItemLogs()
-
getIsNullLogs
public final List<MediaRequestLog> getIsNullLogs()
-
getNotComputableLogs
public final List<MediaRequestLog> 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.
-
isFinal
public boolean isFinal()
Returns, whether the contents of this media path may change or not. The default implementation returns false.
-
getLastModified
public Date getLastModified(Item item)
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
public Condition isNull()
Returns a condition matching all items, for whichgetLocator(Item)
returns null.- Throws:
UnsupportedOperationException
- if the condition is not supported by this path
-
isNull
public Condition isNull(Join join)
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
public Condition 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
public Condition isNotNull(Join join)
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 public final String getNamedURL(Item item, String name)
Deprecated.- Parameters:
name
- is ignored
-
-