public class BodyPartEntity extends Object implements Closeable
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.Constructor and Description |
---|
BodyPartEntity(org.jvnet.mimepull.MIMEPart mimePart)
Constructs a new
BodyPartEntity with a MIMEPart . |
Modifier and Type | Method and Description |
---|---|
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.
|
void |
moveTo(File file)
Move the contents of the underlying
InputStream or File to the given file. |
public BodyPartEntity(org.jvnet.mimepull.MIMEPart mimePart)
BodyPartEntity
with a MIMEPart
.mimePart
- MIMEPart containing the input stream of this body part entity.public InputStream getInputStream()
public void cleanup()
public void close() throws IOException
cleanup()
.close
in interface Closeable
close
in interface AutoCloseable
IOException
public void moveTo(File file)
InputStream
or File
to the given file.file
- destination file.Copyright © 2007-2021, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.