public class SimpleStoreOutputStream extends StoreOutputStream
Simple StoreOutputStream implementation.
Intermediate content is stored in a temporary directory but will not be visible until close() is called.
| Constructor and Description |
|---|
SimpleStoreOutputStream(java.io.File tempFile,
java.io.File finalFile,
boolean fileLocking)
constructs a SimpleStoreOutputStream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abort()
abort the object written to.
|
void |
close() |
void |
flush() |
protected boolean |
makeFileVisible()
Makes file visible by copying it from the hidden store to the visible one and removing the shadow file.
|
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
public SimpleStoreOutputStream(java.io.File tempFile,
java.io.File finalFile,
boolean fileLocking)
throws java.io.FileNotFoundException
java.io.FileNotFoundExceptionpublic void abort()
OutputStream.close() to prevent the object from becoming visible in
the store. After aborting the object, no further write operations are possible.abort in class StoreOutputStreampublic void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void write(byte[] b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.OutputStreamjava.io.IOExceptionprotected boolean makeFileVisible()
throws java.io.IOException
java.io.IOException - operation failedpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOException