1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.scm.provider.svn;
20
21 import java.util.Date;
22 import java.util.Iterator;
23 import java.util.List;
24
25 import org.apache.commons.lang3.StringUtils;
26 import org.apache.maven.scm.ChangeFile;
27 import org.apache.maven.scm.ChangeSet;
28 import org.apache.maven.scm.provider.ScmProviderRepository;
29 import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository;
30
31
32
33
34
35 public class SvnChangeSet extends ChangeSet {
36
37 private static final long serialVersionUID = -4454710577968060741L;
38
39 public SvnChangeSet() {
40 super();
41 }
42
43 public SvnChangeSet(String strDate, String userDatePattern, String comment, String author, List<ChangeFile> files) {
44 super(strDate, userDatePattern, comment, author, files);
45 }
46
47 public SvnChangeSet(Date date, String comment, String author, List<ChangeFile> files) {
48 super(date, comment, author, files);
49 }
50
51
52 public boolean containsFilename(String filename, ScmProviderRepository repository) {
53 SvnScmProviderRepository repo = (SvnScmProviderRepository) repository;
54
55 String url = repo.getUrl();
56
57 if (!url.endsWith("/")) {
58 url += "/";
59 }
60
61 String currentFile = url + StringUtils.replace(filename, "\\", "/");
62
63 if (getFiles() != null) {
64 for (Iterator<ChangeFile> i = getFiles().iterator(); i.hasNext(); ) {
65 ChangeFile file = i.next();
66
67 if (currentFile.endsWith(StringUtils.replace(file.getName(), "\\", "/"))) {
68 return true;
69 }
70 }
71 }
72
73 return false;
74 }
75 }