Package org.eclipse.jetty.server
Class MultiPartFormInputStream.MultiPart
java.lang.Object
org.eclipse.jetty.server.MultiPartFormInputStream.MultiPart
- All Implemented Interfaces:
jakarta.servlet.http.Part
- Enclosing class:
- MultiPartFormInputStream
-
Field Summary
Modifier and TypeFieldDescriptionprotected ByteArrayOutputStream2
protected String
protected File
protected String
protected String
protected OutputStream
protected long
protected boolean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanUp()
Only remove tmp files.protected void
close()
protected void
void
delete()
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()
long
getSize()
protected void
open()
protected void
setContentType
(String contentType) protected void
setHeaders
(MultiMap<String> headers) toString()
protected void
write
(byte[] bytes, int offset, int length) protected void
write
(int b) void
-
Field Details
-
_name
-
_filename
-
_file
-
_out
-
_bout
-
_contentType
-
_headers
-
_size
protected long _size -
_temporary
protected boolean _temporary
-
-
Constructor Details
-
MultiPart
-
-
Method Details
-
toString
-
setContentType
-
open
- Throws:
IOException
-
close
- Throws:
IOException
-
write
- Throws:
IOException
-
write
- Throws:
IOException
-
write
- Specified by:
write
in interfacejakarta.servlet.http.Part
- Throws:
IOException
-
createFile
- Throws:
IOException
-
setHeaders
-
getContentType
- Specified by:
getContentType
in interfacejakarta.servlet.http.Part
-
getHeader
- Specified by:
getHeader
in interfacejakarta.servlet.http.Part
-
getHeaderNames
- Specified by:
getHeaderNames
in interfacejakarta.servlet.http.Part
-
getHeaders
- Specified by:
getHeaders
in interfacejakarta.servlet.http.Part
-
getInputStream
- Specified by:
getInputStream
in interfacejakarta.servlet.http.Part
- Throws:
IOException
-
getSubmittedFileName
- Specified by:
getSubmittedFileName
in interfacejakarta.servlet.http.Part
-
getBytes
public byte[] getBytes() -
getName
- Specified by:
getName
in interfacejakarta.servlet.http.Part
-
getSize
public long getSize()- Specified by:
getSize
in interfacejakarta.servlet.http.Part
-
delete
Remove the file, whether or not Part.write() was called on it (ie no longer temporary)- Specified by:
delete
in interfacejakarta.servlet.http.Part
- Throws:
IOException
-
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
-