source: java/SVNAccess/src/net/oni2/svnaccess/LogEntryHandler.java@ 1128

Last change on this file since 1128 was 732, checked in by alloc, 12 years ago

SVN access library

File size: 1.2 KB
Line 
1package net.oni2.svnaccess;
2
3import java.util.Vector;
4
5import org.tmatesoft.svn.core.ISVNLogEntryHandler;
6import org.tmatesoft.svn.core.SVNException;
7import org.tmatesoft.svn.core.SVNLogEntry;
8import 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 */
17public 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}
Note: See TracBrowser for help on using the repository browser.