diff --git a/src/main/java/org/codehaus/plexus/build/DefaultBuildContext.java b/src/main/java/org/codehaus/plexus/build/DefaultBuildContext.java index f83c6ba..429ebe3 100644 --- a/src/main/java/org/codehaus/plexus/build/DefaultBuildContext.java +++ b/src/main/java/org/codehaus/plexus/build/DefaultBuildContext.java @@ -20,6 +20,7 @@ import java.io.IOException; import java.io.OutputStream; import java.nio.file.Files; +import java.util.Comparator; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -47,6 +48,7 @@ @Singleton public class DefaultBuildContext implements BuildContext { + private static final String[] EMPTY_STRING_ARRAY = new String[0]; private final Map contextMap = new ConcurrentHashMap<>(); private final Logger logger = LoggerFactory.getLogger(DefaultBuildContext.class); /** {@inheritDoc} */ @@ -93,7 +95,43 @@ public void refresh(File file) { /** {@inheritDoc} */ public Scanner newDeleteScanner(File basedir) { - return new EmptyScanner(basedir); + return new Scanner() { + @Override + public void addDefaultExcludes() { + } + + @Override + public String[] getIncludedDirectories() { + return EMPTY_STRING_ARRAY; + } + + @Override + public String[] getIncludedFiles() { + return EMPTY_STRING_ARRAY; + } + + @Override + public void scan() { + } + + @Override + public void setExcludes(String[] excludes) { + } + + @Override + public void setIncludes(String[] includes) { + } + + @Override + public File getBasedir() { + return basedir; + } + + @Override + public void setFilenameComparator(Comparator comparator) { + + } + }; } /** {@inheritDoc} */ diff --git a/src/main/java/org/codehaus/plexus/build/EmptyScanner.java b/src/main/java/org/codehaus/plexus/build/EmptyScanner.java deleted file mode 100644 index 106b9d9..0000000 --- a/src/main/java/org/codehaus/plexus/build/EmptyScanner.java +++ /dev/null @@ -1,101 +0,0 @@ -/* -Copyright (c) 2008 Sonatype, Inc. All rights reserved. - -This program is licensed to you under the Apache License Version 2.0, -and you may not use this file except in compliance with the Apache License Version 2.0. -You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0. - -Unless required by applicable law or agreed to in writing, -software distributed under the Apache License Version 2.0 is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the Apache License Version 2.0 for the specific language governing permissions and limitations there under. -*/ - -package org.codehaus.plexus.build; - -import java.io.File; -import java.util.Comparator; - -import org.codehaus.plexus.util.Scanner; - -/** - * Scanner implementation never finds any files/directories. - */ -public class EmptyScanner implements Scanner { - - private static final String[] EMPTY_STRING_ARRAY = new String[0]; - - private final File basedir; - - /** - *

Constructor for EmptyScanner.

- * - * @param basedir a {@link java.io.File} object. - */ - public EmptyScanner(File basedir) { - this.basedir = basedir; - } - - /** - *

addDefaultExcludes.

- */ - public void addDefaultExcludes() { - } - - /** - *

getIncludedDirectories.

- * - * @return an array of {@link java.lang.String} objects. - */ - public String[] getIncludedDirectories() { - return EMPTY_STRING_ARRAY; - } - - /** - *

getIncludedFiles.

- * - * @return an array of {@link java.lang.String} objects. - */ - public String[] getIncludedFiles() { - return EMPTY_STRING_ARRAY; - } - - /** - *

scan.

- */ - public void scan() { - } - - /** - *

setExcludes.

- * - * @param excludes an array of {@link java.lang.String} objects. - */ - public void setExcludes(String[] excludes) { - } - - /** - *

setIncludes.

- * - * @param includes an array of {@link java.lang.String} objects. - */ - public void setIncludes(String[] includes) { - } - - /** - *

Getter for the field basedir.

- * - * @return a {@link java.io.File} object. - */ - public File getBasedir() { - return basedir; - } - - /** {@inheritDoc} */ - @Override - public void setFilenameComparator( Comparator comparator ) - { - - } - -}