public class MultiPartFormInputStream.MultiPart
extends java.lang.Object
implements javax.servlet.http.Part
Modifier and Type | Field and 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 and Description |
---|
MultiPart(java.lang.String name,
java.lang.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() |
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 java.lang.String toString()
toString
in class java.lang.Object
protected void setContentType(java.lang.String contentType)
protected void open() throws java.io.IOException
java.io.IOException
protected void close() throws java.io.IOException
java.io.IOException
protected void write(int b) throws java.io.IOException
java.io.IOException
protected void write(byte[] bytes, int offset, int length) throws java.io.IOException
java.io.IOException
protected void createFile() throws java.io.IOException
java.io.IOException
protected void setHeaders(MultiMap<java.lang.String> headers)
public java.lang.String getContentType()
getContentType
in interface javax.servlet.http.Part
public java.lang.String getHeader(java.lang.String name)
getHeader
in interface javax.servlet.http.Part
public java.util.Collection<java.lang.String> getHeaderNames()
getHeaderNames
in interface javax.servlet.http.Part
public java.util.Collection<java.lang.String> getHeaders(java.lang.String name)
getHeaders
in interface javax.servlet.http.Part
public java.io.InputStream getInputStream() throws java.io.IOException
getInputStream
in interface javax.servlet.http.Part
java.io.IOException
public java.lang.String getSubmittedFileName()
getSubmittedFileName
in interface javax.servlet.http.Part
public byte[] getBytes()
public java.lang.String getName()
getName
in interface javax.servlet.http.Part
public long getSize()
getSize
in interface javax.servlet.http.Part
public void write(java.lang.String fileName) throws java.io.IOException
write
in interface javax.servlet.http.Part
java.io.IOException
public void delete() throws java.io.IOException
delete
in interface javax.servlet.http.Part
java.io.IOException
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–2023 Webtide. All rights reserved.