Class ObjectDownloadListener

  • All Implemented Interfaces:
    EventListener, javax.servlet.WriteListener

    public class ObjectDownloadListener
    extends Object
    implements javax.servlet.WriteListener
    Handle asynchronous large object download.
    Since:
    4.7
    • Constructor Detail

      • ObjectDownloadListener

        public ObjectDownloadListener​(FileLfsRepository repository,
                                      javax.servlet.AsyncContext context,
                                      javax.servlet.http.HttpServletResponse response,
                                      AnyLongObjectId id)
                               throws IOException

        Constructor for ObjectDownloadListener.

        Parameters:
        repository - the repository storing large objects
        context - the servlet asynchronous context
        response - the servlet response
        id - id of the object to be downloaded
        Throws:
        IOException
    • Method Detail

      • onWritePossible

        public void onWritePossible()
                             throws IOException
        Write file content
        Specified by:
        onWritePossible in interface javax.servlet.WriteListener
        Throws:
        IOException
      • onError

        public void onError​(Throwable e)
        Handle errors
        Specified by:
        onError in interface javax.servlet.WriteListener