Class VitamStreamingOutput

  • All Implemented Interfaces:
    VitamAutoCloseable, java.lang.AutoCloseable, javax.ws.rs.core.StreamingOutput

    public class VitamStreamingOutput
    extends java.lang.Object
    implements javax.ws.rs.core.StreamingOutput, VitamAutoCloseable
    Helper for Streaming to output one InputStream or File in non async mode
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void write​(java.io.OutputStream output)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • VitamStreamingOutput

        public VitamStreamingOutput​(java.io.InputStream inputStream)
        Parameters:
        inputStream - the inputstream to forward without Async mode
      • VitamStreamingOutput

        public VitamStreamingOutput​(java.io.File file,
                                    boolean toDelete)
        Parameters:
        file - the file to output
        toDelete - If True, will delete the file once sent
    • Method Detail

      • write

        public void write​(java.io.OutputStream output)
                   throws java.io.IOException
        Specified by:
        write in interface javax.ws.rs.core.StreamingOutput
        Throws:
        java.io.IOException
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface VitamAutoCloseable