Update to latest 3.0.1 upstream snapshot
This commit is contained in:
parent
5617503a27
commit
57d8144fe5
1
.gitignore
vendored
1
.gitignore
vendored
@ -19,3 +19,4 @@ sonatype-plexus-archiver-plexus-archiver-2.1.1-0-ge64d181.tar.gz
|
||||
/plexus-archiver-2.8.tar.gz
|
||||
/plexus-archiver-2.8.2.tar.gz
|
||||
/plexus-archiver-3.0.tar.gz
|
||||
/plexus-archiver-dc873a4.tar.gz
|
||||
|
@ -1,212 +0,0 @@
|
||||
From 3765880e1128d16f9e9f82bfc2892b5303fc1db2 Mon Sep 17 00:00:00 2001
|
||||
From: Kristian Rosenvold <krosenvold@apache.org>
|
||||
Date: Thu, 16 Apr 2015 21:45:12 +0200
|
||||
Subject: [PATCH] Added overload with encoding
|
||||
|
||||
---
|
||||
.../codehaus/plexus/archiver/AbstractArchiver.java | 17 +++++++++++++++--
|
||||
.../java/org/codehaus/plexus/archiver/Archiver.java | 20 ++++++++++++++++++++
|
||||
.../plexus/archiver/diags/DelgatingArchiver.java | 7 +++++++
|
||||
.../plexus/archiver/diags/DryRunArchiver.java | 8 ++++++++
|
||||
.../codehaus/plexus/archiver/diags/NoOpArchiver.java | 7 +++++++
|
||||
.../plexus/archiver/diags/TrackingArchiver.java | 7 +++++++
|
||||
6 files changed, 64 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/org/codehaus/plexus/archiver/AbstractArchiver.java b/src/main/java/org/codehaus/plexus/archiver/AbstractArchiver.java
|
||||
index d25b95e..a67ba90 100755
|
||||
--- a/src/main/java/org/codehaus/plexus/archiver/AbstractArchiver.java
|
||||
+++ b/src/main/java/org/codehaus/plexus/archiver/AbstractArchiver.java
|
||||
@@ -23,6 +23,7 @@
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.UndeclaredThrowableException;
|
||||
+import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
@@ -44,6 +45,7 @@
|
||||
import org.codehaus.plexus.components.io.attributes.PlexusIoResourceAttributes;
|
||||
import org.codehaus.plexus.components.io.functions.ResourceAttributeSupplier;
|
||||
import org.codehaus.plexus.components.io.resources.AbstractPlexusIoResourceCollection;
|
||||
+import org.codehaus.plexus.components.io.resources.EncodingSupported;
|
||||
import org.codehaus.plexus.components.io.resources.PlexusIoArchivedResourceCollection;
|
||||
import org.codehaus.plexus.components.io.resources.PlexusIoFileResourceCollection;
|
||||
import org.codehaus.plexus.components.io.resources.PlexusIoResource;
|
||||
@@ -661,7 +663,7 @@ public Map getDirs()
|
||||
}
|
||||
}
|
||||
|
||||
- protected PlexusIoResourceCollection asResourceCollection( final ArchivedFileSet fileSet )
|
||||
+ protected PlexusIoResourceCollection asResourceCollection( final ArchivedFileSet fileSet, Charset charset )
|
||||
throws ArchiverException
|
||||
{
|
||||
final File archiveFile = fileSet.getArchive();
|
||||
@@ -677,6 +679,10 @@ protected PlexusIoResourceCollection asResourceCollection( final ArchivedFileSet
|
||||
"Error adding archived file-set. PlexusIoResourceCollection not found for: " + archiveFile, e );
|
||||
}
|
||||
|
||||
+ if (resources instanceof EncodingSupported ) {
|
||||
+ ((EncodingSupported)resources).setEncoding( charset );
|
||||
+
|
||||
+ }
|
||||
if ( resources instanceof PlexusIoArchivedResourceCollection )
|
||||
{
|
||||
( (PlexusIoArchivedResourceCollection) resources ).setFile( fileSet.getArchive() );
|
||||
@@ -731,7 +737,14 @@ private void doAddResource(Object item){
|
||||
public void addArchivedFileSet( final ArchivedFileSet fileSet )
|
||||
throws ArchiverException
|
||||
{
|
||||
- final PlexusIoResourceCollection resourceCollection = asResourceCollection( fileSet );
|
||||
+ final PlexusIoResourceCollection resourceCollection = asResourceCollection( fileSet, null );
|
||||
+ addResources( resourceCollection );
|
||||
+ }
|
||||
+
|
||||
+ public void addArchivedFileSet( final ArchivedFileSet fileSet, Charset charset )
|
||||
+ throws ArchiverException
|
||||
+ {
|
||||
+ final PlexusIoResourceCollection resourceCollection = asResourceCollection( fileSet, charset );
|
||||
addResources( resourceCollection );
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/codehaus/plexus/archiver/Archiver.java b/src/main/java/org/codehaus/plexus/archiver/Archiver.java
|
||||
index 35cc201..aac9d87 100644
|
||||
--- a/src/main/java/org/codehaus/plexus/archiver/Archiver.java
|
||||
+++ b/src/main/java/org/codehaus/plexus/archiver/Archiver.java
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
+import java.nio.charset.Charset;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@@ -177,6 +178,25 @@ void addArchivedFileSet( @Nonnull File archiveFile, String prefix, String[] incl
|
||||
void addArchivedFileSet( ArchivedFileSet fileSet )
|
||||
throws ArchiverException;
|
||||
|
||||
+
|
||||
+ /**
|
||||
+ * Adds the given archive file set to the archive. This method is basically obsoleting
|
||||
+ * {@link #addArchivedFileSet(File)}, {@link #addArchivedFileSet(File, String[], String[])}, and
|
||||
+ * {@link #addArchivedFileSet(File, String, String[], String[])}. However, as these methods are in widespread use,
|
||||
+ * they cannot easily be made deprecated.
|
||||
+ *
|
||||
+ * @param charset the encoding to use, particularly useful to specific non-standard filename encodings
|
||||
+ * for some kinds of archives (for instance zip files)
|
||||
+ *
|
||||
+ * Stream transformers are supported on this method
|
||||
+ *
|
||||
+ * @param fileSet the fileSet to add
|
||||
+ * @param charset
|
||||
+ * @since 1.0-alpha-9
|
||||
+ */
|
||||
+ void addArchivedFileSet( ArchivedFileSet fileSet, Charset charset )
|
||||
+ throws ArchiverException;
|
||||
+
|
||||
/**
|
||||
* Adds the given resource collection to the archive.
|
||||
*
|
||||
diff --git a/src/main/java/org/codehaus/plexus/archiver/diags/DelgatingArchiver.java b/src/main/java/org/codehaus/plexus/archiver/diags/DelgatingArchiver.java
|
||||
index 81a18ad..186ba08 100644
|
||||
--- a/src/main/java/org/codehaus/plexus/archiver/diags/DelgatingArchiver.java
|
||||
+++ b/src/main/java/org/codehaus/plexus/archiver/diags/DelgatingArchiver.java
|
||||
@@ -28,6 +28,7 @@
|
||||
import javax.annotation.Nonnull;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
+import java.nio.charset.Charset;
|
||||
import java.util.Map;
|
||||
|
||||
@SuppressWarnings( { "UnusedDeclaration", "deprecation" } )
|
||||
@@ -134,6 +135,12 @@ public void addArchivedFileSet( ArchivedFileSet fileSet )
|
||||
target.addArchivedFileSet( fileSet );
|
||||
}
|
||||
|
||||
+ public void addArchivedFileSet( ArchivedFileSet fileSet, Charset charset )
|
||||
+ throws ArchiverException
|
||||
+ {
|
||||
+ target.addArchivedFileSet( fileSet, charset );
|
||||
+ }
|
||||
+
|
||||
public void addResource( PlexusIoResource resource, String destFileName, int permissions )
|
||||
throws ArchiverException
|
||||
{
|
||||
diff --git a/src/main/java/org/codehaus/plexus/archiver/diags/DryRunArchiver.java b/src/main/java/org/codehaus/plexus/archiver/diags/DryRunArchiver.java
|
||||
index d11d64a..6396731 100644
|
||||
--- a/src/main/java/org/codehaus/plexus/archiver/diags/DryRunArchiver.java
|
||||
+++ b/src/main/java/org/codehaus/plexus/archiver/diags/DryRunArchiver.java
|
||||
@@ -30,6 +30,7 @@
|
||||
import javax.annotation.Nonnull;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
+import java.nio.charset.Charset;
|
||||
|
||||
/**
|
||||
* A dry run archiver that does nothing. Some methods fall through to the underlying
|
||||
@@ -197,6 +198,13 @@ public void addArchivedFileSet( final ArchivedFileSet fileSet )
|
||||
debug( "DRY RUN: Skipping delegated call to: " + getMethodName() );
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public void addArchivedFileSet( ArchivedFileSet fileSet, Charset charset )
|
||||
+ throws ArchiverException
|
||||
+ {
|
||||
+ debug( "DRY RUN: Skipping delegated call to: " + getMethodName() );
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
diff --git a/src/main/java/org/codehaus/plexus/archiver/diags/NoOpArchiver.java b/src/main/java/org/codehaus/plexus/archiver/diags/NoOpArchiver.java
|
||||
index d277144..8dc5fd3 100644
|
||||
--- a/src/main/java/org/codehaus/plexus/archiver/diags/NoOpArchiver.java
|
||||
+++ b/src/main/java/org/codehaus/plexus/archiver/diags/NoOpArchiver.java
|
||||
@@ -28,6 +28,7 @@
|
||||
import javax.annotation.Nonnull;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
+import java.nio.charset.Charset;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -130,6 +131,12 @@ public void addArchivedFileSet( ArchivedFileSet fileSet )
|
||||
|
||||
}
|
||||
|
||||
+ public void addArchivedFileSet( ArchivedFileSet fileSet, Charset charset )
|
||||
+ throws ArchiverException
|
||||
+ {
|
||||
+
|
||||
+ }
|
||||
+
|
||||
public void addResource( PlexusIoResource resource, String destFileName, int permissions )
|
||||
throws ArchiverException
|
||||
{
|
||||
diff --git a/src/main/java/org/codehaus/plexus/archiver/diags/TrackingArchiver.java b/src/main/java/org/codehaus/plexus/archiver/diags/TrackingArchiver.java
|
||||
index 9c2149e..8e45d00 100644
|
||||
--- a/src/main/java/org/codehaus/plexus/archiver/diags/TrackingArchiver.java
|
||||
+++ b/src/main/java/org/codehaus/plexus/archiver/diags/TrackingArchiver.java
|
||||
@@ -27,6 +27,7 @@
|
||||
import javax.annotation.Nonnull;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
+import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -138,6 +139,12 @@ public void addArchivedFileSet( final ArchivedFileSet fileSet )
|
||||
added.add( new Addition( fileSet, null, null, null, -1 ) );
|
||||
}
|
||||
|
||||
+ public void addArchivedFileSet( final ArchivedFileSet fileSet, Charset charset )
|
||||
+ throws ArchiverException
|
||||
+ {
|
||||
+ added.add( new Addition( fileSet, null, null, null, -1 ) );
|
||||
+ }
|
||||
+
|
||||
public void addResource( final PlexusIoResource resource, final String destFileName, final int permissions )
|
||||
throws ArchiverException
|
||||
{
|
||||
--
|
||||
2.1.0
|
||||
|
@ -1,15 +1,16 @@
|
||||
%global commit dc873a4d3eb1ae1e55d661dff8ed85ec3d8eb936
|
||||
%global shortcommit %(c=%{commit}; echo ${c:0:7})
|
||||
|
||||
Name: plexus-archiver
|
||||
Version: 3.0
|
||||
Release: 4%{?dist}
|
||||
Version: 3.0.1
|
||||
Release: 0.1.git%{shortcommit}%{?dist}
|
||||
Epoch: 0
|
||||
Summary: Plexus Archiver Component
|
||||
License: ASL 2.0
|
||||
URL: https://github.com/codehaus-plexus/plexus-archiver
|
||||
BuildArch: noarch
|
||||
|
||||
Source0: https://github.com/sonatype/%{name}/archive/%{name}-%{version}.tar.gz
|
||||
|
||||
Patch0: 0001-Added-overload-with-encoding.patch
|
||||
Source0: https://github.com/codehaus-plexus/plexus-archiver/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
|
||||
|
||||
BuildRequires: maven-local
|
||||
BuildRequires: plexus-containers-container-default
|
||||
@ -35,8 +36,8 @@ Javadoc for %{name}.
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}-%{name}-%{version}
|
||||
%patch0 -p1
|
||||
%setup -q -n %{name}-%{commit}
|
||||
%pom_remove_plugin :maven-shade-plugin
|
||||
%mvn_file :%{name} plexus/archiver
|
||||
|
||||
%build
|
||||
@ -52,6 +53,9 @@ Javadoc for %{name}.
|
||||
%doc LICENSE
|
||||
|
||||
%changelog
|
||||
* Tue Jun 9 2015 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:3.0.1-0.1.gitdc873a4
|
||||
- Update to latest 3.0.1 upstream snapshot
|
||||
|
||||
* Tue Jun 9 2015 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:3.0-4
|
||||
- Backport overloaded Charset methods from 2.x
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user