Partpublic class MultiPartInputStreamParser.MultiPart extends java.lang.Object implements Part
| Modifier and Type | Field | Description |
|---|---|---|
protected ByteArrayOutputStream2 |
_bout |
|
protected java.lang.String |
_contentType |
|
protected java.io.File |
_file |
|
protected java.lang.String |
_filename |
|
protected MultiMap<java.lang.String> |
_headers |
|
protected java.lang.String |
_name |
|
protected java.io.OutputStream |
_out |
|
protected long |
_size |
|
protected boolean |
_temporary |
| Constructor | Description |
|---|---|
MultiPart(java.lang.String name,
java.lang.String filename) |
| Modifier and Type | Method | 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() |
|
java.lang.String |
getContentDispositionFilename() |
Get the filename from the content-disposition.
|
java.lang.String |
getContentType() |
|
java.io.File |
getFile() |
Get the file
|
java.lang.String |
getHeader(java.lang.String name) |
|
java.util.Collection<java.lang.String> |
getHeaderNames() |
|
java.util.Collection<java.lang.String> |
getHeaders(java.lang.String name) |
|
java.io.InputStream |
getInputStream() |
|
java.lang.String |
getName() |
|
long |
getSize() |
|
java.lang.String |
getSubmittedFileName() |
|
protected void |
open() |
|
protected void |
setContentType(java.lang.String contentType) |
|
protected void |
setHeaders(MultiMap<java.lang.String> headers) |
|
java.lang.String |
toString() |
|
protected void |
write(byte[] bytes,
int offset,
int length) |
|
protected void |
write(int b) |
|
void |
write(java.lang.String fileName) |
protected java.lang.String _name
protected java.lang.String _filename
protected java.io.File _file
protected java.io.OutputStream _out
protected ByteArrayOutputStream2 _bout
protected java.lang.String _contentType
protected MultiMap<java.lang.String> _headers
protected long _size
protected boolean _temporary
public MultiPart(java.lang.String name,
java.lang.String filename)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Objectprotected void setContentType(java.lang.String contentType)
protected void open()
throws java.io.IOException
java.io.IOExceptionprotected void close()
throws java.io.IOException
java.io.IOExceptionprotected void write(int b)
throws java.io.IOException
java.io.IOExceptionprotected void write(byte[] bytes,
int offset,
int length)
throws java.io.IOException
java.io.IOExceptionprotected void createFile()
throws java.io.IOException
java.io.IOExceptionprotected void setHeaders(MultiMap<java.lang.String> headers)
public java.lang.String getContentType()
getContentType in interface PartPart.getContentType()public java.lang.String getHeader(java.lang.String name)
getHeader in interface PartPart.getHeader(java.lang.String)public java.util.Collection<java.lang.String> getHeaderNames()
getHeaderNames in interface PartPart.getHeaderNames()public java.util.Collection<java.lang.String> getHeaders(java.lang.String name)
getHeaders in interface PartPart.getHeaders(java.lang.String)public java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream in interface Partjava.io.IOExceptionPart.getInputStream()public java.lang.String getSubmittedFileName()
getSubmittedFileName in interface PartPart.getSubmittedFileName()public byte[] getBytes()
public java.lang.String getName()
getName in interface PartPart.getName()public long getSize()
getSize in interface PartPart.getSize()public void write(java.lang.String fileName)
throws java.io.IOException
write in interface Partjava.io.IOExceptionPart.write(java.lang.String)public void delete()
throws java.io.IOException
delete in interface Partjava.io.IOExceptionPart.delete()public void cleanUp()
throws java.io.IOException
java.io.IOException - if unable to delete the filepublic java.io.File getFile()
public java.lang.String getContentDispositionFilename()
Copyright © 1995–2018 Webtide. All rights reserved.