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.FileNotFoundException
public 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 StoreOutputStream
public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] b, int off, int len) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
java.io.IOException
protected boolean makeFileVisible() throws java.io.IOException
java.io.IOException
- operation failedpublic void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException