Class VitamStreamingOutput
- java.lang.Object
-
- fr.gouv.vitam.common.server.application.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
-
-
Constructor Summary
Constructors Constructor Description VitamStreamingOutput(java.io.File file, boolean toDelete)
VitamStreamingOutput(java.io.InputStream inputStream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
write(java.io.OutputStream output)
-
-
-
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 outputtoDelete
- 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 interfacejavax.ws.rs.core.StreamingOutput
- Throws:
java.io.IOException
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfaceVitamAutoCloseable
-
-