Coverage Report - org.apache.maven.scm.provider.svn.SvnChangeSet
 
Classes in this File Line Coverage Branch Coverage Complexity
SvnChangeSet
0 %
0/18
0 %
0/8
2,25
 
 1  
 package org.apache.maven.scm.provider.svn;
 2  
 
 3  
 /*
 4  
  * Licensed to the Apache Software Foundation (ASF) under one
 5  
  * or more contributor license agreements.  See the NOTICE file
 6  
  * distributed with this work for additional information
 7  
  * regarding copyright ownership.  The ASF licenses this file
 8  
  * to you under the Apache License, Version 2.0 (the
 9  
  * "License"); you may not use this file except in compliance
 10  
  * with the License.  You may obtain a copy of the License at
 11  
  *
 12  
  * http://www.apache.org/licenses/LICENSE-2.0
 13  
  *
 14  
  * Unless required by applicable law or agreed to in writing,
 15  
  * software distributed under the License is distributed on an
 16  
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 17  
  * KIND, either express or implied.  See the License for the
 18  
  * specific language governing permissions and limitations
 19  
  * under the License.
 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  
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
 34  
  * @version $Id: SvnChangeSet.java 1058775 2011-01-13 22:52:38Z olamy $
 35  
  */
 36  
 public class SvnChangeSet
 37  
     extends ChangeSet
 38  
 {
 39  
 
 40  
     private static final long serialVersionUID = -4454710577968060741L;
 41  
 
 42  
     public SvnChangeSet()
 43  
     {
 44  0
         super();
 45  0
     }
 46  
 
 47  
     public SvnChangeSet( String strDate, String userDatePattern, String comment, String author,
 48  
                          List<ChangeFile> files )
 49  
     {
 50  0
         super( strDate, userDatePattern, comment, author, files );
 51  0
     }
 52  
 
 53  
     public SvnChangeSet( Date date, String comment, String author, List<ChangeFile> files )
 54  
     {
 55  0
         super( date, comment, author, files );
 56  0
     }
 57  
 
 58  
     /** {@inheritDoc} */
 59  
     public boolean containsFilename( String filename, ScmProviderRepository repository )
 60  
     {
 61  0
         SvnScmProviderRepository repo = (SvnScmProviderRepository) repository;
 62  
 
 63  0
         String url = repo.getUrl();
 64  
 
 65  0
         if ( !url.endsWith( "/" ) )
 66  
         {
 67  0
             url += "/";
 68  
         }
 69  
 
 70  0
         String currentFile = url + StringUtils.replace( filename, "\\", "/" );
 71  
 
 72  0
         if ( getFiles() != null )
 73  
         {
 74  0
             for ( Iterator<ChangeFile> i = getFiles().iterator(); i.hasNext(); )
 75  
             {
 76  0
                 ChangeFile file = i.next();
 77  
 
 78  0
                 if ( currentFile.endsWith( StringUtils.replace( file.getName(), "\\", "/" ) ) )
 79  
                 {
 80  0
                     return true;
 81  
                 }
 82  0
             }
 83  
         }
 84  
 
 85  0
         return false;
 86  
     }
 87  
 }