Package org.eclipse.jetty.http
Class MultiPartFormInputStream.MultiPart
- java.lang.Object
-
- org.eclipse.jetty.http.MultiPartFormInputStream.MultiPart
-
- All Implemented Interfaces:
Part
- Enclosing class:
- MultiPartFormInputStream
public class MultiPartFormInputStream.MultiPart extends java.lang.Object implements Part
-
-
Constructor Summary
Constructors Constructor Description MultiPart(java.lang.String name, java.lang.String filename)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanUp()Only remove tmp files.voiddelete()Remove the file, whether or not Part.write() was called on it (ie no longer temporary)byte[]getBytes()java.lang.StringgetContentDispositionFilename()Get the filename from the content-disposition.java.lang.StringgetContentType()java.io.FilegetFile()Get the filejava.lang.StringgetHeader(java.lang.String name)java.util.Collection<java.lang.String>getHeaderNames()java.util.Collection<java.lang.String>getHeaders(java.lang.String name)java.io.InputStreamgetInputStream()java.lang.StringgetName()longgetSize()java.lang.StringgetSubmittedFileName()java.lang.StringtoString()voidwrite(java.lang.String fileName)
-
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getContentType
public java.lang.String getContentType()
- Specified by:
getContentTypein interfacePart
-
getHeader
public java.lang.String getHeader(java.lang.String name)
-
getHeaderNames
public java.util.Collection<java.lang.String> getHeaderNames()
- Specified by:
getHeaderNamesin interfacePart
-
getHeaders
public java.util.Collection<java.lang.String> getHeaders(java.lang.String name)
- Specified by:
getHeadersin interfacePart
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOException- Specified by:
getInputStreamin interfacePart- Throws:
java.io.IOException
-
getSubmittedFileName
public java.lang.String getSubmittedFileName()
- Specified by:
getSubmittedFileNamein interfacePart
-
getBytes
public byte[] getBytes()
-
write
public void write(java.lang.String fileName) throws java.io.IOException
-
delete
public void delete() throws java.io.IOExceptionRemove the file, whether or not Part.write() was called on it (ie no longer temporary)
-
cleanUp
public void cleanUp() throws java.io.IOExceptionOnly remove tmp files.- Throws:
java.io.IOException- if unable to delete the file
-
getFile
public java.io.File getFile()
Get the file- Returns:
- the file, if any, the data has been written to.
-
getContentDispositionFilename
public java.lang.String getContentDispositionFilename()
Get the filename from the content-disposition.- Returns:
- null or the filename
-
-