Skip to content

Commit 82377e4

Browse files
committed
Moved zip collection here from p-io
1 parent e6d4588 commit 82377e4

File tree

4 files changed

+51
-23
lines changed

4 files changed

+51
-23
lines changed

src/main/java/org/codehaus/plexus/archiver/AbstractArchiver.java

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,6 @@
1717
* limitations under the License.
1818
*/
1919

20-
import java.io.Closeable;
21-
import java.io.File;
22-
import java.io.FileInputStream;
23-
import java.io.IOException;
24-
import java.io.InputStream;
25-
import java.lang.reflect.UndeclaredThrowableException;
26-
import java.nio.charset.Charset;
27-
import java.util.ArrayList;
28-
import java.util.HashMap;
29-
import java.util.HashSet;
30-
import java.util.Iterator;
31-
import java.util.List;
32-
import java.util.Map;
33-
import java.util.NoSuchElementException;
34-
import java.util.Set;
35-
36-
import javax.annotation.Nonnull;
37-
3820
import org.codehaus.plexus.PlexusConstants;
3921
import org.codehaus.plexus.PlexusContainer;
4022
import org.codehaus.plexus.archiver.manager.ArchiverManager;
@@ -60,6 +42,23 @@
6042
import org.codehaus.plexus.util.IOUtil;
6143
import org.codehaus.plexus.util.Os;
6244

45+
import javax.annotation.Nonnull;
46+
import java.io.Closeable;
47+
import java.io.File;
48+
import java.io.FileInputStream;
49+
import java.io.IOException;
50+
import java.io.InputStream;
51+
import java.lang.reflect.UndeclaredThrowableException;
52+
import java.nio.charset.Charset;
53+
import java.util.ArrayList;
54+
import java.util.HashMap;
55+
import java.util.HashSet;
56+
import java.util.Iterator;
57+
import java.util.List;
58+
import java.util.Map;
59+
import java.util.NoSuchElementException;
60+
import java.util.Set;
61+
6362
import static org.codehaus.plexus.archiver.util.DefaultArchivedFileSet.archivedFileSet;
6463
import static org.codehaus.plexus.archiver.util.DefaultFileSet.fileSet;
6564

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package org.codehaus.plexus.components.io.resources;
2+
3+
/*
4+
* Copyright 2007 The Codehaus Foundation.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
/**
20+
* Wrapper to retain compatibility with old-style plexus-io. Can be removed "some day".
21+
* Make sure maven-assembly-plugin IT's work when you do :)
22+
*/
23+
public class PlexusIoZipFileResourceCollection
24+
extends org.codehaus.plexus.archiver.zip.PlexusIoZipFileResourceCollection
25+
26+
{
27+
28+
}

src/main/resources/META-INF/plexus/components.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@
249249
<component>
250250
<role>org.codehaus.plexus.components.io.resources.PlexusIoResourceCollection</role>
251251
<role-hint>zip</role-hint>
252-
<implementation>org.codehaus.plexus.components.io.resources.PlexusIoZipFileResourceCollection</implementation>
252+
<implementation>org.codehaus.plexus.archiver.zip.PlexusIoZipFileResourceCollection</implementation>
253253
<instantiation-strategy>per-lookup</instantiation-strategy>
254254
</component>
255255
--><component>

src/test/java/org/codehaus/plexus/archiver/zip/PlexusIoZipFileResourceCollectionTest.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
import org.apache.commons.io.IOUtils;
44
import org.codehaus.plexus.PlexusTestCase;
5-
import org.codehaus.plexus.components.io.resources.PlexusIoResource;
6-
import org.codehaus.plexus.components.io.resources.PlexusIoURLResource;
5+
import org.codehaus.plexus.components.io.resources.*;
76

87
import java.io.BufferedReader;
98
import java.io.File;
@@ -47,7 +46,8 @@ public void testFilesWithIllegalHtmlChars()
4746
throws Exception
4847
{
4948
File testZip = new File( getBasedir(), "src/test/resources/bogusManifest.zip" );
50-
PlexusIoZipFileResourceCollection prc = new PlexusIoZipFileResourceCollection();
49+
PlexusIoZipFileResourceCollection
50+
prc = new PlexusIoZipFileResourceCollection();
5151
prc.setFile( testZip );
5252
final Iterator<PlexusIoResource> entries = prc.getEntries();
5353
while ( entries.hasNext() )
@@ -73,7 +73,8 @@ public void testFilesThatAreNotThere()
7373
seen.add( "Afile&lt;Yo&gt;.txt" );
7474
seen.add( "File With Space.txt" );
7575
seen.add( "FileWith%.txt" );
76-
PlexusIoZipFileResourceCollection prc = new PlexusIoZipFileResourceCollection();
76+
PlexusIoZipFileResourceCollection
77+
prc = new PlexusIoZipFileResourceCollection();
7778
prc.setFile( testZip );
7879
final Iterator<PlexusIoResource> entries = prc.getEntries();
7980
while ( entries.hasNext() )

0 commit comments

Comments
 (0)