public class ERAttachmentRequestHandler
extends com.webobjects.appserver.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 |
Constructor and Description |
---|
ERAttachmentRequestHandler() |
Modifier and Type | Method and Description |
---|---|
static ERAttachment |
fetchAttachmentFor(com.webobjects.eocontrol.EOEditingContext editingContext,
Integer attachmentPrimaryKey,
String requestedWebPath) |
com.webobjects.appserver.WOResponse |
handleRequest(com.webobjects.appserver.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.
|
public static final String REQUEST_HANDLER_KEY
public void setDelegate(ERAttachmentRequestHandler.Delegate delegate)
delegate
- the delegate for this request handlerpublic com.webobjects.appserver.WOResponse handleRequest(com.webobjects.appserver.WORequest request)
handleRequest
in class com.webobjects.appserver.WORequestHandler
public static ERAttachment fetchAttachmentFor(com.webobjects.eocontrol.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 – 2020 Project Wonder.