Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 58 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,25 @@
</distributionManagement>

<properties>
<cobertura.skip>true</cobertura.skip>
<javaVersion>8</javaVersion>
<sisuVersion>0.3.5</sisuVersion>
<slf4jVersion>1.7.36</slf4jVersion>
<cobertura.skip>true</cobertura.skip>
<project.build.outputTimestamp>2022-05-02T06:11:29Z</project.build.outputTimestamp>
</properties>

<dependencies>
<!-- JSR330 -->
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.4.2</version>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>

<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
<scope>test</scope>
<version>2.1.1</version>
<artifactId>plexus-utils</artifactId>
<version>3.4.2</version>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
Expand All @@ -58,17 +61,63 @@
<artifactId>commons-io</artifactId>
<version>2.11.0</version>
</dependency>

<!-- Tests -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<version>2.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4jVersion}</version>
<scope>test</scope>
</dependency>
<!-- Plexus container dependencies -->
<dependency>
<groupId>org.eclipse.sisu</groupId>
<artifactId>org.eclipse.sisu.plexus</artifactId>
<version>${sisuVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>5.1.0</version>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.eclipse.sisu</groupId>
<artifactId>sisu-maven-plugin</artifactId>
<version>${sisuVersion}</version>
<executions>
<execution>
<id>index-project</id>
<goals>
<goal>main-index</goal>
<goal>test-index</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-publish-plugin</artifactId>
Expand Down Expand Up @@ -128,7 +177,7 @@
<configuration>
<signature>
<groupId>org.codehaus.mojo.signature</groupId>
<artifactId>java17</artifactId>
<artifactId>java18</artifactId>
<version>1.0</version>
</signature>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package org.codehaus.plexus.components.io.filemappers;

/*
* Copyright 2007 The Codehaus 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 javax.inject.Named;

/**
* Alias for {@link IdentityMapper}
*/
@Named
public class DefaultFileMapper extends IdentityMapper
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
*/

import javax.annotation.Nonnull;
import javax.inject.Named;

/**
* An implementation of {@link FileMapper}, which changes the files extension.
*/
@Named( FileExtensionMapper.ROLE_HINT )
public class FileExtensionMapper extends AbstractFileMapper
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
*/

import javax.annotation.Nonnull;
import javax.inject.Named;

/**
* Implementation of a flattening file mapper: Removes all directory parts.
*/
@Named( FlattenFileMapper.ROLE_HINT )
public class FlattenFileMapper extends AbstractFileMapper
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
*/

import javax.annotation.Nonnull;
import javax.inject.Named;

/**
* Default implementation of {@link FileMapper}, which performs the identity mapping: All names are left unchanged.
*/
@Named( IdentityMapper.ROLE_HINT )
public class IdentityMapper extends AbstractFileMapper
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
*/

import javax.annotation.Nonnull;
import javax.inject.Named;

/**
* A file mapper, which maps to a constant target name.
*/
@Named( MergeFileMapper.ROLE_HINT )
public class MergeFileMapper extends AbstractFileMapper
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
*/

import javax.annotation.Nonnull;
import javax.inject.Named;

/**
* A file mapper, which maps by adding a prefix.
*/
@Named( PrefixFileMapper.ROLE_HINT )
public class PrefixFileMapper extends AbstractFileMapper
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@
*/

import javax.annotation.Nonnull;
import javax.inject.Named;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
* Implementation of a file mapper, which uses regular expressions.
*/
@Named( RegExpFileMapper.ROLE_HINT )
public class RegExpFileMapper
extends AbstractFileMapper
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
*/

import javax.annotation.Nonnull;
import javax.inject.Named;

/**
* A file mapper, which maps by adding a suffix to the filename.
* If the filename contains dot, the suffix will be added before.
* Example: {@code directory/archive.tar.gz => directory/archivesuffix.tar.gz}
*/
@Named( SuffixFileMapper.ROLE_HINT )
public class SuffixFileMapper extends AbstractFileMapper
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
*/

import javax.annotation.Nonnull;
import javax.inject.Named;

/**
* The default file selector: Selects all files.
*/
@Named( AllFilesFileSelector.ROLE_HINT )
public class AllFilesFileSelector implements FileSelector
{
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package org.codehaus.plexus.components.io.fileselectors;

/*
* Copyright 2007 The Codehaus 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 javax.inject.Named;

/**
* Alias for {@link AllFilesFileSelector}
*/
@Named
public class DefaultFileSelector extends AllFilesFileSelector
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.inject.Named;

/**
* This file selector uses a set of patterns for including/excluding
* files.
*/
@Named( IncludeExcludeFileSelector.ROLE_HINT )
public class IncludeExcludeFileSelector
implements FileSelector
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package org.codehaus.plexus.components.io.resources;

/*
* Copyright 2007 The Codehaus 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 javax.inject.Named;

import java.io.Closeable;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;

import org.codehaus.plexus.components.io.attributes.FileAttributes;
import org.codehaus.plexus.components.io.attributes.PlexusIoResourceAttributes;
import org.codehaus.plexus.components.io.attributes.SimpleResourceAttributes;
import org.codehaus.plexus.components.io.functions.PlexusIoResourceConsumer;
import org.codehaus.plexus.util.DirectoryScanner;
import org.codehaus.plexus.util.StringUtils;

/**
* Alias for {@link PlexusIoFileResourceCollection}
*/
@Named
public class DefaultPlexusIoFileResourceCollection
extends PlexusIoFileResourceCollection
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* limitations under the License.
*/

import javax.inject.Named;

import org.codehaus.plexus.components.io.attributes.FileAttributes;
import org.codehaus.plexus.components.io.attributes.PlexusIoResourceAttributes;
import org.codehaus.plexus.components.io.attributes.SimpleResourceAttributes;
Expand All @@ -39,6 +41,7 @@
* Implementation of {@link PlexusIoResourceCollection} for the set
* of files in a common directory.
*/
@Named( PlexusIoFileResourceCollection.ROLE_HINT )
public class PlexusIoFileResourceCollection
extends AbstractPlexusIoResourceCollectionWithAttributes
{
Expand Down
Loading