Class MultiPartFormInputStream.MultiPart

java.lang.Object
org.eclipse.jetty.server.MultiPartFormInputStream.MultiPart
All Implemented Interfaces:
javax.servlet.http.Part
Enclosing class:
MultiPartFormInputStream

public class MultiPartFormInputStream.MultiPart extends Object implements javax.servlet.http.Part
  • Field Details

    • _name

      protected String _name
    • _filename

      protected String _filename
    • _file

      protected File _file
    • _out

      protected OutputStream _out
    • _bout

      protected org.eclipse.jetty.util.ByteArrayOutputStream2 _bout
    • _contentType

      protected String _contentType
    • _headers

      protected org.eclipse.jetty.util.MultiMap<String> _headers
    • _size

      protected long _size
    • _temporary

      protected boolean _temporary
  • Constructor Details

    • MultiPart

      public MultiPart(String name, String filename)
  • Method Details

    • toString

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

      protected void setContentType(String contentType)
    • open

      protected void open() throws IOException
      Throws:
      IOException
    • close

      protected void close() throws IOException
      Throws:
      IOException
    • write

      protected void write(int b) throws IOException
      Throws:
      IOException
    • write

      protected void write(byte[] bytes, int offset, int length) throws IOException
      Throws:
      IOException
    • write

      public void write(String fileName) throws IOException
      Specified by:
      write in interface javax.servlet.http.Part
      Throws:
      IOException
    • createFile

      protected void createFile() throws IOException
      Throws:
      IOException
    • setHeaders

      protected void setHeaders(org.eclipse.jetty.util.MultiMap<String> headers)
    • getContentType

      public String getContentType()
      Specified by:
      getContentType in interface javax.servlet.http.Part
    • getHeader

      public String getHeader(String name)
      Specified by:
      getHeader in interface javax.servlet.http.Part
    • getHeaderNames

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

      public Collection<String> getHeaders(String name)
      Specified by:
      getHeaders in interface javax.servlet.http.Part
    • getInputStream

      public InputStream getInputStream() throws IOException
      Specified by:
      getInputStream in interface javax.servlet.http.Part
      Throws:
      IOException
    • getSubmittedFileName

      public String getSubmittedFileName()
      Specified by:
      getSubmittedFileName in interface javax.servlet.http.Part
    • getBytes

      public byte[] getBytes()
    • getName

      public String getName()
      Specified by:
      getName in interface javax.servlet.http.Part
    • getSize

      public long getSize()
      Specified by:
      getSize in interface javax.servlet.http.Part
    • delete

      public void delete() throws IOException
      Remove the file, whether or not Part.write() was called on it (ie no longer temporary)
      Specified by:
      delete in interface javax.servlet.http.Part
      Throws:
      IOException
    • cleanUp

      public void cleanUp() throws IOException
      Only remove tmp files.
      Throws:
      IOException - if unable to delete the file
    • getFile

      public File getFile()
      Get the file
      Returns:
      the file, if any, the data has been written to.
    • getContentDispositionFilename

      public String getContentDispositionFilename()
      Get the filename from the content-disposition.
      Returns:
      null or the filename