Examples of FSDeltaConsumer


Examples of org.tmatesoft.svn.core.internal.io.fs.FSDeltaConsumer

    public void closeNode() throws SVNException {
        myCurrentNodeBaton = null;
    }

    public void applyTextDelta() throws SVNException {
        FSDeltaConsumer fsConsumer = myCurrentRevisionBaton.getConsumer();
        fsConsumer.applyTextDelta(myCurrentNodeBaton.myPath, myCurrentNodeBaton.myBaseChecksum);
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.io.fs.FSDeltaConsumer

        FSDeltaConsumer fsConsumer = myCurrentRevisionBaton.getConsumer();
        fsConsumer.applyTextDelta(myCurrentNodeBaton.myPath, myCurrentNodeBaton.myBaseChecksum);
    }

    public void setFullText() throws SVNException {
        FSDeltaConsumer fsConsumer = myCurrentRevisionBaton.getConsumer();
        fsConsumer.applyText(myCurrentNodeBaton.myPath);
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.io.fs.FSDeltaConsumer

        FSDeltaConsumer fsConsumer = myCurrentRevisionBaton.getConsumer();
        fsConsumer.applyText(myCurrentNodeBaton.myPath);
    }

    public void parseTextBlock(InputStream dumpStream, long contentLength, boolean isDelta) throws SVNException {
        FSDeltaConsumer fsConsumer = myCurrentRevisionBaton.getConsumer();

        try {
            if (isDelta) {
                applyTextDelta();
            } else {
                setFullText();
            }
           
            byte[] buffer = null;
            if (contentLength == 0) {
                getDeltaGenerator().sendDelta(myCurrentNodeBaton.myPath, SVNFileUtil.DUMMY_IN, fsConsumer, false);
            } else {
                if (!isDelta) {
                    //
                    InputStream tgt = new FixedSizeInputStream(dumpStream, contentLength);
                    getDeltaGenerator().sendDelta(myCurrentNodeBaton.myPath, tgt, fsConsumer, false);
                } else {
                    buffer = new byte[SVNFileUtil.STREAM_CHUNK_SIZE];
                    SVNDeltaReader deltaReader = null;
                    try {
                        while (contentLength > 0) {
                            int numToRead = contentLength > SVNFileUtil.STREAM_CHUNK_SIZE ? SVNFileUtil.STREAM_CHUNK_SIZE : (int) contentLength;
                            int read = 0;
                            while(numToRead > 0) {
                                int numRead = dumpStream.read(buffer, read, numToRead);
                                if (numRead < 0) {
                                    SVNAdminHelper.generateIncompleteDataError();
                                }
                                read += numRead;
                                numToRead -= numRead;
                            }
                            deltaReader = getDeltaReader();
                            deltaReader.nextWindow(buffer, 0, read, myCurrentNodeBaton.myPath, fsConsumer);
                            contentLength -= read;
                        }
                    } catch (IOException ioe) {
                        SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, ioe.getMessage());
                        SVNErrorManager.error(err, ioe, SVNLogType.FSFS);
                    }
                    if (deltaReader != null) {
                        deltaReader.reset(myCurrentNodeBaton.myPath, fsConsumer);
                    }
                    fsConsumer.textDeltaEnd(myCurrentNodeBaton.myPath);
                }
            }
        } catch (SVNException svne) {
            fsConsumer.abort();
            throw svne;
        }
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.io.fs.FSDeltaConsumer

        private FSCommitter myCommitter;
        private FSDeltaConsumer myDeltaConsumer;
       
        public FSDeltaConsumer getConsumer() {
            if (myDeltaConsumer == null) {
                myDeltaConsumer = new FSDeltaConsumer("", myTxnRoot, myFSFS, getCommitter(), null, null);
            }
            return myDeltaConsumer;
        }
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.io.fs.FSDeltaConsumer

    public void closeNode() throws SVNException {
        myCurrentNodeBaton = null;
    }

    public void applyTextDelta() throws SVNException {
        FSDeltaConsumer fsConsumer = myCurrentRevisionBaton.getConsumer();
        fsConsumer.applyTextDelta(myCurrentNodeBaton.myPath, myCurrentNodeBaton.myBaseChecksum);
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.io.fs.FSDeltaConsumer

        FSDeltaConsumer fsConsumer = myCurrentRevisionBaton.getConsumer();
        fsConsumer.applyTextDelta(myCurrentNodeBaton.myPath, myCurrentNodeBaton.myBaseChecksum);
    }

    public void setFullText() throws SVNException {
        FSDeltaConsumer fsConsumer = myCurrentRevisionBaton.getConsumer();
        fsConsumer.applyText(myCurrentNodeBaton.myPath);
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.io.fs.FSDeltaConsumer

        FSDeltaConsumer fsConsumer = myCurrentRevisionBaton.getConsumer();
        fsConsumer.applyText(myCurrentNodeBaton.myPath);
    }

    public void parseTextBlock(InputStream dumpStream, long contentLength, boolean isDelta) throws SVNException {
        FSDeltaConsumer fsConsumer = myCurrentRevisionBaton.getConsumer();

        try {
            if (isDelta) {
                applyTextDelta();
            } else {
                setFullText();
            }
           
            String checksum = null;
            byte[] buffer = null;
            if (contentLength == 0) {
                getDeltaGenerator().sendDelta(myCurrentNodeBaton.myPath, SVNFileUtil.DUMMY_IN, fsConsumer, false);
            } else {
                if (!isDelta) {
                    //
                    InputStream tgt = new FixedSizeInputStream(dumpStream, contentLength);
                    checksum = getDeltaGenerator().sendDelta(myCurrentNodeBaton.myPath, tgt, fsConsumer, true);
                } else {
                    buffer = new byte[SVNFileUtil.STREAM_CHUNK_SIZE];
                    SVNDeltaReader deltaReader = null;
                    try {
                        while (contentLength > 0) {
                            int numToRead = contentLength > SVNFileUtil.STREAM_CHUNK_SIZE ? SVNFileUtil.STREAM_CHUNK_SIZE : (int) contentLength;
                            int read = 0;
                            while(numToRead > 0) {
                                int numRead = dumpStream.read(buffer, read, numToRead);
                                if (numRead < 0) {
                                    SVNAdminHelper.generateIncompleteDataError();
                                }
                                read += numRead;
                                numToRead -= numRead;
                            }
                            deltaReader = getDeltaReader();
                            deltaReader.nextWindow(buffer, 0, read, myCurrentNodeBaton.myPath, fsConsumer);
                            contentLength -= read;
                        }
                    } catch (IOException ioe) {
                        SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, ioe.getMessage());
                        SVNErrorManager.error(err, ioe, SVNLogType.FSFS);
                    }
                    if (deltaReader != null) {
                        deltaReader.reset(myCurrentNodeBaton.myPath, fsConsumer);
                    }
                    fsConsumer.textDeltaEnd(myCurrentNodeBaton.myPath);
                    checksum = fsConsumer.getChecksum();
                }
            }
           
            if (checksum != null && myCurrentNodeBaton.myResultChecksum != null) {
                if (!checksum.equals(myCurrentNodeBaton.myResultChecksum)) {
                    SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CHECKSUM_MISMATCH, "Checksum mismatch for ''{0}'':\n   expected:  {1}\n     actual:  {2}\n",
                            new Object[] { myCurrentNodeBaton.myPath, myCurrentNodeBaton.myResultChecksum, checksum });
                    SVNErrorManager.error(err, SVNLogType.FSFS);
                }
            }
        } catch (SVNException svne) {
            fsConsumer.abort();
            throw svne;
        }
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.io.fs.FSDeltaConsumer

        private FSCommitter myCommitter;
        private FSDeltaConsumer myDeltaConsumer;
       
        public FSDeltaConsumer getConsumer() {
            if (myDeltaConsumer == null) {
                myDeltaConsumer = new FSDeltaConsumer("", myTxnRoot, myFSFS, getCommitter(), null, null);
            }
            return myDeltaConsumer;
        }
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.io.fs.FSDeltaConsumer

        myCurrentNodeBaton = null;
        SVNDebugLog.getDefaultLog().info(" done.\n");
    }

    public void applyTextDelta() throws SVNException {
        FSDeltaConsumer fsConsumer = myCurrentRevisionBaton.getConsumer();
        fsConsumer.applyTextDelta(myCurrentNodeBaton.myPath, null);
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.io.fs.FSDeltaConsumer

        FSDeltaConsumer fsConsumer = myCurrentRevisionBaton.getConsumer();
        fsConsumer.applyTextDelta(myCurrentNodeBaton.myPath, null);
    }

    public void setFullText() throws SVNException {
        FSDeltaConsumer fsConsumer = myCurrentRevisionBaton.getConsumer();
        fsConsumer.applyText(myCurrentNodeBaton.myPath);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.