public class ERS3AttachmentProcessor extends ERAttachmentProcessor<ERS3Attachment>
Name | Description |
---|---|
er.attachment.[configurationName].s3.bucket | er.attachment.[configurationName].s3.bucket |
er.attachment.s3.bucket | er.attachment.s3.bucket |
er.attachment.[configurationName].s3.key | er.attachment.[configurationName].s3.key |
er.attachment.s3.key | er.attachment.s3.key |
er.attachment.[configurationName].s3.accessKeyID | er.attachment.[configurationName].s3.accessKeyID |
er.attachment.s3.accessKeyID | er.attachment.s3.accessKeyID |
er.attachment.[configurationName].s3.secretAccessKey | er.attachment.[configurationName].s3.secretAccessKey |
er.attachment.s3.secretAccessKey | er.attachment.s3.secretAccessKey |
Modifier and Type | Class and Description |
---|---|
class |
ERS3AttachmentProcessor.ERS3UploadQueue |
ERAttachmentProcessor.ERXAttachmentExceedsLengthException
Modifier and Type | Field and Description |
---|---|
static String |
S3_URL |
log
Constructor and Description |
---|
ERS3AttachmentProcessor() |
Modifier and Type | Method and Description |
---|---|
ERS3Attachment |
_process(com.webobjects.eocontrol.EOEditingContext editingContext,
File uploadedFile,
String recommendedFileName,
String mimeType,
String configurationName,
String ownerID,
boolean pendingDelete)
Processes an uploaded file, imports it into the appropriate data store, and returns an ERAttachment that
represents it.
|
InputStream |
attachmentInputStream(ERS3Attachment attachment)
Returns an InputStream to the data of the given attachment.
|
void |
attachmentInserted(ERS3Attachment attachment)
Called after an attachment has been inserted (from didInsert).
|
String |
attachmentUrl(ERS3Attachment attachment,
com.webobjects.appserver.WORequest request,
com.webobjects.appserver.WOContext context)
Returns a URL to the attachment's data.
|
void |
deleteAttachment(ERS3Attachment attachment)
Deletes the attachment from the data store.
|
protected boolean |
failed(com.amazon.s3.Response response) |
void |
performUpload(File uploadedFile,
String originalFileName,
String bucket,
String key,
String mimeType,
ERS3Attachment attachment) |
_parsePathTemplate, addAttachmentProcessorForType, delegate, process, process, process, process, process, process, processorForConfigurationName, processorForType, processorForType, processors, proxiedUrl, proxyAsAttachment, setDelegate
public static final String S3_URL
public ERS3Attachment _process(com.webobjects.eocontrol.EOEditingContext editingContext, File uploadedFile, String recommendedFileName, String mimeType, String configurationName, String ownerID, boolean pendingDelete)
ERAttachmentProcessor
_process
in class ERAttachmentProcessor<ERS3Attachment>
editingContext
- the EOEditingContext to create the ERAttachment inuploadedFile
- the uploaded temporary file (which will be deleted at the end)recommendedFileName
- the filename recommended by the user during importmimeType
- the mimeType to use (null = guess based on file extension)configurationName
- the name of the configuration settings to use for this processor (see top level docs)ownerID
- an arbitrary string that represents the ID of the "owner" of this thumbnail (Person.primaryKey, for instance)pendingDelete
- if true, the uploadedFile will be deleted after import; if false, it will be left alonepublic InputStream attachmentInputStream(ERS3Attachment attachment) throws IOException
ERAttachmentProcessor
attachmentInputStream
in class ERAttachmentProcessor<ERS3Attachment>
attachment
- the attachment to retrieve the data forIOException
- if the stream cannot be createdpublic String attachmentUrl(ERS3Attachment attachment, com.webobjects.appserver.WORequest request, com.webobjects.appserver.WOContext context)
ERAttachmentProcessor
attachmentUrl
in class ERAttachmentProcessor<ERS3Attachment>
attachment
- the attachment to generate a URL forrequest
- the current requestcontext
- the current contextpublic void deleteAttachment(ERS3Attachment attachment) throws MalformedURLException, IOException
ERAttachmentProcessor
deleteAttachment
in class ERAttachmentProcessor<ERS3Attachment>
attachment
- the attachment to deleteIOException
- if the delete failsMalformedURLException
public void attachmentInserted(ERS3Attachment attachment)
ERAttachmentProcessor
attachmentInserted
in class ERAttachmentProcessor<ERS3Attachment>
attachment
- the inserted attachmentpublic void performUpload(File uploadedFile, String originalFileName, String bucket, String key, String mimeType, ERS3Attachment attachment) throws MalformedURLException, IOException
MalformedURLException
IOException
protected boolean failed(com.amazon.s3.Response response) throws IOException
IOException
Copyright © 2002 – 2020 Project Wonder.