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 booleanprivate AnyLongObjectIdprivate LockFileprivate 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, nullOutputStream
-
Field Details
-
locked
-
out
-
aborted
private boolean aborted -
id
-
-
Constructor Details
-
AtomicObjectOutputStream
Constructor for AtomicObjectOutputStream.- Parameters:
path- aPathobject.id- aAnyLongObjectIdobject.- Throws:
IOException
-
AtomicObjectOutputStream
Constructor for AtomicObjectOutputStream.- Parameters:
path- aPathobject.- Throws:
IOException
-
-
Method Details
-
getId
Get theid.- Returns:
- content hash of the object which was streamed through this
stream. May return
nullif called before closing this stream.
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
verifyHash
private void verifyHash() -
abort
public void abort()Aborts the stream. Temporary file will be deleted
-