Examples of ISVNDeltaConsumer


Examples of org.tmatesoft.svn.core.io.ISVNDeltaConsumer

            FSFS fsfs = resource.getFSFS();
            FSTransactionInfo txn = resource.getTxnInfo();
            Collection lockTokens = resource.getLockTokens();
            String userName = resource.getUserName();
            FSCommitter committer = getCommitter(fsfs, root, txn, lockTokens, userName);
            ISVNDeltaConsumer deltaConsumer = getDeltaConsumer(root, committer, fsfs, userName, lockTokens);
            SVNDeltaGenerator deltaGenerator = new SVNDeltaGenerator();
            InputStream inputStream = null;
            try {
                inputStream = getRequestInputStream();
                byte[] buffer = new byte[2048];
                int readCount = -1;
                while ((readCount = inputStream.read(buffer)) != -1) {
                    if (readCount == 0) {
                        continue;
                    }
                    if (deltaReader != null) {
                        deltaReader.nextWindow(buffer, 0, readCount, path, deltaConsumer);
                    } else {
                        deltaGenerator.sendDelta(path, buffer, readCount, deltaConsumer);
                    }
                }
            } catch (IOException ioe) {
                error = new DAVException("An error occurred while reading the request body.", HttpServletResponse.SC_BAD_REQUEST, 0);
            } catch (SVNException svne) {
                error = DAVException.convertError(svne.getErrorMessage(), HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                        "could not write the file contents", null);
            } finally {
                SVNFileUtil.closeFile(inputStream);
                if (deltaReader != null) {
                    try {
                        deltaReader.reset(path, deltaConsumer);
                    } catch (SVNException svne) {
                        error2 = DAVException.convertError(svne.getErrorMessage(), HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                                "error finalizing applying windows", null);
                    }
                   
                    if (error2 != null && error == null) {
                        error = error2;
                    }
                    deltaConsumer.textDeltaEnd(path);
                }
            }
        }
       
        if (error == null) {
View Full Code Here

Examples of org.tmatesoft.svn.core.io.ISVNDeltaConsumer

                            "Could not set mime-type property.", null);
                }
            }
        }
       
        ISVNDeltaConsumer deltaConsumer = getDeltaConsumer(root, committer, fsfs, resource.getUserName(), resource.getLockTokens());
        try {
            deltaConsumer.applyTextDelta(path, resource.getBaseChecksum());
        } catch (SVNException svne) {
            throw DAVException.convertError(svne.getErrorMessage(), HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                    "Could not prepare to write the file", null);
        }
       
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.