org.glassfish.jersey.media.multipart
Class BodyPartEntity

java.lang.Object
  extended by org.glassfish.jersey.media.multipart.BodyPartEntity
All Implemented Interfaces:
Closeable

public class BodyPartEntity
extends Object
implements Closeable

Proxy class representing the entity of a BodyPart when a MultiPart entity is received and parsed.

Its primary purpose is to provide an input stream to retrieve the actual data. However, it also transparently deals with storing the data in a temporary disk file, if it is larger than a configurable size; otherwise, the data is stored in memory for faster processing.

Author:
Craig McClanahan, Paul Sandoz (paul.sandoz at oracle.com), Michal Gajdos (michal.gajdos at oracle.com)

Constructor Summary
BodyPartEntity(org.jvnet.mimepull.MIMEPart mimePart)
          Constructs a new BodyPartEntity with a MIMEPart.
 
Method Summary
 void cleanup()
          Cleans up temporary file(s), if any were utilized.
 void close()
          Defers to cleanup().
 InputStream getInputStream()
          Gets the input stream of the raw bytes of this body part entity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BodyPartEntity

public BodyPartEntity(org.jvnet.mimepull.MIMEPart mimePart)
Constructs a new BodyPartEntity with a MIMEPart.

Parameters:
mimePart - MIMEPart containing the input stream of this body part entity.
Method Detail

getInputStream

public InputStream getInputStream()
Gets the input stream of the raw bytes of this body part entity.

Returns:
the input stream of the body part entity.

cleanup

public void cleanup()
Cleans up temporary file(s), if any were utilized.


close

public void close()
           throws IOException
Defers to cleanup().

Specified by:
close in interface Closeable
Throws:
IOException


Copyright © 2007-2013 Oracle Corporation. All Rights Reserved. Use is subject to license terms.