org.jasig.portal
Class MultipartDataSource

java.lang.Object
  extended by org.jasig.portal.MultipartDataSource
All Implemented Interfaces:
javax.activation.DataSource

public class MultipartDataSource
extends java.lang.Object
implements javax.activation.DataSource


Field Summary
(package private)  java.io.ByteArrayOutputStream buff
           
(package private)  java.lang.String contentType
           
(package private)  java.lang.String errorMessage
           
(package private)  java.lang.String filename
           
(package private)  boolean isAvailable
           
private static org.apache.commons.logging.Log log
           
(package private)  java.io.File tempfile
           
 
Constructor Summary
MultipartDataSource(com.oreilly.servlet.multipart.FilePart filePart)
           
MultipartDataSource(java.lang.String fileName, java.lang.String errorMessage)
           
 
Method Summary
 void dispose()
          Releases tempfile associated with this object any memory they consume will be returned to the OS.
 java.lang.String getContentType()
           
 java.lang.String getErrorMessage()
           
 java.io.InputStream getInputStream()
           
 java.lang.String getName()
           
 java.io.OutputStream getOutputStream()
           
 boolean isAvailable()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log

tempfile

java.io.File tempfile

buff

java.io.ByteArrayOutputStream buff

contentType

java.lang.String contentType

filename

java.lang.String filename

errorMessage

java.lang.String errorMessage

isAvailable

boolean isAvailable
Constructor Detail

MultipartDataSource

public MultipartDataSource(com.oreilly.servlet.multipart.FilePart filePart)
                    throws java.io.IOException
Throws:
java.io.IOException

MultipartDataSource

public MultipartDataSource(java.lang.String fileName,
                           java.lang.String errorMessage)
Method Detail

isAvailable

public boolean isAvailable()

dispose

public void dispose()
Releases tempfile associated with this object any memory they consume will be returned to the OS.

Since:
uPortal 2.5. Prior to uPortal 2.5, tempfile deletion was a side effect of the finalizer.

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Specified by:
getInputStream in interface javax.activation.DataSource
Throws:
java.io.IOException

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Specified by:
getOutputStream in interface javax.activation.DataSource
Throws:
java.io.IOException

getContentType

public java.lang.String getContentType()
Specified by:
getContentType in interface javax.activation.DataSource

getName

public java.lang.String getName()
Specified by:
getName in interface javax.activation.DataSource

getErrorMessage

public java.lang.String getErrorMessage()