Class FSOutputStream
java.lang.Object
java.io.OutputStream
org.tmatesoft.svn.core.internal.io.fs.FSOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
,ISVNDeltaConsumer
- Version:
- 1.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private SVNDeltaGenerator
private long
private boolean
private boolean
private MessageDigest
private long
private long
private FSRevisionNode
private MessageDigest
private long
private InputStream
private File
private CountingOutputStream
private ByteArrayOutputStream
private FSWriteLock
private FSTransactionRoot
static final int
static final int
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
FSOutputStream
(FSRevisionNode revNode, CountingOutputStream targetFileOS, File targetFile, InputStream source, long deltaStart, long repSize, long repOffset, FSTransactionRoot txnRoot, boolean compress, FSWriteLock txnLock) -
Method Summary
Modifier and TypeMethodDescriptionvoid
applyTextDelta
(String path, String baseChecksum) Starts applying text delta(s) to an opened file.private void
checkRepresentation
(FSFS fsfs, FSRepresentation representation, Object hint) void
close()
void
static OutputStream
createStream
(FSRevisionNode revNode, FSTransactionRoot txnRoot, OutputStream dstStream, boolean compress) private FSRepresentation
getSharedRepresentation
(FSFS fsfs, FSRepresentation representation, Map<String, FSRepresentation> representationsMap) private FSP2LEntry
lookupEntry
(List<FSP2LEntry> entries, long offset, Object hint) private FSP2LEntry
lookupP2LEntry
(FSFile revFile, long revision, long offset) private static File
pathTxnSha1
(FSFS fsfs, FSRepresentation representation, String txnId) private void
reset
(FSRevisionNode revNode, CountingOutputStream targetFileOS, File targetFile, InputStream source, long deltaStart, long repSize, long repOffset, FSTransactionRoot txnRoot, FSWriteLock txnLock) private static void
storeSha1RepMapping
(FSFS fsfs, FSRepresentation representation) textDeltaChunk
(String path, SVNDiffWindow diffWindow) Collects a next delta chunk.void
textDeltaEnd
(String path) Finalizes collecting text delta(s).void
write
(byte[] b) void
write
(byte[] b, int off, int len) void
write
(int b) Methods inherited from class java.io.OutputStream
flush, nullOutputStream
-
Field Details
-
SVN_DELTA_WINDOW_SIZE
public static final int SVN_DELTA_WINDOW_SIZE- See Also:
-
WRITE_BUFFER_SIZE
public static final int WRITE_BUFFER_SIZE- See Also:
-
isHeaderWritten
private boolean isHeaderWritten -
myTargetFileOS
-
myTargetFile
-
myDeltaStart
private long myDeltaStart -
myRepSize
private long myRepSize -
myRepOffset
private long myRepOffset -
mySourceStream
-
myDeltaGenerator
-
myRevNode
-
myMD5Digest
-
mySHA1Digest
-
myTxnRoot
-
mySourceOffset
private long mySourceOffset -
myTextBuffer
-
myIsClosed
private boolean myIsClosed -
myIsCompress
private boolean myIsCompress -
myTxnLock
-
-
Constructor Details
-
FSOutputStream
private FSOutputStream(FSRevisionNode revNode, CountingOutputStream targetFileOS, File targetFile, InputStream source, long deltaStart, long repSize, long repOffset, FSTransactionRoot txnRoot, boolean compress, FSWriteLock txnLock) throws SVNException - Throws:
SVNException
-
-
Method Details
-
reset
private void reset(FSRevisionNode revNode, CountingOutputStream targetFileOS, File targetFile, InputStream source, long deltaStart, long repSize, long repOffset, FSTransactionRoot txnRoot, FSWriteLock txnLock) -
createStream
public static OutputStream createStream(FSRevisionNode revNode, FSTransactionRoot txnRoot, OutputStream dstStream, boolean compress) throws SVNException - Throws:
SVNException
-
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
-
closeStreams
- Throws:
IOException
-
getRevisionNode
-
textDeltaChunk
Description copied from interface:ISVNDeltaConsumer
Collects a next delta chunk. The return type is nomore relevant and is left only for backward compatibility. So, the return value may be just null. Otherwise if it's not null, the stream will be immediately closed.If there are more than one windows for the file, this method is called several times.
- Specified by:
textDeltaChunk
in interfaceISVNDeltaConsumer
- Parameters:
path
- a file path relative to the edit root directorydiffWindow
- a next diff window- Returns:
- an output stream
- Throws:
SVNException
-
textDeltaEnd
Description copied from interface:ISVNDeltaConsumer
Finalizes collecting text delta(s).- Specified by:
textDeltaEnd
in interfaceISVNDeltaConsumer
- Parameters:
path
- a file path relative to the edit root directory- Throws:
SVNException
-
applyTextDelta
Description copied from interface:ISVNDeltaConsumer
Starts applying text delta(s) to an opened file.- Specified by:
applyTextDelta
in interfaceISVNDeltaConsumer
- Parameters:
path
- a file path relative to the edit root directorybaseChecksum
- an MD5 checksum for the base file contents (before the file is changed)- Throws:
SVNException
- if the calculated base file checksum didn't match the expectedbaseChecksum
-
checkRepresentation
private void checkRepresentation(FSFS fsfs, FSRepresentation representation, Object hint) throws SVNException - Throws:
SVNException
-
lookupP2LEntry
- Throws:
SVNException
-
lookupEntry
-
storeSha1RepMapping
private static void storeSha1RepMapping(FSFS fsfs, FSRepresentation representation) throws SVNException - Throws:
SVNException
-
pathTxnSha1
-