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