-
public interface PartThis interface represents a part item received in a multipart message that has already been processed and written into an output object.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetContentType()Returns the content type of this part, as it was submitted by the client.StringgetHeader(String name)Returns the value of the specified mime header as a String.Collection<String>getHeaderNames()Returns the header names of this part.Collection<String>getHeaders(String name)Returns the values of the part header with the given name.StringgetName()Returns the name of this part, which equals the name of the form field the part was selected for.com.github.elopteryx.upload.PartOutputgetOutPut()Return the output which was associated with this part during the parsing.longgetSize()Returns the size of this part.StringgetSubmittedFileName()Returns the file name specified by the client or null if the part is a normal form field.booleanisFile()Determines whether or not this Part instance represents a file item.
-
-
-
Method Detail
-
getContentType
String getContentType()
Returns the content type of this part, as it was submitted by the client.- Returns:
- The content type of this part
-
getName
String getName()
Returns the name of this part, which equals the name of the form field the part was selected for.- Returns:
- The name of this part as a String
-
getSize
long getSize()
Returns the size of this part.- Returns:
- A long specifying the size of this part, in bytes.
-
getSubmittedFileName
String getSubmittedFileName()
Returns the file name specified by the client or null if the part is a normal form field.- Returns:
- The submitted file name
-
isFile
boolean isFile()
Determines whether or not this Part instance represents a file item. If it's a normal form field then it will return false. Consequently, if this returns true then thegetSubmittedFileName()will return with a non-null value and vice-versa.- Returns:
- True if the instance represents an uploaded file; false if it represents a simple form field.
-
getOutPut
com.github.elopteryx.upload.PartOutput getOutPut()
Return the output which was associated with this part during the parsing. The actual output object (channel, path etc.) can be retrieved from it.- Returns:
- The output object
-
getHeader
String getHeader(String name)
Returns the value of the specified mime header as a 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.- Parameters:
name- a String specifying the header name- Returns:
- a String containing the value of the requested header, or null if the part does not have a header of that name
-
getHeaders
Collection<String> getHeaders(String name)
Returns the values of the part header with the given name.- Parameters:
name- the header name whose values to return- Returns:
- a (possibly empty) Collection of the values of the header with the given name
-
getHeaderNames
Collection<String> getHeaderNames()
Returns the header names of this part.- Returns:
- a (possibly empty) Collection of the header names of this Part
-
-