Package org.eclipse.jgit.lfs.internal
Class AtomicObjectOutputStream
java.lang.Object
java.io.OutputStream
org.eclipse.jgit.lfs.internal.AtomicObjectOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
Output stream writing content to a
LockFile
which is committed on
close(). The stream checks if the hash of the stream content matches the id.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private AnyLongObjectId
private LockFile
private DigestOutputStream
-
Constructor Summary
ConstructorsConstructorDescriptionAtomicObjectOutputStream
(Path path) Constructor for AtomicObjectOutputStream.AtomicObjectOutputStream
(Path path, AnyLongObjectId id) Constructor for AtomicObjectOutputStream. -
Method Summary
Methods inherited from class java.io.OutputStream
flush
-
Field Details
-
locked
-
out
-
aborted
private boolean aborted -
id
-
-
Constructor Details
-
AtomicObjectOutputStream
Constructor for AtomicObjectOutputStream.- Parameters:
path
- aPath
object.id
- aAnyLongObjectId
object.- Throws:
IOException
-
AtomicObjectOutputStream
Constructor for AtomicObjectOutputStream.- Parameters:
path
- aPath
object.- Throws:
IOException
-
-
Method Details
-
getId
Get theid
.- Returns:
- content hash of the object which was streamed through this
stream. May return
null
if called before closing this stream.
-
write
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
verifyHash
private void verifyHash() -
abort
public void abort()Aborts the stream. Temporary file will be deleted
-