2011-08-12 6 views
0

にファイルを追加するsvnkitを使用して:NoSuchMethodError私はsvnkitを使用して、私のリポジトリにファイルを追加しようとしているが、私はNoSuchMethodErrorがこのコード行を参照してもらう私のリポジトリ

SVNDiffWindow diffWindow = SVNDiffWindowBuilder.createReplacementDiffWindow(deltaLength); 

ここでスタックトレースです:

 File file = new File("c:/development/photolib/discounts/svnTesting/testThisTextCommit1.txt"); 
    try { 
     DAVRepositoryFactory.setup(); 
     String url = "https://subversion.access.dev/svn/sticks/media/trunk/Discounts/PhotoLib/svnTesting"; 

     SVNRepository repository = SVNRepositoryFactory.create(SVNURL.parseURIDecoded(url)); 
     ISVNEditor editor = repository.getCommitEditor("This is a log message.", new CommitMediator()); 

     editor.openRoot(-1); 
     editor.addFile("testThisTextCommit1.txt", null, -1); 
     editor.applyTextDelta("testThisTextCommit1.txt", null); 

     long deltaLength = file.length(); 
     SVNDiffWindow diffWindow = SVNDiffWindowBuilder.createReplacementDiffWindow(deltaLength); 
     OutputStream os = editor.textDeltaChunk("testThisTextCommit1.txt", diffWindow); 
     os.close(); 
     editor.textDeltaEnd("testThisTextCommit1.txt"); 
     editor.closeFile("testThisTextCommit1.txt", null); 
     editor.closeEdit(); 
    } 

それは私が日付VERSのうちを使用していますということでした:

java.lang.NoSuchMethodError: org.tmatesoft.svn.core.io.diff.SVNDiffInstruction.<init>(IJJ)V 
at org.tmatesoft.svn.core.io.diff.SVNDiffWindowBuilder.createReplacementDiffWindow(SVNDiffWindowBuilder.java:529) 
at adc.ui.util.SvnTest.testSvnCommit(SvnTest.java:109) 

そしてここでは、すべてのコードですイオン?これは私が使用している依存関係です:

<pluginRepository> 
    <id>org.tmatesoft.svnkit</id> 
    <name>tmatesoft.svnkit svnkit Repository</name> 
    <url>http://maven.svnkit.com/maven2/</url> 
</pluginRepository> 

答えて

0

SVNDiffWindowBuilderは使用されていません。次のコードは、その代わりに使用する必要があります。

String chksm = deltaGenerator.sendDelta(path, xontentsStream, editor, true); editor.closeFile(path, chksm); 

の作業コード:

SVNRepository repository = SVNRepositoryFactory.create(SVNURL.parseURIDecoded(svnUrl)); 
     SVNDeltaGenerator deltaGenerator = new SVNDeltaGenerator(); 
     ISVNEditor editor = repository.getCommitEditor("This is a log message.", new CommitMediator()); 
     editor.openRoot(-1); 
     editor.addFile("testThisTextCommit1.txt", null, -1); 
     editor.applyTextDelta(svnUrl, null); 
     InputStream is = SVNFileUtil.openFileForReading(file); 
     String chksm = deltaGenerator.sendDelta(svnUrl, is, editor, true); 

     is.close(); 
     editor.textDeltaEnd("testThisTextCommit1.txt"); 
     editor.closeFile("testThisTextCommit1.txt", chksm); 
     editor.closeEdit(); 
関連する問題