Package cloud.piranha.upload.apache
Class ApacheMultiPart
- java.lang.Object
-
- cloud.piranha.upload.apache.ApacheMultiPart
-
- All Implemented Interfaces:
Part
public class ApacheMultiPart extends Object implements Part
The Part for the ApacheMultiPartManager.This class implements the Servlet Part API and delegates to an Apache Commons FileItem for its functionality.
- Author:
- Manfred Riem ([email protected])
-
-
Constructor Summary
Constructors Constructor Description ApacheMultiPart(org.apache.commons.fileupload.FileItem item)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete()
Delete the part.String
getContentType()
Get the content type.String
getHeader(String name)
Get the header.Collection<String>
getHeaderNames()
Get the header names.Collection<String>
getHeaders(String name)
Get the headers.InputStream
getInputStream()
Get the input stream.String
getName()
Get the name.long
getSize()
Get the size.String
getSubmittedFileName()
Get the submitted filename.void
write(String filename)
Write to the given filename.
-
-
-
Method Detail
-
delete
public void delete() throws IOException
Description copied from interface:Part
Delete the part.- Specified by:
delete
in interfacePart
- Throws:
IOException
- when an I/O error occurs.- See Also:
Part.delete()
-
getContentType
public String getContentType()
Description copied from interface:Part
Get the content type.- Specified by:
getContentType
in interfacePart
- Returns:
- the content type.
- See Also:
Part.getContentType()
-
getHeader
public String getHeader(String name)
Description copied from interface:Part
Get the header.- Specified by:
getHeader
in interfacePart
- Parameters:
name
- the name.- Returns:
- the header, or null.
- See Also:
Part.getHeader(java.lang.String)
-
getHeaderNames
public Collection<String> getHeaderNames()
Description copied from interface:Part
Get the header names.- Specified by:
getHeaderNames
in interfacePart
- Returns:
- the header names.
- See Also:
Part.getHeaderNames()
-
getHeaders
public Collection<String> getHeaders(String name)
Description copied from interface:Part
Get the headers.- Specified by:
getHeaders
in interfacePart
- Parameters:
name
- the name.- Returns:
- the headers.
- See Also:
Part.getHeaders(java.lang.String)
-
getInputStream
public InputStream getInputStream() throws IOException
Description copied from interface:Part
Get the input stream.- Specified by:
getInputStream
in interfacePart
- Returns:
- the input stream.
- Throws:
IOException
- when an I/O error occurs.- See Also:
Part.getInputStream()
-
getName
public String getName()
Description copied from interface:Part
Get the name.- Specified by:
getName
in interfacePart
- Returns:
- the name.
- See Also:
Part.getName()
-
getSize
public long getSize()
Description copied from interface:Part
Get the size.- Specified by:
getSize
in interfacePart
- Returns:
- the size.
- See Also:
Part.getSize()
-
getSubmittedFileName
public String getSubmittedFileName()
Description copied from interface:Part
Get the submitted filename.- Specified by:
getSubmittedFileName
in interfacePart
- Returns:
- the submitted filename.
- See Also:
Part.getSubmittedFileName()
-
write
public void write(String filename) throws IOException
Description copied from interface:Part
Write to the given filename.- Specified by:
write
in interfacePart
- Parameters:
filename
- the filename.- Throws:
IOException
- when an I/O error occurs.- See Also:
Part.write(java.lang.String)
-
-