Class B2ContentFileWriter
- java.lang.Object
-
- com.backblaze.b2.client.contentHandlers.B2ContentWriter
-
- com.backblaze.b2.client.contentHandlers.B2ContentFileWriter
-
- All Implemented Interfaces:
B2ContentSink
public class B2ContentFileWriter extends B2ContentWriter
This is a B2ContentWriter which records the incoming data into a file on disk. It is careful to flush & sync the file when closing it.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
B2ContentFileWriter.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static B2ContentFileWriter.Builder
builder(java.io.File file)
protected java.io.InputStream
createDestinationInputStream()
protected java.io.OutputStream
createDestinationOutputStream()
-
Methods inherited from class com.backblaze.b2.client.contentHandlers.B2ContentWriter
failed, getHeadersOrNull, readContent, succeeded
-
-
-
-
Method Detail
-
builder
public static B2ContentFileWriter.Builder builder(java.io.File file)
-
createDestinationOutputStream
protected java.io.OutputStream createDestinationOutputStream() throws java.io.IOException
- Specified by:
createDestinationOutputStream
in classB2ContentWriter
- Returns:
- an outputStream to write to the destination. calling this is allowed to destroy the existing output (if any) and make it impossible for a stream created by createDestinationInputStream() to be able to read the data, if any.
- Throws:
java.io.IOException
- if there's any trouble
-
createDestinationInputStream
protected java.io.InputStream createDestinationInputStream() throws java.io.IOException
- Specified by:
createDestinationInputStream
in classB2ContentWriter
- Returns:
- a new inputStream to read from the destination. this might not contain what you think it should if readContents hasn't completed successfully.
- Throws:
java.io.IOException
- if there's any trouble
-
-