Class RestUploadParser


  • public class RestUploadParser
    extends com.github.elopteryx.upload.internal.BlockingUploadParser
    A subclass of the blocking parser. It doesn't have a dependency on the servlet request and can be initialized from the header values. This makes it ideal for a Jax-Rs environment, to be used in a message body reader.
    • Field Summary

      • Fields inherited from class com.github.elopteryx.upload.internal.BlockingUploadParser

        inputStream
      • Fields inherited from class com.github.elopteryx.upload.internal.AbstractUploadParser

        checkBuffer, context, dataBuffer, maxBytesUsed, maxRequestSize, MULTIPART_FORM_DATA, parseState, requestSize, sizeThreshold
    • Constructor Summary

      Constructors 
      Constructor Description
      RestUploadParser()
      Public constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      MultiPartImpl doBlockingParse​(long contentLength, String mimeType, String encoding, InputStream stream)
      Initializes the parser from the given parameters and performs a blocking parse.
      • Methods inherited from class com.github.elopteryx.upload.internal.BlockingUploadParser

        blockingRead, doBlockingParse
      • Methods inherited from class com.github.elopteryx.upload.internal.AbstractUploadParser

        beginPart, data, endPart, setErrorCallback, setMaxBytesUsed, setMaxPartSize, setMaxRequestSize, setPartBeginCallback, setPartEndCallback, setRequestCallback, setSizeThreshold, setUserObject
    • Constructor Detail

      • RestUploadParser

        public RestUploadParser()
        Public constructor.
    • Method Detail

      • doBlockingParse

        public MultiPartImpl doBlockingParse​(long contentLength,
                                             String mimeType,
                                             String encoding,
                                             InputStream stream)
                                      throws IOException
        Initializes the parser from the given parameters and performs a blocking parse.
        Parameters:
        contentLength - The length of the request
        mimeType - The content type of the request
        encoding - The character encoding of the request
        stream - The request stream
        Returns:
        The multipart object, representing the request
        Throws:
        IOException - If an error occurred with the I/O