Examples of SVNDeltaGenerator


Examples of org.tmatesoft.svn.core.io.diff.SVNDeltaGenerator

        SVNRepository repos = SVNRepositoryFactory.create(reposURL);
       
        ISVNEditor commitEditor = repos.getCommitEditor("initializing the repository with a greek tree",
                null, false, null, null);

        SVNDeltaGenerator deltaGenerator = new SVNDeltaGenerator();
       
        commitEditor.openRoot(SVNRepository.INVALID_REVISION);

        //add /iota file
        commitEditor.addFile(IOTA, null, SVNRepository.INVALID_REVISION);
        commitEditor.applyTextDelta(IOTA, null);
        String fileText = (String) ourGreekTreeFiles.get(IOTA);
        String checksum = deltaGenerator.sendDelta(IOTA, new ByteArrayInputStream(fileText.getBytes()),
                commitEditor, true);
        commitEditor.closeFile(IOTA, checksum);
       
        //add /A directory
        commitEditor.addDir("A", null, SVNRepository.INVALID_REVISION);
       
        //add /A/mu file
        String muPath = "A/" + MU;
        commitEditor.addFile(muPath, null, SVNRepository.INVALID_REVISION);
        commitEditor.applyTextDelta(muPath, null);
        fileText = (String) ourGreekTreeFiles.get(MU);
        checksum = deltaGenerator.sendDelta(muPath, new ByteArrayInputStream(fileText.getBytes()), commitEditor,
                true);
        commitEditor.closeFile(muPath, checksum);
       
        commitEditor.addDir("A/B", null, SVNRepository.INVALID_REVISION);
       
        //add /A/B/lambda file
        String lambdaPath = "A/B/" + LAMBDA;
        commitEditor.addFile(lambdaPath, null, SVNRepository.INVALID_REVISION);
        commitEditor.applyTextDelta(lambdaPath, null);
        fileText = (String) ourGreekTreeFiles.get(LAMBDA);
        checksum = deltaGenerator.sendDelta(lambdaPath, new ByteArrayInputStream(fileText.getBytes()), commitEditor,
                true);
        commitEditor.closeFile(lambdaPath, checksum);
       
        commitEditor.addDir("A/B/E", null, SVNRepository.INVALID_REVISION);

        //add /A/B/E/alpha file
        String alphaPath = "A/B/E/" + ALPHA;
        commitEditor.addFile(alphaPath, null, SVNRepository.INVALID_REVISION);
        commitEditor.applyTextDelta(alphaPath, null);
        fileText = (String) ourGreekTreeFiles.get(ALPHA);
        checksum = deltaGenerator.sendDelta(alphaPath, new ByteArrayInputStream(fileText.getBytes()), commitEditor,
                true);
        commitEditor.closeFile(alphaPath, checksum);
       
        //add /A/B/E/beta file
        String betaPath = "A/B/E/" + BETA;
        commitEditor.addFile(betaPath, null, SVNRepository.INVALID_REVISION);
        commitEditor.applyTextDelta(betaPath, null);
        fileText = (String) ourGreekTreeFiles.get(BETA);
        checksum = deltaGenerator.sendDelta(betaPath, new ByteArrayInputStream(fileText.getBytes()), commitEditor,
                true);
        commitEditor.closeFile(betaPath, checksum);
       
        //close /A/B/E
        commitEditor.closeDir();
       
        //add /A/B/F
        commitEditor.addDir("A/B/F", null, SVNRepository.INVALID_REVISION);
       
        //close /A/B/F
        commitEditor.closeDir();
       
        //close /A/B
        commitEditor.closeDir();

        //add /A/C
        commitEditor.addDir("A/C", null, SVNRepository.INVALID_REVISION);
       
        //close /A/C
        commitEditor.closeDir();

        //add /A/D
        commitEditor.addDir("A/D", null, SVNRepository.INVALID_REVISION);
       
        //add /A/D/gamma file
        String gammaPath = "A/D/" + GAMMA;
        commitEditor.addFile(gammaPath, null, SVNRepository.INVALID_REVISION);
        commitEditor.applyTextDelta(gammaPath, null);
        fileText = (String) ourGreekTreeFiles.get(GAMMA);
        checksum = deltaGenerator.sendDelta(gammaPath, new ByteArrayInputStream(fileText.getBytes()), commitEditor,
                true);
        commitEditor.closeFile(gammaPath, checksum);
       
        //add /A/D/G
        commitEditor.addDir("A/D/G", null, SVNRepository.INVALID_REVISION);
       
        //add /A/D/G/pi file
        String piPath = "A/D/G/" + PI;
        commitEditor.addFile(piPath, null, SVNRepository.INVALID_REVISION);
        commitEditor.applyTextDelta(piPath, null);
        fileText = (String) ourGreekTreeFiles.get(PI);
        checksum = deltaGenerator.sendDelta(piPath, new ByteArrayInputStream(fileText.getBytes()), commitEditor,
                true);
        //close /A/D/G/pi file
        commitEditor.closeFile(piPath, checksum);

        //add /A/D/G/rho file
        String rhoPath = "A/D/G/" + RHO;
        commitEditor.addFile(rhoPath, null, SVNRepository.INVALID_REVISION);
        commitEditor.applyTextDelta(rhoPath, null);
        fileText = (String) ourGreekTreeFiles.get(RHO);
        checksum = deltaGenerator.sendDelta(rhoPath, new ByteArrayInputStream(fileText.getBytes()), commitEditor,
                true);
        //close /A/D/G/rho file
        commitEditor.closeFile(rhoPath, checksum);

        //add /A/D/G/tau file
        String tauPath = "A/D/G/" + TAU;
        commitEditor.addFile(tauPath, null, SVNRepository.INVALID_REVISION);
        commitEditor.applyTextDelta(tauPath, null);
        fileText = (String) ourGreekTreeFiles.get(TAU);
        checksum = deltaGenerator.sendDelta(tauPath, new ByteArrayInputStream(fileText.getBytes()), commitEditor,
                true);
        //close /A/D/G/tau file
        commitEditor.closeFile(tauPath, checksum);
       
        //close /A/D/G
        commitEditor.closeDir();

        //add /A/D/H
        commitEditor.addDir("A/D/H", null, SVNRepository.INVALID_REVISION);

        //add /A/D/H/chi file
        String chiPath = "A/D/H/" + CHI;
        commitEditor.addFile(chiPath, null, SVNRepository.INVALID_REVISION);
        commitEditor.applyTextDelta(chiPath, null);
        fileText = (String) ourGreekTreeFiles.get(CHI);
        checksum = deltaGenerator.sendDelta(chiPath, new ByteArrayInputStream(fileText.getBytes()), commitEditor,
                true);
        //close /A/D/H/chi file
        commitEditor.closeFile(chiPath, checksum);

        //add /A/D/H/omega file
        String omegaPath = "A/D/H/" + OMEGA;
        commitEditor.addFile(omegaPath, null, SVNRepository.INVALID_REVISION);
        commitEditor.applyTextDelta(omegaPath, null);
        fileText = (String) ourGreekTreeFiles.get(OMEGA);
        checksum = deltaGenerator.sendDelta(omegaPath, new ByteArrayInputStream(fileText.getBytes()), commitEditor,
                true);
        //close /A/D/H/omega file
        commitEditor.closeFile(omegaPath, checksum);

        //add /A/D/H/psi file
        String psiPath = "A/D/H/" + PSI;
        commitEditor.addFile(psiPath, null, SVNRepository.INVALID_REVISION);
        commitEditor.applyTextDelta(psiPath, null);
        fileText = (String) ourGreekTreeFiles.get(PSI);
        checksum = deltaGenerator.sendDelta(psiPath, new ByteArrayInputStream(fileText.getBytes()), commitEditor,
                true);
        //close /A/D/H/psi file
        commitEditor.closeFile(psiPath, checksum);

        //close /A/D/H
