Project Wonder 5.0

er.attachment.processors
Class ERFileAttachmentProcessor

java.lang.Object
  extended by er.attachment.processors.ERAttachmentProcessor<ERFileAttachment>
      extended by er.attachment.processors.ERFileAttachmentProcessor

public class ERFileAttachmentProcessor
extends ERAttachmentProcessor<ERFileAttachment>

ERFileAttachmentProcessor implements storing attachments as files on the system that are either served via a proxy request handler or directly by the webserver. For more information about configuring an ERFileAttachmentProcessor, see the top level documentation.

Author:
mschrag
Properties
er.attachment.[configurationName].file.proxyer.attachment.[configurationName].file.proxy
           
er.attachment.file.proxyer.attachment.file.proxy
           
er.attachment.[configurationName].file.overwriteer.attachment.[configurationName].file.overwrite
           
er.attachment.file.overwriteer.attachment.file.overwrite
           
er.attachment.[configurationName].file.filesystemPath");er.attachment.[configurationName].file.filesystemPath");
           
er.attachment.file.filesystemPather.attachment.file.filesystemPath
           
er.attachment.[configurationName].file.webPath");er.attachment.[configurationName].file.webPath");
           
er.attachment.file.webPather.attachment.file.webPath
           

Nested Class Summary
 
Nested classes/interfaces inherited from class er.attachment.processors.ERAttachmentProcessor
ERAttachmentProcessor.ERXAttachmentExceedsLengthException
 
Field Summary
 
Fields inherited from class er.attachment.processors.ERAttachmentProcessor
log
 
Constructor Summary
ERFileAttachmentProcessor()
           
 
Method Summary
 ERFileAttachment _process(com.webobjects.eocontrol.EOEditingContext editingContext, java.io.File uploadedFile, java.lang.String recommendedFileName, java.lang.String mimeType, java.lang.String configurationName, java.lang.String ownerID, boolean pendingDelete)
          Processes an uploaded file, imports it into the appropriate data store, and returns an ERAttachment that represents it.
 java.io.InputStream attachmentInputStream(ERFileAttachment attachment)
          Returns an InputStream to the data of the given attachment.
 java.lang.String attachmentUrl(ERFileAttachment attachment, com.webobjects.appserver.WORequest request, com.webobjects.appserver.WOContext context)
          Returns a URL to the attachment's data.
 void deleteAttachment(ERFileAttachment attachment)
          Deletes the attachment from the data store.
 
Methods inherited from class er.attachment.processors.ERAttachmentProcessor
_parsePathTemplate, addAttachmentProcessorForType, attachmentInserted, delegate, process, process, process, process, process, process, processorForConfigurationName, processorForType, processorForType, processors, proxiedUrl, proxyAsAttachment, setDelegate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ERFileAttachmentProcessor

public ERFileAttachmentProcessor()
Method Detail

_process

public ERFileAttachment _process(com.webobjects.eocontrol.EOEditingContext editingContext,
                                 java.io.File uploadedFile,
                                 java.lang.String recommendedFileName,
                                 java.lang.String mimeType,
                                 java.lang.String configurationName,
                                 java.lang.String ownerID,
                                 boolean pendingDelete)
                          throws java.io.IOException
Description copied from class: ERAttachmentProcessor
Processes an uploaded file, imports it into the appropriate data store, and returns an ERAttachment that represents it. uploadedFile will be deleted after the import process is complete.

Specified by:
_process in class ERAttachmentProcessor<ERFileAttachment>
Parameters:
editingContext - the EOEditingContext to create the ERAttachment in
uploadedFile - the uploaded temporary file (which will be deleted at the end)
recommendedFileName - the filename recommended by the user during import
mimeType - 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 alone
Returns:
an ERAttachment that represents the file
Throws:
java.io.IOException - if the processing fails

attachmentInputStream

public java.io.InputStream attachmentInputStream(ERFileAttachment attachment)
                                          throws java.io.IOException
Description copied from class: ERAttachmentProcessor
Returns an InputStream to the data of the given attachment.

Specified by:
attachmentInputStream in class ERAttachmentProcessor<ERFileAttachment>
Parameters:
attachment - the attachment to retrieve the data for
Returns:
an InputStream onto the data
Throws:
java.io.IOException - if the stream cannot be created

attachmentUrl

public java.lang.String attachmentUrl(ERFileAttachment attachment,
                                      com.webobjects.appserver.WORequest request,
                                      com.webobjects.appserver.WOContext context)
Description copied from class: ERAttachmentProcessor
Returns a URL to the attachment's data.

Specified by:
attachmentUrl in class ERAttachmentProcessor<ERFileAttachment>
Parameters:
attachment - the attachment to generate a URL for
request - the current request
context - the current context
Returns:
a URL to the attachment's data

deleteAttachment

public void deleteAttachment(ERFileAttachment attachment)
                      throws java.io.IOException
Description copied from class: ERAttachmentProcessor
Deletes the attachment from the data store.

Specified by:
deleteAttachment in class ERAttachmentProcessor<ERFileAttachment>
Parameters:
attachment - the attachment to delete
Throws:
java.io.IOException - if the delete fails

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.