public class FSOutputStream extends java.io.OutputStream implements ISVNDeltaConsumer
Modifier and Type | Field and Description |
---|---|
private boolean |
isHeaderWritten |
private SVNDeltaGenerator |
myDeltaGenerator |
private long |
myDeltaStart |
private boolean |
myIsClosed |
private boolean |
myIsCompress |
private java.security.MessageDigest |
myMD5Digest |
private long |
myRepOffset |
private long |
myRepSize |
private FSRevisionNode |
myRevNode |
private java.security.MessageDigest |
mySHA1Digest |
private long |
mySourceOffset |
private java.io.InputStream |
mySourceStream |
private java.io.File |
myTargetFile |
private CountingOutputStream |
myTargetFileOS |
private java.io.ByteArrayOutputStream |
myTextBuffer |
private FSWriteLock |
myTxnLock |
private FSTransactionRoot |
myTxnRoot |
static int |
SVN_DELTA_WINDOW_SIZE |
static int |
WRITE_BUFFER_SIZE |
Modifier | Constructor and Description |
---|---|
private |
FSOutputStream(FSRevisionNode revNode,
CountingOutputStream targetFileOS,
java.io.File targetFile,
java.io.InputStream source,
long deltaStart,
long repSize,
long repOffset,
FSTransactionRoot txnRoot,
boolean compress,
FSWriteLock txnLock) |
Modifier and Type | Method and Description |
---|---|
void |
applyTextDelta(java.lang.String path,
java.lang.String baseChecksum)
Starts applying text delta(s) to an opened file.
|
private void |
checkRepresentation(FSFS fsfs,
FSRepresentation representation,
java.lang.Object hint) |
void |
close() |
void |
closeStreams() |
static java.io.OutputStream |
createStream(FSRevisionNode revNode,
FSTransactionRoot txnRoot,
java.io.OutputStream dstStream,
boolean compress) |
FSRevisionNode |
getRevisionNode() |
private FSRepresentation |
getSharedRepresentation(FSFS fsfs,
FSRepresentation representation,
java.util.Map<java.lang.String,FSRepresentation> representationsMap) |
private FSP2LEntry |
lookupEntry(java.util.List<FSP2LEntry> entries,
long offset,
java.lang.Object hint) |
private FSP2LEntry |
lookupP2LEntry(FSFile revFile,
long revision,
long offset) |
private static java.io.File |
pathTxnSha1(FSFS fsfs,
FSRepresentation representation,
java.lang.String txnId) |
private void |
reset(FSRevisionNode revNode,
CountingOutputStream targetFileOS,
java.io.File targetFile,
java.io.InputStream source,
long deltaStart,
long repSize,
long repOffset,
FSTransactionRoot txnRoot,
FSWriteLock txnLock) |
private static void |
storeSha1RepMapping(FSFS fsfs,
FSRepresentation representation) |
java.io.OutputStream |
textDeltaChunk(java.lang.String path,
SVNDiffWindow diffWindow)
Collects a next delta chunk.
|
void |
textDeltaEnd(java.lang.String path)
Finalizes collecting text delta(s).
|
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
public static final int SVN_DELTA_WINDOW_SIZE
public static final int WRITE_BUFFER_SIZE
private boolean isHeaderWritten
private CountingOutputStream myTargetFileOS
private java.io.File myTargetFile
private long myDeltaStart
private long myRepSize
private long myRepOffset
private java.io.InputStream mySourceStream
private SVNDeltaGenerator myDeltaGenerator
private FSRevisionNode myRevNode
private java.security.MessageDigest myMD5Digest
private java.security.MessageDigest mySHA1Digest
private FSTransactionRoot myTxnRoot
private long mySourceOffset
private java.io.ByteArrayOutputStream myTextBuffer
private boolean myIsClosed
private boolean myIsCompress
private FSWriteLock myTxnLock
private FSOutputStream(FSRevisionNode revNode, CountingOutputStream targetFileOS, java.io.File targetFile, java.io.InputStream source, long deltaStart, long repSize, long repOffset, FSTransactionRoot txnRoot, boolean compress, FSWriteLock txnLock) throws SVNException
SVNException
private void reset(FSRevisionNode revNode, CountingOutputStream targetFileOS, java.io.File targetFile, java.io.InputStream source, long deltaStart, long repSize, long repOffset, FSTransactionRoot txnRoot, FSWriteLock txnLock)
public static java.io.OutputStream createStream(FSRevisionNode revNode, FSTransactionRoot txnRoot, java.io.OutputStream dstStream, boolean compress) throws SVNException
SVNException
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
public void closeStreams() throws java.io.IOException
java.io.IOException
public FSRevisionNode getRevisionNode()
public java.io.OutputStream textDeltaChunk(java.lang.String path, SVNDiffWindow diffWindow) throws SVNException
ISVNDeltaConsumer
If there are more than one windows for the file, this method is called several times.
textDeltaChunk
in interface ISVNDeltaConsumer
path
- a file path relative to the edit root
directorydiffWindow
- a next diff windowSVNException
public void textDeltaEnd(java.lang.String path) throws SVNException
ISVNDeltaConsumer
textDeltaEnd
in interface ISVNDeltaConsumer
path
- a file path relative to the edit root
directorySVNException
public void applyTextDelta(java.lang.String path, java.lang.String baseChecksum) throws SVNException
ISVNDeltaConsumer
applyTextDelta
in interface ISVNDeltaConsumer
path
- a file path relative to the edit root
directorybaseChecksum
- an MD5 checksum for the base file contents (before the
file is changed)SVNException
- if the calculated base file checksum didn't match the expected
baseChecksum
private FSRepresentation getSharedRepresentation(FSFS fsfs, FSRepresentation representation, java.util.Map<java.lang.String,FSRepresentation> representationsMap) throws SVNException
SVNException
private void checkRepresentation(FSFS fsfs, FSRepresentation representation, java.lang.Object hint) throws SVNException
SVNException
private FSP2LEntry lookupP2LEntry(FSFile revFile, long revision, long offset) throws SVNException
SVNException
private FSP2LEntry lookupEntry(java.util.List<FSP2LEntry> entries, long offset, java.lang.Object hint)
private static void storeSha1RepMapping(FSFS fsfs, FSRepresentation representation) throws SVNException
SVNException
private static java.io.File pathTxnSha1(FSFS fsfs, FSRepresentation representation, java.lang.String txnId)