Class MultipartWrapper

java.lang.Object
com.webmethods.caf.faces.servlet.MultipartWrapper
All Implemented Interfaces:
Serializable, Part, org.apache.commons.fileupload.FileItem, org.apache.commons.fileupload.FileItemHeadersSupport

public class MultipartWrapper extends Object implements Serializable, Part, org.apache.commons.fileupload.FileItem
Wraps a MultiPartInputStream.MultiPart mp and exposes a moc FileItem for legacy usage of File Inputs
See Also:
  • Constructor Details

    • MultipartWrapper

      public MultipartWrapper(org.eclipse.jetty.util.MultiPartInputStreamParser.MultiPart mp)
      By this point the Part has been parsed and either a File has been saved if over threshold size or it is saved in memory.
      Parameters:
      mp -
    • MultipartWrapper

      public MultipartWrapper()
  • Method Details

    • getHeaders

      public org.apache.commons.fileupload.FileItemHeaders getHeaders()
      Specified by:
      getHeaders in interface org.apache.commons.fileupload.FileItemHeadersSupport
    • setHeaders

      public void setHeaders(org.apache.commons.fileupload.FileItemHeaders arg0)
      Specified by:
      setHeaders in interface org.apache.commons.fileupload.FileItemHeadersSupport
    • get

      public byte[] get()
      Specified by:
      get in interface org.apache.commons.fileupload.FileItem
    • getContentType

      public String getContentType()
      Specified by:
      getContentType in interface org.apache.commons.fileupload.FileItem
      Specified by:
      getContentType in interface Part
    • getFieldName

      public String getFieldName()
      Specified by:
      getFieldName in interface org.apache.commons.fileupload.FileItem
    • getInputStream

      public InputStream getInputStream() throws IOException
      Specified by:
      getInputStream in interface org.apache.commons.fileupload.FileItem
      Specified by:
      getInputStream in interface Part
      Throws:
      IOException
    • getName

      public String getName()
      Specified by:
      getName in interface org.apache.commons.fileupload.FileItem
      Specified by:
      getName in interface Part
    • getOutputStream

      public OutputStream getOutputStream() throws IOException
      Specified by:
      getOutputStream in interface org.apache.commons.fileupload.FileItem
      Throws:
      IOException
    • getSize

      public long getSize()
      Specified by:
      getSize in interface org.apache.commons.fileupload.FileItem
      Specified by:
      getSize in interface Part
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getString

      public String getString(String charset) throws UnsupportedEncodingException
      Specified by:
      getString in interface org.apache.commons.fileupload.FileItem
      Throws:
      UnsupportedEncodingException
    • isFormField

      public boolean isFormField()
      Specified by:
      isFormField in interface org.apache.commons.fileupload.FileItem
    • isInMemory

      public boolean isInMemory()
      Specified by:
      isInMemory in interface org.apache.commons.fileupload.FileItem
    • setFieldName

      public void setFieldName(String arg0)
      Specified by:
      setFieldName in interface org.apache.commons.fileupload.FileItem
    • setFormField

      public void setFormField(boolean arg0)
      Specified by:
      setFormField in interface org.apache.commons.fileupload.FileItem
    • write

      public void write(File arg0) throws Exception
      Specified by:
      write in interface org.apache.commons.fileupload.FileItem
      Throws:
      Exception
    • delete

      public void delete()
      Specified by:
      delete in interface org.apache.commons.fileupload.FileItem
      Specified by:
      delete in interface Part
    • getString

      public String getString()
      Specified by:
      getString in interface org.apache.commons.fileupload.FileItem
    • getHeader

      public String getHeader(String name)
      Specified by:
      getHeader in interface Part
    • getHeaderNames

      public Collection<String> getHeaderNames()
      Specified by:
      getHeaderNames in interface Part
    • getHeaders

      public Collection<String> getHeaders(String name)
      Specified by:
      getHeaders in interface Part
    • getSubmittedFileName

      public String getSubmittedFileName()
      Specified by:
      getSubmittedFileName in interface Part
    • write

      public void write(String fileName) throws IOException
      Specified by:
      write in interface Part
      Throws:
      IOException