public class MultiPartInputStream.MultiPart extends Object implements javax.servlet.http.Part
| Modifier and Type | Field and Description |
|---|---|
protected ByteArrayOutputStream2 |
_bout |
protected String |
_contentType |
protected File |
_file |
protected String |
_filename |
protected MultiMap<String> |
_headers |
protected String |
_name |
protected OutputStream |
_out |
protected long |
_size |
protected boolean |
_temporary |
| Constructor and Description |
|---|
MultiPartInputStream.MultiPart(String name,
String filename) |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanUp()
Only remove tmp files.
|
protected void |
close() |
protected void |
createFile() |
void |
delete()
Remove the file, whether or not Part.write() was called on it
(ie no longer temporary)
|
byte[] |
getBytes() |
String |
getContentDispositionFilename()
Get the filename from the content-disposition.
|
String |
getContentType() |
File |
getFile()
Get the file, if any, the data has been written to.
|
String |
getHeader(String name) |
Collection<String> |
getHeaderNames() |
Collection<String> |
getHeaders(String name) |
InputStream |
getInputStream() |
String |
getName() |
long |
getSize() |
protected void |
open() |
protected void |
setContentType(String contentType) |
protected void |
setHeaders(MultiMap<String> headers) |
protected void |
write(byte[] bytes,
int offset,
int length) |
protected void |
write(int b) |
void |
write(String fileName) |
protected String _name
protected String _filename
protected File _file
protected OutputStream _out
protected ByteArrayOutputStream2 _bout
protected String _contentType
protected long _size
protected boolean _temporary
public MultiPartInputStream.MultiPart(String name, String filename) throws IOException
IOExceptionprotected void setContentType(String contentType)
protected void open()
throws IOException
IOExceptionprotected void close()
throws IOException
IOExceptionprotected void write(int b)
throws IOException
IOExceptionprotected void write(byte[] bytes,
int offset,
int length)
throws IOException
IOExceptionprotected void createFile()
throws IOException
IOExceptionpublic String getContentType()
getContentType in interface javax.servlet.http.PartPart.getContentType()public String getHeader(String name)
getHeader in interface javax.servlet.http.PartPart.getHeader(java.lang.String)public Collection<String> getHeaderNames()
getHeaderNames in interface javax.servlet.http.PartPart.getHeaderNames()public Collection<String> getHeaders(String name)
getHeaders in interface javax.servlet.http.PartPart.getHeaders(java.lang.String)public InputStream getInputStream() throws IOException
getInputStream in interface javax.servlet.http.PartIOExceptionPart.getInputStream()public byte[] getBytes()
public String getName()
getName in interface javax.servlet.http.PartPart.getName()public long getSize()
getSize in interface javax.servlet.http.PartPart.getSize()public void write(String fileName) throws IOException
write in interface javax.servlet.http.PartIOExceptionPart.write(java.lang.String)public void delete()
throws IOException
delete in interface javax.servlet.http.PartIOExceptionPart.delete()public void cleanUp()
throws IOException
IOExceptionpublic File getFile()
public String getContentDispositionFilename()
Copyright © 1995-2015 Mort Bay Consulting. All Rights Reserved.