Hello community, here is the log from the commit of package plexus-io for openSUSE:Factory checked in at 2019-11-26 16:55:48 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/plexus-io (Old) and /work/SRC/openSUSE:Factory/.plexus-io.new.26869 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "plexus-io" Tue Nov 26 16:55:48 2019 rev:2 rq:750522 version:3.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/plexus-io/plexus-io.changes 2019-03-26 22:32:42.213701713 +0100 +++ /work/SRC/openSUSE:Factory/.plexus-io.new.26869/plexus-io.changes 2019-11-26 16:56:28.772164929 +0100 @@ -1,0 +2,5 @@ +Sun Nov 24 12:01:11 UTC 2019 - Fridrich Strba <[email protected]> + +- Upgrade to version 3.2.0 + +------------------------------------------------------------------- Old: ---- plexus-io-3.0.0-build.xml plexus-io-3.0.0.tar.gz New: ---- plexus-io-3.2.0.tar.gz plexus-io-build.xml ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ plexus-io.spec ++++++ --- /var/tmp/diff_new_pack.wwh1WH/_old 2019-11-26 16:56:29.464164700 +0100 +++ /var/tmp/diff_new_pack.wwh1WH/_new 2019-11-26 16:56:29.468164699 +0100 @@ -1,7 +1,7 @@ # # spec file for package plexus-io # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,21 +18,21 @@ %bcond_with tests Name: plexus-io -Version: 3.0.0 +Version: 3.2.0 Release: 0 Summary: Plexus IO Components License: Apache-2.0 Group: Development/Libraries/Java URL: https://github.com/codehaus-plexus/%{name} Source0: https://github.com/codehaus-plexus/%{name}/archive/%{name}-%{version}.tar.gz -Source1: %{name}-%{version}-build.xml +Source1: %{name}-build.xml Source2: http://www.apache.org/licenses/LICENSE-2.0.txt BuildRequires: ant BuildRequires: apache-commons-io BuildRequires: fdupes BuildRequires: javapackages-local BuildRequires: jsr-305 -BuildRequires: plexus-utils +BuildRequires: plexus-utils >= 3.3.0 Requires: mvn(commons-io:commons-io) Requires: mvn(org.codehaus.plexus:plexus-utils) BuildArch: noarch ++++++ plexus-io-3.0.0.tar.gz -> plexus-io-3.2.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-io-plexus-io-3.0.0/.travis.yml new/plexus-io-plexus-io-3.2.0/.travis.yml --- old/plexus-io-plexus-io-3.0.0/.travis.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/plexus-io-plexus-io-3.2.0/.travis.yml 2019-10-12 17:27:48.000000000 +0200 @@ -0,0 +1,23 @@ +language: java +jdk: + - openjdk7 + - oraclejdk8 + +dist: trusty + +# No need for preliminary install step. +install: true +# +# Run all integration tests. +script: + - "mvn --show-version --errors --batch-mode clean verify" +# +cache: + directories: + - $HOME/.m2 +branches: + except: + - gh-pages +notifications: + email: + - [email protected] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-io-plexus-io-3.0.0/README.md new/plexus-io-plexus-io-3.2.0/README.md --- old/plexus-io-plexus-io-3.0.0/README.md 1970-01-01 01:00:00.000000000 +0100 +++ new/plexus-io-plexus-io-3.2.0/README.md 2019-10-12 17:27:48.000000000 +0200 @@ -0,0 +1,24 @@ +Plexus-IO +========= + +[](https://travis-ci.org/codehaus-plexus/plexus-io) +[](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.codehaus.plexus%22%20a%3A%plexus-io%22) + +The current master is now at https://github.com/codehaus-plexus/plexus-io + +For publishing [the site](https://codehaus-plexus.github.io/plexus-io/) do the following: + +``` +mvn -Preporting verify site-deploy +``` + +## Release Notes + +You can find details about the different releases in the +[Release Notes](https://github.com/codehaus-plexus/plexus-io/blob/master/ReleaseNotes.md). + + * [Release 3.2.0](https://github.com/codehaus-plexus/plexus-io/blob/master/ReleaseNotes.md#plexus-io-320). + * [Release 3.1.1](https://github.com/codehaus-plexus/plexus-io/blob/master/ReleaseNotes.md#plexus-io-311). + * [Release 3.1.0](https://github.com/codehaus-plexus/plexus-io/blob/master/ReleaseNotes.md#plexus-io-310). + * [Release 3.0.1](https://github.com/codehaus-plexus/plexus-io/blob/master/ReleaseNotes.md#plexus-io-301). + * [Release 3.0.0](https://github.com/codehaus-plexus/plexus-io/blob/master/ReleaseNotes.md#plexus-io-300). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-io-plexus-io-3.0.0/ReleaseNotes.md new/plexus-io-plexus-io-3.2.0/ReleaseNotes.md --- old/plexus-io-plexus-io-3.0.0/ReleaseNotes.md 1970-01-01 01:00:00.000000000 +0100 +++ new/plexus-io-plexus-io-3.2.0/ReleaseNotes.md 2019-10-12 17:27:48.000000000 +0200 @@ -0,0 +1,243 @@ +Plexus-IO Release Notes +======================================================================== + +Plexus IO 3.2.0 +--------------- + +Plexus IO 3.2.0 requires Java 7. + +### New Features + + * [Issue #18][issue-18] - Add an option to sort the entries of PlexusIoFileResourceCollection + +Plexus IO 3.1.1 +--------------- + +Plexus IO 3.1.1 requires Java 7. + +### Improvements + + * [Issue #16][issue-16], [Pull Request #17][pr-17] - Improve performance + on systems which have high time penalty when fetching owner and group name. + Thanks to Classe. + +Plexus IO 3.1.0 +--------------- + +Plexus IO 3.1.0 requires Java 7. + +### New Features + + * [Pull Request #14][pr-14] - Add new FileMapper for giving a suffix to filename: + `SuffixFileMapper`. Thanks to Thomas Collignon. + +Plexus IO 3.0.1 +--------------- + +Plexus IO 3.0.1 requires Java 7. + +### Tasks + + * [Issue #9][issue-9], [Issue #10][issue-10] - Updated dependencies: + `plexus-utils` to 3.1.0 and `commons-io` to 2.6 + +Plexus IO 3.0.0 +--------------- + +Plexus IO 3.0.0 requires Java 7 and introduces backward incompatible changes: + + * `Java7FileAttributes` is renamed to `FileAttributes`, replacing + the old `FileAttributes` implementation + * `Java7AttributeUtils` is renamed to `AttributeUtils` + * `PlexusIoResourceAttributeUtils#getFileAttributesByPath( File, boolean, boolean )` + is deleted + +### Improvements + + * [Pull Request #5][pr-5] - The required Java version is upgraded to 7. + Classes that use native tools like `ls` are removed and the pure Java + implementations are used instead. + +### Tasks + + * [Issue #8][issue-8] - Update of `plexus-utils` to 3.0.24 and + `commons-io` to 2.5 + +Plexus IO 2.7.1 +--------------- + +### Improvements + + * [Pull Request #3][pr-3] - Introduce new constant to indicate uknown + octal mode for resources - `PlexusIoResourceAttributes.UNKNOWN_OCTAL_MODE` + +### Bugs + + * [Issue #2][issue-2] - JAR entry not found when JAR is updated inline and + cached by URLConnection + +Plexus IO 2.7 +--------------- + +### Improvements + + * Added TIME_STYLE=long-iso to ls screen scrape + * [Pull Request #1][pr-1] - Add concurrent access flag + to the PlexusIoProxyResourceCollection - + `PlexusIoResourceCollection#isConcurrentAccessSupported()` + +Plexus IO 2.6.1 +--------------- + +### Improvement + + * Performance improvement affecting mac/linux users + with lots of small files in large archives. + +Plexus IO 2.5 +------------- + + * Proper support for closeable on zip archives. + * Removed zip supporting PlexusIoZipFileResourceCollection; which now exists in plexus-archiver. (Drop in replacement, + just change/add jar file). + +Plexus IO 2.4.1 +--------------- + +### Bugs + + * PLXCOMP-279 - PlexusIoProxyResourceCollection does not provide Closeable iterator + * Fixed PLXCOMP-280 - SimpleResourceAttributes has incorrect value for + default file mode + +Plexus IO 2.4 +------------- + +### Improvements + + * PLXCOMP-274 - Simplify use of proxies + * PLXCOMP-275 - Avoid leaky abstractions + * PLXCOMP-276 - Reduce number of ways to create a PlexusIoResource + +Plexus IO 2.3.5 +--------------- + +### Bugs + + * PLXCOMP-278 - Symlink attribute was not preserved through merged/overridden attributes + +Plexus IO 2.3.4 +--------------- + +### Bugs + + * PLXCOMP-270 - Escaping algoritghm leaks through to system classloader + * PLXCOMP-272 - Overriding dirmode/filemode breaks symlinks + +Plexus IO 2.3.3 +--------------- + +### Bugs + + * PLXCOMP-267 - StreamTransformers are consistently applied to all collections + +Plexus IO 2.3.2 +--------------- + +### Bugs + + * PLXCOMP-265 - Locale in shell influences "ls" parsing for screenscraper + +Plexus IO 2.3.1 +--------------- + +### Bugs + + * PLXCOMP-264 - Thread safety issue in streamconsumer + +Plexus IO 2.3 +------------- + +### New Features + + * PLXCOMP-261 - Make plexus io collections support on-the-fly filtering + +### Improvements + + * PLXCOMP-260 - Make plexus io collections iterable + +Plexus IO 2.2 +------------- + +### Bugs + + * PLXCOMP-251 - Date parsing in "ls" screenscraping has locale dependencies + * PLXCOMP-254 - Fix File.separatorChar normalization when prefixes are used + +Plexus IO 2.1.4 +--------------- + +### Improvements + + * PLXCOMP-250 - Upgrade maven-enforcer-plugin to 1.3.1 + +### Bugs + + * PLXCOMP-107 - Fail to unzip archive, which contains file with name + 'How_can_I_annotate_a_part_in_the_AAM%3F.Help' + +Plexus IO 2.1.3 +--------------- + +### Bugs + + * PLXCOMP-247 - Bug with windows AND java5 + +Plexus IO 2.1.2 +--------------- + +### Bugs + + * PLXCOMP-244 - Don't try to set attributes of symbolic links + * PLXCOMP-245 - Archives created on windows get zero permissions, + creates malformed permissions on linux + +Plexus IO 2.1.1 +--------------- + +### Bugs + + * PLXCOMP-243 - Restore JDK1.5 compatibility + +Plexus IO 2.1 +------------- + +### Improvements + + * PLXCOMP-64 - add symlink support to tar unarchiver + * PLXCOMP-117 - add symbolic links managment + +### Bugs + + * PLXCOMP-113 - zip unarchiver doesn't support symlinks (and trivial to fix) + * PLXCOMP-241 - ResourcesTest.compare test failure + * PLXCOMP-248 - Use java7 setAttributes and ignore useJvmChmod flag when applicable + +Plexus IO 2.0.12 +---------------- + +### Bugs + + * PLXCOMP-249 - Add support for java7 chmod + +[issue-2]: https://github.com/codehaus-plexus/plexus-io/issues/2 +[issue-8]: https://github.com/codehaus-plexus/plexus-io/issues/8 +[issue-9]: https://github.com/codehaus-plexus/plexus-io/issues/9 +[issue-10]: https://github.com/codehaus-plexus/plexus-io/issues/10 +[issue-16]: https://github.com/codehaus-plexus/plexus-io/issues/16 +[issue-18]: https://github.com/codehaus-plexus/plexus-io/issues/18 +[pr-1]: https://github.com/codehaus-plexus/plexus-io/pull/1 +[pr-3]: https://github.com/codehaus-plexus/plexus-io/pull/3 +[pr-5]: https://github.com/codehaus-plexus/plexus-io/pull/5 +[pr-14]: https://github.com/codehaus-plexus/plexus-io/pull/14 +[pr-17]: https://github.com/codehaus-plexus/plexus-io/pull/17 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-io-plexus-io-3.0.0/pom.xml new/plexus-io-plexus-io-3.2.0/pom.xml --- old/plexus-io-plexus-io-3.0.0/pom.xml 2017-05-22 22:24:10.000000000 +0200 +++ new/plexus-io-plexus-io-3.2.0/pom.xml 2019-10-12 17:27:48.000000000 +0200 @@ -2,13 +2,13 @@ <modelVersion>4.0.0</modelVersion> <parent> - <artifactId>plexus</artifactId> <groupId>org.codehaus.plexus</groupId> - <version>5.0</version> + <artifactId>plexus</artifactId> + <version>5.1</version> </parent> <artifactId>plexus-io</artifactId> - <version>3.0.0</version> + <version>3.2.0</version> <name>Plexus IO Components</name> @@ -16,7 +16,7 @@ <connection>scm:git:[email protected]:codehaus-plexus/plexus-io.git</connection> <developerConnection>scm:git:[email protected]:codehaus-plexus/plexus-io.git</developerConnection> <url>http://github.com/codehaus-plexus/plexus-io</url> - <tag>plexus-io-3.0.0</tag> + <tag>plexus-io-3.2.0</tag> </scm> <issueManagement> <system>jira</system> @@ -38,7 +38,7 @@ <dependency> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-utils</artifactId> - <version>3.0.24</version> + <version>3.3.0</version> </dependency> <dependency> <groupId>org.codehaus.plexus</groupId> @@ -55,7 +55,7 @@ <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> - <version>2.5</version> + <version>2.6</version> </dependency> <dependency> <groupId>junit</groupId> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-io-plexus-io-3.0.0/src/main/java/org/codehaus/plexus/components/io/attributes/AttributeUtils.java new/plexus-io-plexus-io-3.2.0/src/main/java/org/codehaus/plexus/components/io/attributes/AttributeUtils.java --- old/plexus-io-plexus-io-3.0.0/src/main/java/org/codehaus/plexus/components/io/attributes/AttributeUtils.java 2017-05-22 22:24:10.000000000 +0200 +++ new/plexus-io-plexus-io-3.2.0/src/main/java/org/codehaus/plexus/components/io/attributes/AttributeUtils.java 2019-10-12 17:27:48.000000000 +0200 @@ -134,7 +134,7 @@ } catch ( UnsupportedOperationException ignore ) { - // Maybe ignoring is dramatic. Maybe not. But we do get the basic attrs anyqway + // Maybe ignoring is dramatic. Maybe not. But we do get the basic attrs anyway } } return Files.readAttributes( path, BasicFileAttributes.class, LinkOption.NOFOLLOW_LINKS ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-io-plexus-io-3.0.0/src/main/java/org/codehaus/plexus/components/io/attributes/FileAttributes.java new/plexus-io-plexus-io-3.2.0/src/main/java/org/codehaus/plexus/components/io/attributes/FileAttributes.java --- old/plexus-io-plexus-io-3.0.0/src/main/java/org/codehaus/plexus/components/io/attributes/FileAttributes.java 2017-05-22 22:24:10.000000000 +0200 +++ new/plexus-io-plexus-io-3.2.0/src/main/java/org/codehaus/plexus/components/io/attributes/FileAttributes.java 2019-10-12 17:27:48.000000000 +0200 @@ -64,7 +64,7 @@ Path path = file.toPath(); if ( AttributeUtils.isUnix( path ) ) { - Map<String, Object> attrs = Files.readAttributes( path, "unix:*", LinkOption.NOFOLLOW_LINKS ); + Map<String, Object> attrs = Files.readAttributes( path, "unix:permissions,gid,uid,isSymbolicLink,mode", LinkOption.NOFOLLOW_LINKS ); this.permissions = (Set<PosixFilePermission>) attrs.get( "permissions" ); groupId = (Integer) attrs.get( "gid" ); @@ -76,7 +76,8 @@ } else { - this.groupName = ( (Principal) attrs.get( "group" ) ).getName(); + Object group = Files.getAttribute( path, "unix:group", LinkOption.NOFOLLOW_LINKS ); + this.groupName = ( (Principal) group ).getName(); groupCache.put( groupId, this.groupName ); } userId = (Integer) attrs.get( "uid" ); @@ -87,7 +88,8 @@ } else { - this.userName = ( (Principal) attrs.get( "owner" ) ).getName(); + Object owner = Files.getAttribute( path, "unix:owner", LinkOption.NOFOLLOW_LINKS ); + this.userName = ( (Principal) owner ).getName(); userCache.put( userId, this.userName ); } octalMode = (Integer) attrs.get( "mode" ) & 0xfff; // Mask off top bits for compatibilty. Maybe check if we diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-io-plexus-io-3.0.0/src/main/java/org/codehaus/plexus/components/io/attributes/PlexusIoResourceAttributes.java new/plexus-io-plexus-io-3.2.0/src/main/java/org/codehaus/plexus/components/io/attributes/PlexusIoResourceAttributes.java --- old/plexus-io-plexus-io-3.0.0/src/main/java/org/codehaus/plexus/components/io/attributes/PlexusIoResourceAttributes.java 2017-05-22 22:24:10.000000000 +0200 +++ new/plexus-io-plexus-io-3.2.0/src/main/java/org/codehaus/plexus/components/io/attributes/PlexusIoResourceAttributes.java 2019-10-12 17:27:48.000000000 +0200 @@ -78,7 +78,7 @@ //String getOctalModeString(); /** - * Indicates if this is a symnbolic link element. + * Indicates if this is a symbolic link element. * For file-based resource attributes this value may be always "false" for versions prior to java7. * @return True if the file is a symlink or false if not. */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-io-plexus-io-3.0.0/src/main/java/org/codehaus/plexus/components/io/filemappers/RegExpFileMapper.java new/plexus-io-plexus-io-3.2.0/src/main/java/org/codehaus/plexus/components/io/filemappers/RegExpFileMapper.java --- old/plexus-io-plexus-io-3.0.0/src/main/java/org/codehaus/plexus/components/io/filemappers/RegExpFileMapper.java 2017-05-22 22:24:10.000000000 +0200 +++ new/plexus-io-plexus-io-3.2.0/src/main/java/org/codehaus/plexus/components/io/filemappers/RegExpFileMapper.java 2019-10-12 17:27:48.000000000 +0200 @@ -70,7 +70,7 @@ } /** - * Returns, whether to replace the first occurrency of the pattern + * Returns, whether to replace the first occurrence of the pattern * (default), or all. */ public boolean getReplaceAll() @@ -79,7 +79,7 @@ } /** - * Sets, whether to replace the first occurrency of the pattern + * Sets, whether to replace the first occurrence of the pattern * (default), or all. */ public void setReplaceAll( boolean pReplaceAll ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-io-plexus-io-3.0.0/src/main/java/org/codehaus/plexus/components/io/filemappers/SuffixFileMapper.java new/plexus-io-plexus-io-3.2.0/src/main/java/org/codehaus/plexus/components/io/filemappers/SuffixFileMapper.java --- old/plexus-io-plexus-io-3.0.0/src/main/java/org/codehaus/plexus/components/io/filemappers/SuffixFileMapper.java 1970-01-01 01:00:00.000000000 +0100 +++ new/plexus-io-plexus-io-3.2.0/src/main/java/org/codehaus/plexus/components/io/filemappers/SuffixFileMapper.java 2019-10-12 17:27:48.000000000 +0200 @@ -0,0 +1,72 @@ +package org.codehaus.plexus.components.io.filemappers; + +/* + * 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.annotation.Nonnull; + +/** + * 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} + */ +public class SuffixFileMapper extends AbstractFileMapper +{ + /** + * The suffix mappers role-hint: "suffix". + */ + public static final String ROLE_HINT = "suffix"; + + private String suffix; + + /** + * Returns the suffix to add. + */ + public String getSuffix() + { + return suffix; + } + + /** + * Sets the suffix to add. + */ + public void setSuffix( String suffix ) + { + if ( suffix == null ) + { + throw new IllegalArgumentException( "The suffix is null." ); + } + this.suffix = suffix; + } + + @Nonnull + public String getMappedFileName( @Nonnull String pName) + { + final String name = super.getMappedFileName( pName ); + if ( suffix == null ) + { + throw new IllegalStateException( "The suffix has not been set." ); + } + final int dirSep = Math.max( name.lastIndexOf( '/' ), name.lastIndexOf( '\\' ) ); + String filename = dirSep > 0 ? name.substring( dirSep + 1 ) : name; + String dirname = dirSep > 0 ? name.substring( 0, dirSep + 1 ) : ""; + if ( filename.contains( "." ) ) + { + String beforeExtension = filename.substring( 0, filename.indexOf( '.' ) ); + String afterExtension = filename.substring( filename.indexOf( '.' ) + 1 ) ; + return dirname + beforeExtension + suffix + "." + afterExtension; + } + return name + suffix; + } +} \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-io-plexus-io-3.0.0/src/main/java/org/codehaus/plexus/components/io/resources/AbstractPlexusIoArchiveResourceCollection.java new/plexus-io-plexus-io-3.2.0/src/main/java/org/codehaus/plexus/components/io/resources/AbstractPlexusIoArchiveResourceCollection.java --- old/plexus-io-plexus-io-3.0.0/src/main/java/org/codehaus/plexus/components/io/resources/AbstractPlexusIoArchiveResourceCollection.java 2017-05-22 22:24:10.000000000 +0200 +++ new/plexus-io-plexus-io-3.2.0/src/main/java/org/codehaus/plexus/components/io/resources/AbstractPlexusIoArchiveResourceCollection.java 2019-10-12 17:27:48.000000000 +0200 @@ -152,7 +152,8 @@ }; } - public long getLastModified() throws IOException + public long getLastModified() + throws IOException { File f = getFile(); return f == null ? PlexusIoResource.UNKNOWN_MODIFICATION_DATE : f.lastModified(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-io-plexus-io-3.0.0/src/main/java/org/codehaus/plexus/components/io/resources/PlexusIoArchivedResourceCollection.java new/plexus-io-plexus-io-3.2.0/src/main/java/org/codehaus/plexus/components/io/resources/PlexusIoArchivedResourceCollection.java --- old/plexus-io-plexus-io-3.0.0/src/main/java/org/codehaus/plexus/components/io/resources/PlexusIoArchivedResourceCollection.java 2017-05-22 22:24:10.000000000 +0200 +++ new/plexus-io-plexus-io-3.2.0/src/main/java/org/codehaus/plexus/components/io/resources/PlexusIoArchivedResourceCollection.java 2019-10-12 17:27:48.000000000 +0200 @@ -20,13 +20,13 @@ /** * Extension of {@link PlexusIoResourceCollection} for archive - * files: Zip, tar, gzip, bzip2, etc. files. + * files: zip, tar, gzip, bzip2, etc. files. */ public interface PlexusIoArchivedResourceCollection extends PlexusIoResourceCollection { /** - * Sets the arcihve file + * Sets the archive file */ void setFile( File file ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-io-plexus-io-3.0.0/src/main/java/org/codehaus/plexus/components/io/resources/PlexusIoFileResource.java new/plexus-io-plexus-io-3.2.0/src/main/java/org/codehaus/plexus/components/io/resources/PlexusIoFileResource.java --- old/plexus-io-plexus-io-3.0.0/src/main/java/org/codehaus/plexus/components/io/resources/PlexusIoFileResource.java 2017-05-22 22:24:10.000000000 +0200 +++ new/plexus-io-plexus-io-3.2.0/src/main/java/org/codehaus/plexus/components/io/resources/PlexusIoFileResource.java 2019-10-12 17:27:48.000000000 +0200 @@ -110,7 +110,7 @@ } /** - * Returns the resources file. + * Returns the resource file. */ @Nonnull public File getFile() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-io-plexus-io-3.0.0/src/main/java/org/codehaus/plexus/components/io/resources/PlexusIoFileResourceCollection.java new/plexus-io-plexus-io-3.2.0/src/main/java/org/codehaus/plexus/components/io/resources/PlexusIoFileResourceCollection.java --- old/plexus-io-plexus-io-3.0.0/src/main/java/org/codehaus/plexus/components/io/resources/PlexusIoFileResourceCollection.java 2017-05-22 22:24:10.000000000 +0200 +++ new/plexus-io-plexus-io-3.2.0/src/main/java/org/codehaus/plexus/components/io/resources/PlexusIoFileResourceCollection.java 2019-10-12 17:27:48.000000000 +0200 @@ -28,6 +28,7 @@ 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; @@ -50,6 +51,11 @@ private boolean isFollowingSymLinks = true; + /** + * @since 3.2.0 + */ + private Comparator<String> filenameComparator; + public PlexusIoFileResourceCollection() { } @@ -241,6 +247,7 @@ } ds.setCaseSensitive( isCaseSensitive() ); ds.setFollowSymlinks( isFollowingSymLinks() ); + ds.setFilenameComparator( filenameComparator ); ds.scan(); final List<PlexusIoResource> result = new ArrayList<>(); @@ -259,4 +266,12 @@ { return true; } + + /** + * @since 3.2.0 + */ + public void setFilenameComparator( Comparator<String> filenameComparator ) + { + this.filenameComparator = filenameComparator; + } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-io-plexus-io-3.0.0/src/main/java/org/codehaus/plexus/components/io/resources/PlexusIoResourceCollection.java new/plexus-io-plexus-io-3.2.0/src/main/java/org/codehaus/plexus/components/io/resources/PlexusIoResourceCollection.java --- old/plexus-io-plexus-io-3.0.0/src/main/java/org/codehaus/plexus/components/io/resources/PlexusIoResourceCollection.java 2017-05-22 22:24:10.000000000 +0200 +++ new/plexus-io-plexus-io-3.2.0/src/main/java/org/codehaus/plexus/components/io/resources/PlexusIoResourceCollection.java 2019-10-12 17:27:48.000000000 +0200 @@ -80,7 +80,7 @@ InputStream getInputStream( PlexusIoResource resource ) throws IOException; /** - * Resolves the supplide resource into a "real" resource. Resolving + * Resolves the supplied resource into a "real" resource. Resolving * means applying input transformations * Returns an input stream for the provided resource, with stream transformers applied * @param resource The resources diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-io-plexus-io-3.0.0/src/main/resources/META-INF/plexus/components.xml new/plexus-io-plexus-io-3.2.0/src/main/resources/META-INF/plexus/components.xml --- old/plexus-io-plexus-io-3.0.0/src/main/resources/META-INF/plexus/components.xml 2017-05-22 22:24:10.000000000 +0200 +++ new/plexus-io-plexus-io-3.2.0/src/main/resources/META-INF/plexus/components.xml 2019-10-12 17:27:48.000000000 +0200 @@ -44,6 +44,13 @@ </component> <component> <role>org.codehaus.plexus.components.io.filemappers.FileMapper</role> + <role-hint>suffix</role-hint> + <implementation>org.codehaus.plexus.components.io.filemappers.SuffixFileMapper</implementation> + <instantiation-strategy>per-lookup</instantiation-strategy> + <configuration/> + </component> + <component> + <role>org.codehaus.plexus.components.io.filemappers.FileMapper</role> <role-hint>regexp</role-hint> <implementation>org.codehaus.plexus.components.io.filemappers.RegExpFileMapper</implementation> <instantiation-strategy>per-lookup</instantiation-strategy> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-io-plexus-io-3.0.0/src/site/apt/filemappers.apt new/plexus-io-plexus-io-3.2.0/src/site/apt/filemappers.apt --- old/plexus-io-plexus-io-3.0.0/src/site/apt/filemappers.apt 2017-05-22 22:24:10.000000000 +0200 +++ new/plexus-io-plexus-io-3.2.0/src/site/apt/filemappers.apt 2019-10-12 17:27:48.000000000 +0200 @@ -7,14 +7,14 @@ A file mapper is a plexus component, which allows to convert file names. File mappers are used when creating files. For example, - the {{{http://mojo.codehaus.org/xml-maven-plugin}XML Maven Plugin}} + the {{{https://www.mojohaus.org/xml-maven-plugin}XML Maven Plugin}} allows to specify a file mapper when creating files by XSLT transformation. File mappers are implementing the interface {{{./apidocs/org/codehaus/plexus/components/io/filemappers/FileMapper.html}FileMapper}}. The idea of file mappers is borrowed from the - {{{http://ant.apache.org/manual/CoreTypes/mapper.html}Ant FileMapper}}, + {{{https://ant.apache.org/manual/Types/mapper.html}Ant FileMapper}}, which serves the same purpose within Ant. Available file mappers are @@ -31,6 +31,9 @@ * The {{{#Merging File Mapper}Merging File Mapper}}; its role hint is "merge". + * The {{{#Suffix File Mapper}Suffix File Mapper}}; its role hint is + "suffix". + * {Identity Mapper} The {{{./apidocs/org/codehaus/plexus/components/io/filemappers/IdentityMapper.html}identity mapper}} @@ -94,3 +97,26 @@ ----------------------------------------------------------------------------- The merging file mapper uses the role hint "merge". + +* {Suffix File Mapper} + + The {{{./apidocs/org/codehaus/plexus/components/io/filemappers/SuffixFileMapper.html}suffix + file mapper}} adds the given suffix to the filename. The suffix will be added before the file + extension. Examples : + +----------------------------------------------------------------------------- + theFile.txt => theFileNiceSuffix.txt + dir/file.java => dir/fileNiceSuffix.java + fileWithoutExtension => fileWithoutExtensionNiceSuffix + dir/archive.tar.gz => dir/archiveNiceSuffix.tar.gz +----------------------------------------------------------------------------- + + It would be configured as follows: + +----------------------------------------------------------------------------- + <fileMapper implementation="org.codehaus.plexus.components.io.filemappers.SuffixFileMapper"> + <suffix>NiceSuffix</suffix> + </fileMapper> +----------------------------------------------------------------------------- + + The suffix file mapper uses the role hint "suffix". diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-io-plexus-io-3.0.0/src/test/java/org/codehaus/plexus/components/io/filemappers/FileMapperTest.java new/plexus-io-plexus-io-3.2.0/src/test/java/org/codehaus/plexus/components/io/filemappers/FileMapperTest.java --- old/plexus-io-plexus-io-3.0.0/src/test/java/org/codehaus/plexus/components/io/filemappers/FileMapperTest.java 2017-05-22 22:24:10.000000000 +0200 +++ new/plexus-io-plexus-io-3.2.0/src/test/java/org/codehaus/plexus/components/io/filemappers/FileMapperTest.java 2019-10-12 17:27:48.000000000 +0200 @@ -17,6 +17,7 @@ */ import java.lang.reflect.UndeclaredThrowableException; +import java.util.Arrays; import org.codehaus.plexus.PlexusTestCase; @@ -165,6 +166,23 @@ testFileMapper( mapper, SAMPLES, results ); } + public void testSuffixMapper() throws Exception + { + final String suffix = "suffix"; + String[] samples = Arrays.copyOf( SAMPLES, SAMPLES.length + 2 ); + samples[samples.length - 2] = "archive.tar.gz"; + samples[samples.length - 1] = "directory/archive.tar.gz"; + String[] results = new String[] { null, null, "asuffix", "xyzsuffix.gif", "b/asuffix", "b/xyzsuffix.gif", + "b\\asuffix", "b\\xyzsuffix.gif", "c.c/asuffix", "c.c/xyzsuffix.gif", "c.c\\asuffix", "c.c\\xyzsuffix.gif", + "archivesuffix.tar.gz", "directory/archivesuffix.tar.gz" }; + SuffixFileMapper mapper = new SuffixFileMapper(); + mapper.setSuffix( suffix ); + testFileMapper( mapper, samples, results ); + mapper = (SuffixFileMapper) lookup( FileMapper.ROLE, SuffixFileMapper.ROLE_HINT ); + mapper.setSuffix( suffix ); + testFileMapper( mapper, samples, results ); + } + private RegExpFileMapper configure( RegExpFileMapper pMapper, String pPattern, String pReplacement ) { pMapper.setPattern( pPattern ); ++++++ plexus-io-build.xml ++++++ <?xml version="1.0" encoding="UTF-8"?> <project name="plexus-io" default="package" basedir="."> <!-- ====================================================================== --> <!-- Build environment properties --> <!-- ====================================================================== --> <property file="build.properties"/> <property name="project.artifactId" value="plexus-io"/> <property name="project.groupId" value="org.codehaus.plexus"/> <property name="project.version" value="3.2.0"/> <property name="compiler.source" value="1.7"/> <property name="compiler.target" value="${compiler.source}"/> <property name="build.finalName" value="${project.artifactId}-${project.version}"/> <property name="build.dir" value="target"/> <property name="build.outputDir" value="${build.dir}/classes"/> <property name="build.srcDir" value="src/main/java"/> <property name="build.resourceDir" value="src/main/resources"/> <property name="build.testOutputDir" value="${build.dir}/test-classes"/> <property name="build.testDir" value="src/test/java"/> <property name="build.testResourceDir" value="src/test/resources"/> <property name="test.reports" value="${build.dir}/test-reports"/> <property name="reporting.outputDirectory" value="${build.dir}/site"/> <!-- ====================================================================== --> <!-- Defining classpaths --> <!-- ====================================================================== --> <path id="build.classpath"> <fileset dir="lib"> <!-- plexus-utils-3.0.24 commons-io-2.5.jar --> <include name="**/*"/> </fileset> </path> <path id="build.test.classpath"> <fileset dir="lib"> <!-- plexus-utils-3.0.24 plexus-container-default-1.0-alpha-30 plexus-classworlds-1.2-alpha-9.jar jsr305-3.0.2.jar commons-io-2.5.jar --> <include name="**/*"/> </fileset> </path> <!-- ====================================================================== --> <!-- Cleaning up target --> <!-- ====================================================================== --> <target name="clean" description="Clean the output directory"> <delete dir="${build.dir}"/> </target> <!-- ====================================================================== --> <!-- Compilation target --> <!-- ====================================================================== --> <target name="compile" description="Compile the code"> <mkdir dir="${build.outputDir}"/> <javac destdir="${build.outputDir}" nowarn="false" debug="true" optimize="false" deprecation="true" target="${compiler.target}" verbose="false" fork="false" source="${compiler.source}"> <src> <pathelement location="${build.srcDir}"/> </src> <classpath refid="build.classpath"/> </javac> <copy todir="${build.outputDir}"> <fileset dir="${build.resourceDir}"/> </copy> </target> <!-- ====================================================================== --> <!-- Test-compilation target --> <!-- ====================================================================== --> <target name="compile-tests" depends="compile" description="Compile the test code" unless="test.skip"> <mkdir dir="${build.testOutputDir}"/> <javac destdir="${build.testOutputDir}" nowarn="false" debug="true" optimize="false" deprecation="true" target="${compiler.target}" verbose="false" fork="false" source="${compiler.source}"> <src> <pathelement location="${build.testDir}"/> </src> <classpath> <path refid="build.test.classpath"/> <pathelement location="${build.outputDir}"/> </classpath> </javac> <copy todir="${build.testOutputDir}"> <fileset dir="${build.testResourceDir}"/> </copy> </target> <!-- ====================================================================== --> <!-- Run all tests --> <!-- ====================================================================== --> <target name="test" depends="compile-tests, junit-missing" unless="junit.skipped" description="Run the test cases"> <mkdir dir="${test.reports}"/> <junit printSummary="yes" haltonerror="true" haltonfailure="true" fork="true" dir="."> <sysproperty key="basedir" value="."/> <formatter type="xml"/> <formatter type="plain" usefile="false"/> <classpath> <path refid="build.test.classpath"/> <pathelement location="${build.outputDir}"/> <pathelement location="${build.testOutputDir}"/> </classpath> <batchtest todir="${test.reports}" unless="test"> <fileset dir="${build.testDir}"> <include name="**/Test*.java"/> <include name="**/*Test.java"/> <include name="**/*TestCase.java"/> <exclude name="**/*Abstract*Test.java"/> </fileset> </batchtest> <batchtest todir="${test.reports}" if="test"> <fileset dir="${build.testDir}"> <include name="**/${test}.java"/> <exclude name="**/*Abstract*Test.java"/> </fileset> </batchtest> </junit> </target> <target name="test-junit-present"> <available classname="junit.framework.Test" property="junit.present" classpathref="build.test.classpath"/> </target> <target name="test-junit-status" depends="test-junit-present"> <condition property="junit.missing"> <and> <isfalse value="${junit.present}"/> <isfalse value="${test.skip}"/> </and> </condition> <condition property="junit.skipped"> <or> <isfalse value="${junit.present}"/> <istrue value="${test.skip}"/> </or> </condition> </target> <target name="junit-missing" depends="test-junit-status" if="junit.missing"> <echo>=================================== WARNING ===================================</echo> <echo> JUnit is not present in the test classpath or your $ANT_HOME/lib directory. Tests not executed.</echo> <echo>===============================================================================</echo> </target> <!-- ====================================================================== --> <!-- Javadoc target --> <!-- ====================================================================== --> <target name="javadoc" description="Generates the Javadoc of the application"> <javadoc sourcepath="${build.srcDir}" packagenames="*" destdir="${reporting.outputDirectory}/apidocs" access="protected" source="${compiler.source}" verbose="false" version="true" use="true" author="true" splitindex="false" nodeprecated="false" nodeprecatedlist="false" notree="false" noindex="false" nohelp="false" nonavbar="false" serialwarn="false" charset="ISO-8859-1" linksource="false" breakiterator="false"> <classpath refid="build.classpath"/> </javadoc> </target> <!-- ====================================================================== --> <!-- Package target --> <!-- ====================================================================== --> <target name="package" depends="compile,test" description="Package the application"> <jar jarfile="${build.dir}/${build.finalName}.jar" compress="true" index="false" basedir="${build.outputDir}" excludes="**/package.html"> <manifest> <attribute name="JavaPackages-ArtifactId" value="${project.artifactId}"/> <attribute name="JavaPackages-GroupId" value="${project.groupId}"/> <attribute name="JavaPackages-Version" value="${project.version}"/> </manifest> </jar> </target> <!-- ====================================================================== --> <!-- A dummy target for the package named after the type it creates --> <!-- ====================================================================== --> <target name="jar" depends="package" description="Builds the jar for the application"/> </project>
