|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mule.transport.http.multipart.MultiPartInputStream.MultiPart
public class MultiPartInputStream.MultiPart
Field Summary | |
---|---|
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
|
Constructor Summary | |
---|---|
MultiPartInputStream.MultiPart(java.lang.String name,
java.lang.String filename)
|
Method Summary | |
---|---|
protected void |
close()
|
protected void |
createFile()
|
void |
delete()
Deletes the underlying storage for a file item, including deleting any associated temporary disk file. |
java.lang.String |
getContentDispositionFilename()
Get the filename from the content-disposition. |
java.lang.String |
getContentType()
Gets the content type of this part. |
java.io.File |
getFile()
Get the file, if any, the data has been written to. |
java.lang.String |
getHeader(java.lang.String name)
Returns the value of the specified mime header as a String . |
java.util.Collection<java.lang.String> |
getHeaderNames()
Gets the header names of this Part. |
java.util.Collection<java.lang.String> |
getHeaders(java.lang.String name)
Gets the values of the Part header with the given name. |
java.io.InputStream |
getInputStream()
Gets the content of this part as an InputStream |
java.lang.String |
getName()
Gets the name of this part |
long |
getSize()
Returns the size of this file. |
protected void |
open()
|
protected void |
setContentType(java.lang.String contentType)
|
protected void |
setHeaders(MultiMap<java.lang.String> headers)
|
protected void |
write(byte[] bytes,
int offset,
int length)
|
protected void |
write(int b)
|
void |
write(java.lang.String fileName)
A convenience method to write this uploaded item to disk. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String _name
protected java.lang.String _filename
protected java.io.File _file
protected java.io.OutputStream _out
protected java.lang.String _contentType
protected MultiMap<java.lang.String> _headers
protected long _size
Constructor Detail |
---|
public MultiPartInputStream.MultiPart(java.lang.String name, java.lang.String filename) throws java.io.IOException
java.io.IOException
Method Detail |
---|
protected void setContentType(java.lang.String contentType)
protected void open() throws java.io.FileNotFoundException, java.io.IOException
java.io.FileNotFoundException
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()
Part
getContentType
in interface Part
Part.getContentType()
public java.lang.String getHeader(java.lang.String name)
Part
String
. If the Part did not include a header
of the specified name, this method returns null
.
If there are multiple headers with the same name, this method
returns the first header in the part.
The header name is case insensitive. You can use
this method with any request header.
getHeader
in interface Part
name
- a String
specifying the
header name
String
containing the
value of the requested
header, or null
if the part does not
have a header of that namePart.getHeader(java.lang.String)
public java.util.Collection<java.lang.String> getHeaderNames()
Part
Some servlet containers do not allow
servlets to access headers using this method, in
which case this method returns null
Any changes to the returned Collection
must not
affect this Part
.
getHeaderNames
in interface Part
Collection
of the header
names of this PartPart.getHeaderNames()
public java.util.Collection<java.lang.String> getHeaders(java.lang.String name)
Part
Any changes to the returned Collection
must not
affect this Part
.
Part header names are case insensitive.
getHeaders
in interface Part
name
- the header name whose values to return
Collection
of the values of
the header with the given namePart.getHeaders(java.lang.String)
public java.io.InputStream getInputStream() throws java.io.IOException
Part
getInputStream
in interface Part
java.io.IOException
- If an error occurs in retrieving the content
as an InputStreamPart.getInputStream()
public java.lang.String getName()
Part
getName
in interface Part
Part.getName()
public long getSize()
Part
getSize
in interface Part
long
specifying the size of this part, in bytes.Part.getSize()
public void write(java.lang.String fileName) throws java.io.IOException
Part
This method is not guaranteed to succeed if called more than once for the same part. This allows a particular implementation to use, for example, file renaming, where possible, rather than copying all of the underlying data, thus gaining a significant performance benefit.
write
in interface Part
fileName
- the name of the file to which the stream will be
written. The file is created relative to the location as
specified in the MultipartConfig
java.io.IOException
- if an error occurs.Part.write(java.lang.String)
public void delete() throws java.io.IOException
Part
delete
in interface Part
java.io.IOException
- if an error occurs.Part.delete()
public java.io.File getFile()
public java.lang.String getContentDispositionFilename()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |