Package org.eclipse.jetty.util
Class MultiPartInputStreamParser.MultiPart
java.lang.Object
org.eclipse.jetty.util.MultiPartInputStreamParser.MultiPart
- All Implemented Interfaces:
Part
- Enclosing class:
MultiPartInputStreamParser
@Deprecated(since="2021-05-27")
public class MultiPartInputStreamParser.MultiPart
extends Object
implements Part
Deprecated.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanUp()
Deprecated.Only remove tmp files.void
delete()
Deprecated.Remove the file, whether or not Part.write() was called on it (ie no longer temporary)byte[]
getBytes()
Deprecated.Deprecated.Get the filename from the content-disposition.Deprecated.Obtain the content type passed by the browser.getFile()
Deprecated.Get the fileDeprecated.Obtains the value of the specified part header as a String.Deprecated.Get the header names provided for this part.getHeaders
(String name) Deprecated.Obtain all the values of the specified part header.Deprecated.Obtain anInputStream
that can be used to retrieve the contents of the file.getName()
Deprecated.Obtain the name of the field in the multipart form corresponding to this part.long
getSize()
Deprecated.Obtain the size of this part.Deprecated.If this part represents an uploaded file, gets the file name submitted in the upload.toString()
Deprecated.void
Deprecated.A convenience method to write an uploaded part to disk.
-
Constructor Details
-
MultiPart
Deprecated.- Throws:
IOException
-
-
Method Details
-
toString
Deprecated. -
getContentType
Deprecated.Description copied from interface:Part
Obtain the content type passed by the browser.- Specified by:
getContentType
in interfacePart
- Returns:
- The content type passed by the browser or
null
if not defined. - See Also:
-
getHeader
Deprecated.Description copied from interface:Part
Obtains the value of the specified part header as a String. If there are multiple headers with the same name, this method returns the first header in the part. The header name is case insensitive. -
getHeaderNames
Deprecated.Description copied from interface:Part
Get the header names provided for this part.- Specified by:
getHeaderNames
in interfacePart
- Returns:
- a Collection of all the header names provided for this part.
- See Also:
-
getHeaders
Deprecated.Description copied from interface:Part
Obtain all the values of the specified part header.- Specified by:
getHeaders
in interfacePart
- Parameters:
name
- The name of the header of interest. The header name is case insensitive.- Returns:
- All the values of the specified part header. If the part did not include any headers of the specified name, this method returns an empty Collection.
- See Also:
-
getInputStream
Deprecated.Description copied from interface:Part
Obtain anInputStream
that can be used to retrieve the contents of the file.- Specified by:
getInputStream
in interfacePart
- Returns:
- An InputStream for the contents of the file
- Throws:
IOException
- if an I/O occurs while obtaining the stream- See Also:
-
getSubmittedFileName
Deprecated.Description copied from interface:Part
If this part represents an uploaded file, gets the file name submitted in the upload. Returnsnull
if no file name is available or if this part is not a file upload.- Specified by:
getSubmittedFileName
in interfacePart
- Returns:
- the submitted file name or
null
. - See Also:
-
getBytes
public byte[] getBytes()Deprecated. -
getName
Deprecated.Description copied from interface:Part
Obtain the name of the field in the multipart form corresponding to this part. -
getSize
public long getSize()Deprecated.Description copied from interface:Part
Obtain the size of this part. -
write
Deprecated.Description copied from interface:Part
A convenience method to write an uploaded part to disk. The client code is not concerned with whether or not the part is stored in memory, or on disk in a temporary location. They just want to write the uploaded part to a file. This method is not guaranteed to succeed if called more than once for the same part. This allows a particular implementation to use, for example, file renaming, where possible, rather than copying all of the underlying data, thus gaining a significant performance benefit.- Specified by:
write
in interfacePart
- Parameters:
fileName
- The location into which the uploaded part should be stored. Relative locations are relative toMultipartConfigElement.getLocation()
- Throws:
IOException
- if an I/O occurs while attempting to write the part- See Also:
-
delete
Deprecated.Remove the file, whether or not Part.write() was called on it (ie no longer temporary)- Specified by:
delete
in interfacePart
- Throws:
IOException
- if an I/O occurs while attempting to delete the part- See Also:
-
cleanUp
Deprecated.Only remove tmp files.- Throws:
IOException
- if unable to delete the file
-
getFile
Deprecated.Get the file- Returns:
- the file, if any, the data has been written to.
-
getContentDispositionFilename
Deprecated.Get the filename from the content-disposition.- Returns:
- null or the filename
-