+++ /dev/null
-package org.apache.archiva.indexer.search;
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 org.apache.maven.index.ArtifactInfo;
-
-import java.util.Map;
-
-/**
- * @author Olivier Lamy
- * @since 1.4-M1
- */
-public interface ArtifactInfoFiler
-{
- boolean addArtifactInResult( ArtifactInfo artifact, Map<String, SearchResultHit> currentResult );
-}
--- /dev/null
+package org.apache.archiva.indexer.search;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 org.apache.maven.index.ArtifactInfo;
+
+import java.util.Map;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4-M1
+ */
+public interface ArtifactInfoFilter
+{
+ boolean addArtifactInResult( ArtifactInfo artifact, Map<String, SearchResultHit> currentResult );
+}
// we retun only artifacts without classifier in quick search, olamy cannot find a way to say with this field empty
// FIXME cannot find a way currently to setup this in constructQuery !!!
- return search( limits, q, indexingContextIds, NoClassifierArtifactInfoFiler.LIST, selectedRepos, false );
+ return search( limits, q, indexingContextIds, NoClassifierArtifactInfoFilter.LIST, selectedRepos, false );
}
throw new RepositorySearchException( "No search fields set." );
}
- return search( limits, q, indexingContextIds, Collections.<ArtifactInfoFiler>emptyList(),
+ return search( limits, q, indexingContextIds, Collections.<ArtifactInfoFilter>emptyList(),
searchFields.getRepositories(), searchFields.isIncludePomArtifacts() );
}
private SearchResults search( SearchResultLimits limits, BooleanQuery q, List<String> indexingContextIds,
- List<? extends ArtifactInfoFiler> filters,
+ List<? extends ArtifactInfoFilter> filters,
List<String> selectedRepos, boolean includePoms)
throws RepositorySearchException
{
private SearchResults convertToSearchResults( FlatSearchResponse response, SearchResultLimits limits,
- List<? extends ArtifactInfoFiler> artifactInfoFilers,
+ List<? extends ArtifactInfoFilter> artifactInfoFilters,
List<String>selectedRepos, boolean includePoms)
throws RepositoryAdminException
{
artifactInfo.packaging );
Map<String, SearchResultHit> hitsMap = results.getHitsMap();
- if ( !applyArtifactInfoFilters( artifactInfo, artifactInfoFilers, hitsMap ) )
+ if ( !applyArtifactInfoFilters( artifactInfo, artifactInfoFilters, hitsMap ) )
{
continue;
}
}
private boolean applyArtifactInfoFilters( ArtifactInfo artifactInfo,
- List<? extends ArtifactInfoFiler> artifactInfoFilers,
+ List<? extends ArtifactInfoFilter> artifactInfoFilters,
Map<String, SearchResultHit> currentResult )
{
- if ( artifactInfoFilers == null || artifactInfoFilers.isEmpty() )
+ if ( artifactInfoFilters == null || artifactInfoFilters.isEmpty() )
{
return true;
}
- for ( ArtifactInfoFiler filter : artifactInfoFilers )
+ for ( ArtifactInfoFilter filter : artifactInfoFilters )
{
if ( !filter.addArtifactInResult( artifactInfo, currentResult ) )
{
+++ /dev/null
-package org.apache.archiva.indexer.search;
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 org.apache.commons.lang.StringUtils;
-import org.apache.maven.index.ArtifactInfo;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author Olivier Lamy
- */
-public class NoClassifierArtifactInfoFiler
- implements ArtifactInfoFiler
-{
- public static final NoClassifierArtifactInfoFiler INSTANCE = new NoClassifierArtifactInfoFiler();
-
- public static final List<? extends ArtifactInfoFiler> LIST = Arrays.asList( INSTANCE );
-
- public boolean addArtifactInResult( ArtifactInfo artifact, Map<String, SearchResultHit> currentResult )
- {
- return StringUtils.isBlank( artifact.classifier );
- }
-}
--- /dev/null
+package org.apache.archiva.indexer.search;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 org.apache.commons.lang.StringUtils;
+import org.apache.maven.index.ArtifactInfo;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Olivier Lamy
+ */
+public class NoClassifierArtifactInfoFilter
+ implements ArtifactInfoFilter
+{
+ public static final NoClassifierArtifactInfoFilter INSTANCE = new NoClassifierArtifactInfoFilter();
+
+ public static final List<? extends ArtifactInfoFilter> LIST = Arrays.asList( INSTANCE );
+
+ public boolean addArtifactInResult( ArtifactInfo artifact, Map<String, SearchResultHit> currentResult )
+ {
+ return StringUtils.isBlank( artifact.classifier );
+ }
+}