Package org.eclipse.jetty.server
Class MultiPartInputStreamParser.MultiPart
java.lang.Object
org.eclipse.jetty.server.MultiPartInputStreamParser.MultiPart
- All Implemented Interfaces:
jakarta.servlet.http.Part
- Enclosing class:
- MultiPartInputStreamParser
public class MultiPartInputStreamParser.MultiPart
extends Object
implements jakarta.servlet.http.Part
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ByteArrayOutputStream2protected Stringprotected Fileprotected Stringprotected Stringprotected OutputStreamprotected longprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanUp()Only remove tmp files.protected voidclose()protected voidvoiddelete()Remove the file, whether or not Part.write() was called on it (ie no longer temporary)byte[]getBytes()Get the filename from the content-disposition.getFile()Get the filegetHeaders(String name) getName()longgetSize()protected voidopen()protected voidsetContentType(String contentType) protected voidsetHeaders(MultiMap<String> headers) toString()protected voidwrite(byte[] bytes, int offset, int length) protected voidwrite(int b) void
-
Field Details
-
_name
-
_filename
-
_file
-
_out
-
_bout
-
_contentType
-
_headers
-
_size
protected long _size -
_temporary
protected boolean _temporary
-
-
Constructor Details
-
MultiPart
- Throws:
IOException
-
-
Method Details
-
toString
-
setContentType
-
open
- Throws:
IOException
-
close
- Throws:
IOException
-
write
- Throws:
IOException
-
write
- Throws:
IOException
-
createFile
- Throws:
IOException
-
setHeaders
-
getContentType
- Specified by:
getContentTypein interfacejakarta.servlet.http.Part- See Also:
-
Part.getContentType()
-
getHeader
- Specified by:
getHeaderin interfacejakarta.servlet.http.Part- See Also:
-
Part.getHeader(String)
-
getHeaderNames
- Specified by:
getHeaderNamesin interfacejakarta.servlet.http.Part- See Also:
-
Part.getHeaderNames()
-
getHeaders
- Specified by:
getHeadersin interfacejakarta.servlet.http.Part- See Also:
-
Part.getHeaders(String)
-
getInputStream
- Specified by:
getInputStreamin interfacejakarta.servlet.http.Part- Throws:
IOException- See Also:
-
Part.getInputStream()
-
getSubmittedFileName
- Specified by:
getSubmittedFileNamein interfacejakarta.servlet.http.Part- See Also:
-
Part.getSubmittedFileName()
-
getBytes
public byte[] getBytes() -
getName
- Specified by:
getNamein interfacejakarta.servlet.http.Part- See Also:
-
Part.getName()
-
getSize
public long getSize()- Specified by:
getSizein interfacejakarta.servlet.http.Part- See Also:
-
Part.getSize()
-
write
- Specified by:
writein interfacejakarta.servlet.http.Part- Throws:
IOException- See Also:
-
Part.write(String)
-
delete
Remove the file, whether or not Part.write() was called on it (ie no longer temporary)- Specified by:
deletein interfacejakarta.servlet.http.Part- Throws:
IOException- See Also:
-
Part.delete()
-
cleanUp
Only remove tmp files.- Throws:
IOException- if unable to delete the file
-
getFile
Get the file- Returns:
- the file, if any, the data has been written to.
-
getContentDispositionFilename
Get the filename from the content-disposition.- Returns:
- null or the filename
-