Skip to content

Commit 202a014

Browse files
o Updated to add support for 'tar.xz' and 'tar.snappy' file extensions.
This closes #45
1 parent b9fe235 commit 202a014

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

Diff for: src/main/java/org/codehaus/plexus/archiver/manager/DefaultArchiverManager.java

+9-6
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,20 @@ public void contextualize( Context context )
100100
String path = file.getAbsolutePath();
101101

102102
String archiveExt = FileUtils.getExtension( path ).toLowerCase( Locale.ENGLISH );
103-
104-
if ( "gz".equals( archiveExt ) || "bz2".equals( archiveExt ) )
103+
104+
if ( "gz".equals( archiveExt )
105+
|| "bz2".equals( archiveExt )
106+
|| "xz".equals( archiveExt )
107+
|| "snappy".equals( archiveExt ) )
105108
{
106-
String [] tokens = StringUtils.split( path, "." );
107-
108-
if ( tokens.length > 2 && "tar".equals( tokens[tokens.length -2].toLowerCase( Locale.ENGLISH ) ) )
109+
String[] tokens = StringUtils.split( path, "." );
110+
111+
if ( tokens.length > 2 && "tar".equals( tokens[tokens.length - 2].toLowerCase( Locale.ENGLISH ) ) )
109112
{
110113
archiveExt = "tar." + archiveExt;
111114
}
112115
}
113-
116+
114117
return archiveExt;
115118

116119
}

0 commit comments

Comments
 (0)