Skip to content

Commit ce16809

Browse files
author
lore
committed
Add xz components for tar operations
1 parent a2a45f8 commit ce16809

File tree

3 files changed

+117
-0
lines changed

3 files changed

+117
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright 2016 Codehaus.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.codehaus.plexus.archiver.tar;
17+
18+
import java.io.File;
19+
20+
/**
21+
*
22+
* @author philip.lourandos
23+
*/
24+
public class PlexusIoTarXZFileResourceCollection extends
25+
PlexusIoTarFileResourceCollection
26+
{
27+
28+
public PlexusIoTarXZFileResourceCollection()
29+
{
30+
}
31+
32+
@Override
33+
protected TarFile newTarFile(File file)
34+
{
35+
return new XZTarFile( file );
36+
}
37+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright 2016 Codehaus.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.codehaus.plexus.archiver.tar;
17+
18+
import java.io.File;
19+
20+
/**
21+
*
22+
* @author philip.lourandos
23+
*/
24+
public class TarXZUnArchiver extends TarUnArchiver
25+
{
26+
public TarXZUnArchiver() {
27+
setupCompressionMethod();
28+
}
29+
30+
public TarXZUnArchiver(File sourceFile) {
31+
super(sourceFile);
32+
33+
setupCompressionMethod();
34+
}
35+
36+
private final void setupCompressionMethod()
37+
{
38+
setCompression(TarUnArchiver.UntarCompressionMethod.XZ);
39+
}
40+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright 2016 Codehaus.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.codehaus.plexus.archiver.tar;
17+
18+
import java.io.File;
19+
import java.io.IOException;
20+
import java.io.InputStream;
21+
import org.codehaus.plexus.archiver.xz.XZUnArchiver;
22+
23+
/**
24+
*
25+
* @author philip.lourandos
26+
*/
27+
public class XZTarFile extends TarFile
28+
{
29+
30+
public XZTarFile ( File file )
31+
{
32+
super(file);
33+
}
34+
35+
@Override
36+
protected InputStream getInputStream( File file ) throws IOException
37+
{
38+
return XZUnArchiver.getXZInputStream( super.getInputStream( file ) );
39+
}
40+
}

0 commit comments

Comments
 (0)