Class MultiPartInputStreamParser.MultiPart

  • All Implemented Interfaces:
    Part
    Enclosing class:
    MultiPartInputStreamParser

    @Deprecated(since="2021-05-27")
    public class MultiPartInputStreamParser.MultiPart
    extends java.lang.Object
    implements Part
    Deprecated.
    • Constructor Summary

      Constructors 
      Constructor Description
      MultiPart​(java.lang.String name, java.lang.String filename)
      Deprecated.
       
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void 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.
       
      java.lang.String getContentDispositionFilename()
      Deprecated.
      Get the filename from the content-disposition.
      java.lang.String getContentType()
      Deprecated.
      Obtain the content type passed by the browser.
      java.io.File getFile()
      Deprecated.
      Get the file
      java.lang.String getHeader​(java.lang.String name)
      Deprecated.
      Obtains the value of the specified part header as a String.
      java.util.Collection<java.lang.String> getHeaderNames()
      Deprecated.
      Get the header names provided for this part.
      java.util.Collection<java.lang.String> getHeaders​(java.lang.String name)
      Deprecated.
      Obtain all the values of the specified part header.
      java.io.InputStream getInputStream()
      Deprecated.
      Obtain an InputStream that can be used to retrieve the contents of the file.
      java.lang.String 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.
      java.lang.String getSubmittedFileName()
      Deprecated.
      If this part represents an uploaded file, gets the file name submitted in the upload.
      java.lang.String toString()
      Deprecated.
       
      void write​(java.lang.String fileName)
      Deprecated.
      A convenience method to write an uploaded part to disk.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • MultiPart

        public MultiPart​(java.lang.String name,
                         java.lang.String filename)
                  throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
    • Method Detail

      • toString

        public java.lang.String toString()
        Deprecated.
        Overrides:
        toString in class java.lang.Object
      • getContentType

        public java.lang.String getContentType()
        Deprecated.
        Description copied from interface: Part
        Obtain the content type passed by the browser.
        Specified by:
        getContentType in interface Part
        Returns:
        The content type passed by the browser or null if not defined.
        See Also:
        Part.getContentType()
      • getHeader

        public java.lang.String getHeader​(java.lang.String name)
        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.
        Specified by:
        getHeader in interface Part
        Parameters:
        name - Header name
        Returns:
        The header value or null if the header is not present
        See Also:
        Part.getHeader(java.lang.String)
      • getHeaderNames

        public java.util.Collection<java.lang.String> getHeaderNames()
        Deprecated.
        Description copied from interface: Part
        Get the header names provided for this part.
        Specified by:
        getHeaderNames in interface Part
        Returns:
        a Collection of all the header names provided for this part.
        See Also:
        Part.getHeaderNames()
      • getHeaders

        public java.util.Collection<java.lang.String> getHeaders​(java.lang.String name)
        Deprecated.
        Description copied from interface: Part
        Obtain all the values of the specified part header.
        Specified by:
        getHeaders in interface Part
        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:
        Part.getHeaders(java.lang.String)
      • getInputStream

        public java.io.InputStream getInputStream()
                                           throws java.io.IOException
        Deprecated.
        Description copied from interface: Part
        Obtain an InputStream that can be used to retrieve the contents of the file.
        Specified by:
        getInputStream in interface Part
        Returns:
        An InputStream for the contents of the file
        Throws:
        java.io.IOException - if an I/O occurs while obtaining the stream
        See Also:
        Part.getInputStream()
      • getSubmittedFileName

        public java.lang.String getSubmittedFileName()
        Deprecated.
        Description copied from interface: Part
        If this part represents an uploaded file, gets the file name submitted in the upload. Returns null if no file name is available or if this part is not a file upload.
        Specified by:
        getSubmittedFileName in interface Part
        Returns:
        the submitted file name or null.
        See Also:
        Part.getSubmittedFileName()
      • getBytes

        public byte[] getBytes()
        Deprecated.
      • getName

        public java.lang.String getName()
        Deprecated.
        Description copied from interface: Part
        Obtain the name of the field in the multipart form corresponding to this part.
        Specified by:
        getName in interface Part
        Returns:
        The name of the field in the multipart form corresponding to this part.
        See Also:
        Part.getName()
      • getSize

        public long getSize()
        Deprecated.
        Description copied from interface: Part
        Obtain the size of this part.
        Specified by:
        getSize in interface Part
        Returns:
        The size of the part if bytes
        See Also:
        Part.getSize()
      • write

        public void write​(java.lang.String fileName)
                   throws java.io.IOException
        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 interface Part
        Parameters:
        fileName - The location into which the uploaded part should be stored. Relative locations are relative to MultipartConfigElement.getLocation()
        Throws:
        java.io.IOException - if an I/O occurs while attempting to write the part
        See Also:
        Part.write(java.lang.String)
      • delete

        public void delete()
                    throws java.io.IOException
        Deprecated.
        Remove the file, whether or not Part.write() was called on it (ie no longer temporary)
        Specified by:
        delete in interface Part
        Throws:
        java.io.IOException - if an I/O occurs while attempting to delete the part
        See Also:
        Part.delete()
      • cleanUp

        public void cleanUp()
                     throws java.io.IOException
        Deprecated.
        Only remove tmp files.
        Throws:
        java.io.IOException - if unable to delete the file
      • getFile

        public java.io.File getFile()
        Deprecated.
        Get the file
        Returns:
        the file, if any, the data has been written to.
      • getContentDispositionFilename

        public java.lang.String getContentDispositionFilename()
        Deprecated.
        Get the filename from the content-disposition.
        Returns:
        null or the filename