maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject cvs commit: maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/filter ArtifactFilter.java ExclusionSetFilter.java
Date Wed, 06 Oct 2004 01:57:59 GMT
jvanzyl     2004/10/05 18:57:59

  Added:       maven-artifact/src/main/java/org/apache/maven/artifact/resolver/filter
                        ArtifactFilter.java ExclusionSetFilter.java
  Log:
  o simple interface that will be used inside the resolver to allow artifacts to be filtered
out from the result list.
  
  Revision  Changes    Path
  1.1                  maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/filter/ArtifactFilter.java
  
  Index: ArtifactFilter.java
  ===================================================================
  package org.apache.maven.artifact.resolver.filter;
  
  /*
   * Copyright 2001-2004 The Apache Software Foundation.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  /**
   * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
   * @version $Id: ArtifactFilter.java,v 1.1 2004/10/06 01:57:59 jvanzyl Exp $
   */
  public interface ArtifactFilter
  {
      boolean include( String artifactId );
  }
  
  
  
  1.1                  maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/filter/ExclusionSetFilter.java
  
  Index: ExclusionSetFilter.java
  ===================================================================
  package org.apache.maven.artifact.resolver.filter;
  
  /*
   * Copyright 2001-2004 The Apache Software Foundation.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  import java.util.Arrays;
  import java.util.HashSet;
  import java.util.Set;
  
  /**
   * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
   * @version $Id: ExclusionSetFilter.java,v 1.1 2004/10/06 01:57:59 jvanzyl Exp $
   */
  public class ExclusionSetFilter
      implements ArtifactFilter
  {
      private Set excludes;
  
      public ExclusionSetFilter( String[] excludes )
      {
          this.excludes = new HashSet( Arrays.asList( excludes ) );
      }
  
      public ExclusionSetFilter( Set excludes )
      {
          this.excludes = excludes;
      }
  
      public boolean include( String artifactId )
      {
          if ( excludes.contains( artifactId ) )
          {
              return false;
          }
  
          return true;
      }
  }
  
  
  

Mime
View raw message