javakit获取SVN日志信息

13年前
package com.svn;    import org.tmatesoft.svn.core.ISVNLogEntryHandler;  import org.tmatesoft.svn.core.SVNException;  import org.tmatesoft.svn.core.SVNLogEntry;  import org.tmatesoft.svn.core.SVNURL;  import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager;  import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory;  import org.tmatesoft.svn.core.internal.io.fs.FSRepositoryFactory;  import org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryFactoryImpl;  import org.tmatesoft.svn.core.io.SVNRepository;  import org.tmatesoft.svn.core.io.SVNRepositoryFactory;  import org.tmatesoft.svn.core.wc.SVNWCUtil;  /**   *    * @author pKF49035   *   */  public class SVNFactory  {            public SVNFactory(){                    DAVRepositoryFactory.setup();                    SVNRepositoryFactoryImpl.setup();                    FSRepositoryFactory.setup();      }             public void registerCollecter(String url, String[] targetPaths, String userName, String password,              long startRevision, long endRevision){          SVNRepository repository = null;          try          {              repository = SVNRepositoryFactory.create(SVNURL.parseURIDecoded(url));              ISVNAuthenticationManager authManager = SVNWCUtil.              createDefaultAuthenticationManager(userName, password);              repository.setAuthenticationManager(authManager);              ISVNLogEntryHandler handler = new ISVNLogEntryHandler() {                  @Override                  public void handleLogEntry(SVNLogEntry logEntry)                          throws SVNException {                     System.out.println(logEntry.getAuthor()+" "+logEntry.getRevision()+" "+logEntry.getDate()+" "+logEntry.getMessage()+" ");                  }                };              repository.log(targetPaths, startRevision, endRevision, true, true, handler);          }          catch (SVNException e)          {              System.err.println("Error while creating an SVNRepository for the location '"                      + url + "': " + e.getMessage());              return;          }      }  }