| 1 | package net.oni2.svnaccess; | 
 
 
 
 
 | 2 |  | 
 
 
 
 
 | 3 | import java.util.Vector; | 
 
 
 
 
 | 4 |  | 
 
 
 
 
 | 5 | import org.tmatesoft.svn.core.ISVNLogEntryHandler; | 
 
 
 
 
 | 6 | import org.tmatesoft.svn.core.SVNException; | 
 
 
 
 
 | 7 | import org.tmatesoft.svn.core.SVNLogEntry; | 
 
 
 
 
 | 8 | import org.tmatesoft.svn.core.SVNLogEntryPath; | 
 
 
 
 
 | 9 |  | 
 
 
 
 
 | 10 |  | 
 
 
 
 
 | 11 | /** | 
 
 
 
 
 | 12 | * Used to get the updated files from SVN between working copy revision and | 
 
 
 
 
 | 13 | * HEAD. | 
 
 
 
 
 | 14 | * | 
 
 
 
 
 | 15 | * @author Christian Illy | 
 
 
 
 
 | 16 | */ | 
 
 
 
 
 | 17 | public class LogEntryHandler implements ISVNLogEntryHandler { | 
 
 
 
 
 | 18 |  | 
 
 
 
 
 | 19 | Vector<String>  target; | 
 
 
 
 
 | 20 | String                  base; | 
 
 
 
 
 | 21 |  | 
 
 
 
 
 | 22 |  | 
 
 
 
 
 | 23 | /** | 
 
 
 
 
 | 24 | * Create a new LogEntryHandler with a list to store the found paths to and | 
 
 
 
 
 | 25 | * a base path in the repository (paths outside are ignored) | 
 
 
 
 
 | 26 | * | 
 
 
 
 
 | 27 | * @param targetList Vector to store the found paths to | 
 
 
 
 
 | 28 | * @param basePath Base path of folder to look at | 
 
 
 
 
 | 29 | */ | 
 
 
 
 
 | 30 | public LogEntryHandler(Vector<String> targetList, String basePath) { | 
 
 
 
 
 | 31 | this.target = targetList; | 
 
 
 
 
 | 32 | this.base = basePath; | 
 
 
 
 
 | 33 | } | 
 
 
 
 
 | 34 |  | 
 
 
 
 
 | 35 | @Override | 
 
 
 
 
 | 36 | public void handleLogEntry(SVNLogEntry logEntry) throws SVNException { | 
 
 
 
 
 | 37 | for (Object o : logEntry.getChangedPaths().keySet()) { | 
 
 
 
 
 | 38 | SVNLogEntryPath p = (SVNLogEntryPath) logEntry.getChangedPaths() | 
 
 
 
 
 | 39 | .get(o); | 
 
 
 
 
 | 40 | if (p.getPath().startsWith(base)) { | 
 
 
 
 
 | 41 | if (p.getType() != 'D') | 
 
 
 
 
 | 42 | if (!target.contains(p.getPath())) | 
 
 
 
 
 | 43 | target.add(p.getPath()); | 
 
 
 
 
 | 44 | } | 
 
 
 
 
 | 45 | } | 
 
 
 
 
 | 46 | } | 
 
 
 
 
 | 47 |  | 
 
 
 
 
 | 48 | } |