Skip to content

Commit 394c008

Browse files
# Removed finally as this was causing the unit test to fail when creating zip archive
1 parent 5f9ef4c commit 394c008

File tree

1 file changed

+7
-20
lines changed

1 file changed

+7
-20
lines changed

src/main/java/org/codehaus/plexus/archiver/xz/PlexusIoXZResourceCollection.java

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,41 +23,28 @@
2323
import org.codehaus.plexus.components.io.attributes.Java7FileAttributes;
2424
import org.codehaus.plexus.components.io.attributes.PlexusIoResourceAttributes;
2525
import org.codehaus.plexus.components.io.resources.PlexusIoCompressedFileResourceCollection;
26-
import org.codehaus.plexus.util.IOUtil;
2726

2827
/**
2928
*
3029
* @author lore
3130
*/
32-
public class PlexusIoXZResourceCollection extends PlexusIoCompressedFileResourceCollection
33-
{
31+
public class PlexusIoXZResourceCollection extends PlexusIoCompressedFileResourceCollection {
3432

3533
@Override
36-
protected PlexusIoResourceAttributes getAttributes( File file ) throws IOException
37-
{
34+
protected PlexusIoResourceAttributes getAttributes(File file) throws IOException {
3835
return new Java7FileAttributes(file, new HashMap<Integer, String>(), new HashMap<Integer, String>());
3936
}
4037

4138
@Override
42-
protected String getDefaultExtension()
43-
{
39+
protected String getDefaultExtension() {
4440
return ".xz";
4541
}
4642

4743
@Override
48-
protected InputStream getInputStream( File file ) throws IOException
49-
{
50-
FileInputStream fileIs = new FileInputStream( file );
51-
52-
try
53-
{
54-
final InputStream result = XZUnArchiver.getXZInputStream( fileIs );
44+
protected InputStream getInputStream(File file) throws IOException {
45+
FileInputStream fileIs = new FileInputStream(file);
46+
47+
return XZUnArchiver.getXZInputStream(fileIs);
5548

56-
return result;
57-
}
58-
finally
59-
{
60-
IOUtil.close(fileIs);
61-
}
6249
}
6350
}

0 commit comments

Comments
 (0)