public class ERAttachmentRequestHandler extends WORequestHandler
Modifier and Type | Class and Description |
---|---|
static interface |
ERAttachmentRequestHandler.Delegate
The delegate definition for this request handler.
|
Modifier and Type | Field and Description |
---|---|
static String |
REQUEST_HANDLER_KEY |
DidHandleRequestNotification
Constructor and Description |
---|
ERAttachmentRequestHandler() |
Modifier and Type | Method and Description |
---|---|
static ERAttachment |
fetchAttachmentFor(EOEditingContext editingContext,
Integer attachmentPrimaryKey,
String requestedWebPath) |
WOResponse |
handleRequest(WORequest request) |
static boolean |
requestedWebPathIsForAttachment(String requestedWebPath,
ERAttachment attachment)
Takes into account potential URL encoding differences between the
requestedWebPath and the
attachment 's webPath() attribute. |
void |
setDelegate(ERAttachmentRequestHandler.Delegate delegate)
Sets the delegate for this request handler.
|
toString
public static final String REQUEST_HANDLER_KEY
public void setDelegate(ERAttachmentRequestHandler.Delegate delegate)
delegate
- the delegate for this request handlerpublic WOResponse handleRequest(WORequest request)
handleRequest
in class WORequestHandler
public static ERAttachment fetchAttachmentFor(EOEditingContext editingContext, Integer attachmentPrimaryKey, String requestedWebPath)
editingContext
- the EOEditingContext
that the result will be inserted intoattachmentPrimaryKey
- the primaryKey value of an existing ERAttachment in the databaserequestedWebPath
- a URL-encoded portion of the requested ERAttachment path including the file name of the attachmentattachmentPrimaryKey
and the requestedWebPath
,
or just the reqestedWebPath
. If it is null then we throw a SecurityException.public static boolean requestedWebPathIsForAttachment(String requestedWebPath, ERAttachment attachment)
requestedWebPath
and the
attachment
's webPath()
attribute. e.g., "/the/web/path/My Attachment.jpg"
will match "/the/web/path/My%20Attachment.jpg"requestedWebPath
- a String to compare to the attachment
parameter'sattachment
- an ERAttachmenttrue
if the requestedWebPath
matches attachment.webPath()
. false
if not.Copyright © 2002 – 2024 Project Wonder.