View Full Code Here

Examples of org.tmatesoft.svn.core.io.diff.SVNDeltaGenerator

                sourceIS = SVNFileUtil.DUMMY_IN;
            }
 
            editor.applyTextDelta(path, expectedChecksum);
            if (myDeltaGenerator == null) {
                myDeltaGenerator = new SVNDeltaGenerator();
            }

            try {
                sourceIS = openSrcStream ? SVNFileUtil.openFileForReading(baseFile, SVNLogType.WC) : sourceIS;
                if (useChecksummedStream) {
View Full Code Here

Examples of org.tmatesoft.svn.core.io.diff.SVNDeltaGenerator

        return myDeltaReader;
    }

    private SVNDeltaGenerator getDeltaGenerator() {
        if (myDeltaGenerator == null) {
            myDeltaGenerator = new SVNDeltaGenerator();
        }
        return myDeltaGenerator;
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.io.diff.SVNDeltaGenerator

        myIsIncludeEntryProperties = includeEntryProperties;
        myIsIgnoreAncestry = ignoreAncestry;
        myIsSendTextDeltas = sendTextDeltas;
        myEditor = editor;
        myDeltaCombiner = new SVNDeltaCombiner();
        myDeltaGenerator = new SVNDeltaGenerator();
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.io.diff.SVNDeltaGenerator

            for (int i = newPaths.size() - 1; i >= 0; i--) {
                newDirPath = newDirPath == null ? (String) newPaths.get(i) : SVNPathUtil.append(newDirPath, (String) newPaths.get(i));
                commitEditor.addDir(newDirPath, null, -1);
            }
            changed = newPaths.size() > 0;
            SVNDeltaGenerator deltaGenerator = new SVNDeltaGenerator();
            if (srcKind == SVNFileType.DIRECTORY) {
                changed |= importDir(deltaGenerator, path, newDirPath, useGlobalIgnores,
                        ignoreUnknownNodeTypes, depth, commitEditor);
            } else if (srcKind == SVNFileType.FILE || srcKind == SVNFileType.SYMLINK) {
                if (!useGlobalIgnores || !DefaultSVNOptions.isIgnored(getOptions(), path.getName())) {
View Full Code Here

Examples of org.tmatesoft.svn.core.io.diff.SVNDeltaGenerator

      editor.openRoot(-1);
      editor.addFile(fileName, null, -1);

      editor.applyTextDelta(fileName, null);

      SVNDeltaGenerator deltaGenerator = new SVNDeltaGenerator();
      String checksum = deltaGenerator.sendDelta(fileName, new ByteArrayInputStream(file), editor, true);

      editor.closeFile(fileName, checksum);
      editor.closeDir();
      editor.closeEdit();
    } catch (Exception ex) {
View Full Code Here

Examples of org.tmatesoft.svn.core.io.diff.SVNDeltaGenerator

      editor.openRoot(-1);
      editor.addFile(fileName, null, -1);

      editor.applyTextDelta(fileName, null);

      SVNDeltaGenerator deltaGenerator = new SVNDeltaGenerator();
      String checksum = deltaGenerator.sendDelta(fileName, new ByteArrayInputStream(file), editor, true);

      editor.closeFile(fileName, checksum);
      editor.closeDir();
      editor.closeEdit();
    } catch (Exception ex) {
View Full Code Here

Examples of org.tmatesoft.svn.core.io.diff.SVNDeltaGenerator

    editor.addFile(filePath, null ,-1);

    editor.applyTextDelta(filePath, null);

    SVNDeltaGenerator deltaGenerator = new SVNDeltaGenerator();
    String checksum = deltaGenerator.sendDelta(filePath, new ByteArrayInputStream(data), editor, true);

    editor.closeFile(filePath, checksum);

 
View Full Code Here

Examples of org.tmatesoft.svn.core.io.diff.SVNDeltaGenerator

     */
  public static void modifyFile(ISVNEditor editor, String filePath, byte[] oldData, byte[] newData) throws SVNException {

    editor.applyTextDelta(filePath, null);
       
    SVNDeltaGenerator deltaGenerator = new SVNDeltaGenerator();
    deltaGenerator.sendDelta(filePath, new ByteArrayInputStream(oldData), 0, new ByteArrayInputStream(newData), editor, true);
  }
View Full Code Here

Examples of org.tmatesoft.svn.core.io.diff.SVNDeltaGenerator

        return myDeltaReader;
    }

    private SVNDeltaGenerator getDeltaGenerator() {
        if (myDeltaGenerator == null) {
            myDeltaGenerator = new SVNDeltaGenerator();
        }
        return myDeltaGenerator;
    }
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.