org.eclipse.jetty.util

## Class MultiPartInputStream

- java.lang.Object
- - org.eclipse.jetty.util.MultiPartInputStream

-     public class MultiPartInputStream
      extends Object

  MultiPartInputStream Handle a MultiPart Mime input stream, breaking it up on the boundary into files and strings.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `MultiPartInputStream.MultiPart`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static javax.servlet.MultipartConfigElement` | `__DEFAULT_MULTIPART_CONFIG`
    `protected javax.servlet.MultipartConfigElement` | `_config`
    `protected String` | `_contentType`
    `protected File` | `_contextTmpDir`
    `protected boolean` | `_deleteOnExit`
    `protected InputStream` | `_in`
    `protected MultiMap<String>` | `_parts`
    `protected File` | `_tmpDir`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MultiPartInputStream(InputStream in, String contentType, javax.servlet.MultipartConfigElement config, File contextTmpDir)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `deleteParts()` Delete any tmp storage for parts, and clear out the parts list.
    `Collection<javax.servlet.http.Part>` | `getParsedParts()` Get the already parsed parts.
    `javax.servlet.http.Part` | `getPart(String name)` Get the named Part.
    `Collection<javax.servlet.http.Part>` | `getParts()` Parse, if necessary, the multipart data and return the list of Parts.
    `boolean` | `isDeleteOnExit()`
    `protected void` | `parse()` Parse, if necessary, the multipart stream.
    `void` | `setDeleteOnExit(boolean deleteOnExit)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### __DEFAULT_MULTIPART_CONFIG

          public static final javax.servlet.MultipartConfigElement __DEFAULT_MULTIPART_CONFIG

    - #### _in

          protected InputStream _in

    - #### _config

          protected javax.servlet.MultipartConfigElement _config

    - #### _contentType

          protected String _contentType

    - #### _parts

          protected MultiMap<String> _parts

    - #### _tmpDir

          protected File _tmpDir

    - #### _contextTmpDir

          protected File _contextTmpDir

    - #### _deleteOnExit

          protected boolean _deleteOnExit

  - ### Constructor Detail

    - #### MultiPartInputStream

          public MultiPartInputStream(InputStream in,
                              String contentType,
                              javax.servlet.MultipartConfigElement config,
                              File contextTmpDir)

      Parameters:
        `in` - Request input stream
        `contentType` - Content-Type header
        `config` - MultipartConfigElement
        `contextTmpDir` - javax.servlet.context.tempdir

  - ### Method Detail

    - #### getParsedParts

          public Collection<javax.servlet.http.Part> getParsedParts()

      Get the already parsed parts.
      Returns:

    - #### deleteParts

          public void deleteParts()
                           throws MultiException

      Delete any tmp storage for parts, and clear out the parts list.
      Throws:
        `MultiException`

    - #### getParts

          public Collection<javax.servlet.http.Part> getParts()
                                                       throws IOException,
                                                              javax.servlet.ServletException

      Parse, if necessary, the multipart data and return the list of Parts.
      Returns:
      Throws:
        `IOException`
        `javax.servlet.ServletException`

    - #### getPart

          public javax.servlet.http.Part getPart(String name)
                                          throws IOException,
                                                 javax.servlet.ServletException

      Get the named Part.
      Parameters:
        `name` -
      Returns:
      Throws:
        `IOException`
        `javax.servlet.ServletException`

    - #### parse

          protected void parse()
                        throws IOException,
                               javax.servlet.ServletException

      Parse, if necessary, the multipart stream.
      Throws:
        `IOException`
        `javax.servlet.ServletException`

    - #### setDeleteOnExit

          public void setDeleteOnExit(boolean deleteOnExit)

    - #### isDeleteOnExit

          public boolean isDeleteOnExit()

Copyright © 1995-2015 Mort Bay Consulting. All Rights Reserved.