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 public class SvnChangeSet extends ChangeSet {
35
36 private static final long serialVersionUID = -4454710577968060741L;
37
38 public SvnChangeSet() {
39 super();
40 }
41
42 public SvnChangeSet(String strDate, String userDatePattern, String comment, String author, List<ChangeFile> files) {
43 super(strDate, userDatePattern, comment, author, files);
44 }
45
46 public SvnChangeSet(Date date, String comment, String author, List<ChangeFile> files) {
47 super(date, comment, author, files);
48 }
49
50
51
52
53 public boolean containsFilename(String filename, ScmProviderRepository repository) {
54 SvnScmProviderRepository repo = (SvnScmProviderRepository) repository;
55
56 String url = repo.getUrl();
57
58 if (!url.endsWith("/")) {
59 url += "/";
60 }
61
62 String currentFile = url + StringUtils.replace(filename, "\\", "/");
63
64 if (getFiles() != null) {
65 for (Iterator<ChangeFile> i = getFiles().iterator(); i.hasNext(); ) {
66 ChangeFile file = i.next();
67
68 if (currentFile.endsWith(StringUtils.replace(file.getName(), "\\", "/"))) {
69 return true;
70 }
71 }
72 }
73
74 return false;
75 }
76 }