From: James William Dumay Date: Tue, 16 Dec 2008 05:28:59 +0000 (+0000) Subject: Remove unused code X-Git-Tag: archiva-1.2~163 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5786c1db339c5ef0edac0b75d60ad0ba109a4c56;p=archiva.git Remove unused code git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@726963 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/BytecodeIndexTransformer.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/BytecodeIndexTransformer.java deleted file mode 100644 index 58c221034..000000000 --- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/BytecodeIndexTransformer.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.apache.maven.archiva.indexer.functors; - -/* - * 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.collections.Transformer; -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; -import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory; - -/** - * BytecodeIndexTransformer - * - * @version $Id$ - * - * @plexus.component role="org.apache.commons.collections.Transformer" role-hint="bytecode" - */ -public class BytecodeIndexTransformer - implements Transformer -{ - /** - * @plexus.requirement role-hint="lucene" - */ - private RepositoryContentIndexFactory indexFactory; - - public Object transform( Object input ) - { - if ( input instanceof ManagedRepositoryConfiguration ) - { - return indexFactory.createBytecodeIndex( (ManagedRepositoryConfiguration) input ); - } - - return input; - } -} diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/FileContentIndexTransformer.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/FileContentIndexTransformer.java deleted file mode 100644 index c04a715c5..000000000 --- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/FileContentIndexTransformer.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.apache.maven.archiva.indexer.functors; - -/* - * 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.collections.Transformer; -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; -import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory; - -/** - * FileContentIndexTransformer - * - * @version $Id$ - * - * @plexus.component role="org.apache.commons.collections.Transformer" role-hint="filecontent" - */ -public class FileContentIndexTransformer - implements Transformer -{ - /** - * @plexus.requirement role-hint="lucene" - */ - private RepositoryContentIndexFactory indexFactory; - - public Object transform( Object input ) - { - if ( input instanceof ManagedRepositoryConfiguration ) - { - return indexFactory.createFileContentIndex( (ManagedRepositoryConfiguration) input ); - } - - return input; - } -} diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/HashcodesIndexTransformer.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/HashcodesIndexTransformer.java deleted file mode 100644 index d3d9013e4..000000000 --- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/HashcodesIndexTransformer.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.apache.maven.archiva.indexer.functors; - -/* - * 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.collections.Transformer; -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; -import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory; - -/** - * HashcodesIndexTransformer - * - * @version $Id$ - * - * @plexus.component role="org.apache.commons.collections.Transformer" role-hint="hashcodes" - */ -public class HashcodesIndexTransformer - implements Transformer -{ - /** - * @plexus.requirement role-hint="lucene" - */ - private RepositoryContentIndexFactory indexFactory; - - public Object transform( Object input ) - { - if ( input instanceof ManagedRepositoryConfiguration ) - { - return indexFactory.createHashcodeIndex( (ManagedRepositoryConfiguration) input ); - } - - return input; - } -} diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/IndexExistsPredicate.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/IndexExistsPredicate.java deleted file mode 100644 index e20b1c63d..000000000 --- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/IndexExistsPredicate.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.apache.maven.archiva.indexer.functors; - -/* - * 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.collections.Predicate; -import org.apache.maven.archiva.indexer.RepositoryContentIndex; -import org.apache.maven.archiva.indexer.RepositoryIndexException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Test the {@link RepositoryContentIndex} object for the existance of an index. - * - * @version $Id$ - */ -public class IndexExistsPredicate - implements Predicate -{ - private Logger log = LoggerFactory.getLogger( IndexExistsPredicate.class ); - - public boolean evaluate( Object object ) - { - boolean satisfies = false; - - if ( object instanceof RepositoryContentIndex ) - { - RepositoryContentIndex index = (RepositoryContentIndex) object; - try - { - satisfies = index.exists(); - } - catch ( RepositoryIndexException e ) - { - log.info( - "Repository Content Index [" + index.getId() + "] for repository [" - + index.getRepository().getId() + "] does not exist yet in [" - + index.getIndexDirectory().getAbsolutePath() + "]." ); - } - } - - return satisfies; - } -} diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/SearchableTransformer.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/SearchableTransformer.java deleted file mode 100644 index 5b05b9838..000000000 --- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/SearchableTransformer.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.apache.maven.archiva.indexer.functors; - -/* - * 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.collections.Transformer; -import org.apache.maven.archiva.indexer.RepositoryIndexSearchException; -import org.apache.maven.archiva.indexer.lucene.LuceneRepositoryContentIndex; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * SearchableTransformer - * - * @version $Id$ - * - * @plexus.component role="org.apache.commons.collections.Transformer" role-hint="searchable" - */ -public class SearchableTransformer - implements Transformer -{ - private Logger log = LoggerFactory.getLogger( SearchableTransformer.class ); - - public Object transform( Object input ) - { - if ( input instanceof LuceneRepositoryContentIndex ) - { - try - { - LuceneRepositoryContentIndex index = (LuceneRepositoryContentIndex) input; - return index.getSearchable(); - } - catch ( RepositoryIndexSearchException e ) - { - log.warn("Unable to get searchable for index:" + e.getMessage(), e); - } - } - - return input; - } -} diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/UserAllowedToSearchRepositoryPredicate.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/UserAllowedToSearchRepositoryPredicate.java deleted file mode 100644 index 4b42257bd..000000000 --- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/UserAllowedToSearchRepositoryPredicate.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.apache.maven.archiva.indexer.functors; - -/* - * 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.collections.Predicate; -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; - -/** - * UserAllowedToSearchRepositoryPredicate - * - * @version $Id$ - */ -public class UserAllowedToSearchRepositoryPredicate - implements Predicate -{ - public boolean evaluate( Object object ) - { - boolean satisfies = false; - - if ( object instanceof ManagedRepositoryConfiguration ) - { - // TODO: perform check here. - satisfies = true; // Everyone is allowed! (for now) - } - - return satisfies; - } -}