|
17 | 17 | * limitations under the License.
|
18 | 18 | */
|
19 | 19 |
|
| 20 | +import java.io.BufferedOutputStream; |
| 21 | +import java.io.File; |
| 22 | +import java.io.FileOutputStream; |
| 23 | +import java.io.IOException; |
| 24 | +import java.io.InputStream; |
| 25 | +import java.io.OutputStream; |
| 26 | +import java.util.zip.GZIPOutputStream; |
| 27 | + |
20 | 28 | import org.apache.commons.compress.compressors.bzip2.BZip2CompressorOutputStream;
|
21 | 29 | import org.codehaus.plexus.archiver.AbstractArchiver;
|
22 | 30 | import org.codehaus.plexus.archiver.ArchiveEntry;
|
|
30 | 38 | import org.codehaus.plexus.util.IOUtil;
|
31 | 39 | import org.codehaus.plexus.util.StringUtils;
|
32 | 40 |
|
33 |
| -import java.io.BufferedOutputStream; |
34 |
| -import java.io.File; |
35 |
| -import java.io.FileOutputStream; |
36 |
| -import java.io.IOException; |
37 |
| -import java.io.InputStream; |
38 |
| -import java.io.OutputStream; |
39 |
| -import java.util.zip.GZIPOutputStream; |
40 |
| - |
41 | 41 | /**
|
42 | 42 | * @author <a href="mailto:[email protected]">Emmanuel Venisse</a>
|
43 | 43 | * @version $Revision$ $Date$
|
@@ -249,7 +249,7 @@ protected void tarFile( ArchiveEntry entry, TarOutputStream tOut, String vPath )
|
249 | 249 | int pathLength = vPath.length();
|
250 | 250 | try
|
251 | 251 | {
|
252 |
| - final TarEntry te; |
| 252 | + TarEntry te = null; |
253 | 253 | if ( !longFileMode.isGnuMode() && pathLength >= TarConstants.NAMELEN )
|
254 | 254 | {
|
255 | 255 | int maxPosixPathLen = TarConstants.NAMELEN + TarConstants.POSIX_PREFIXLEN;
|
@@ -337,20 +337,10 @@ else if ( longFileMode.isFailMode() )
|
337 | 337 | : options.getUserName() );
|
338 | 338 | te.setGroupName( ( attributes != null && attributes.getGroupName() != null ) ? attributes.getGroupName()
|
339 | 339 | : options.getGroup() );
|
340 |
| - |
341 |
| - final int userId = |
342 |
| - ( attributes != null && attributes.getUserId() != null ) ? attributes.getUserId() : options.getUid(); |
343 |
| - if ( userId > 0 ) |
344 |
| - { |
345 |
| - te.setUserId( userId ); |
346 |
| - } |
347 |
| - |
348 |
| - final int groupId = |
349 |
| - ( attributes != null && attributes.getGroupId() != null ) ? attributes.getGroupId() : options.getGid(); |
350 |
| - if ( groupId > 0 ) |
351 |
| - { |
352 |
| - te.setGroupId( groupId ); |
353 |
| - } |
| 340 | + te.setUserId( ( attributes != null && attributes.getUserId() != null) ? attributes.getUserId() |
| 341 | + : options.getUid() ); |
| 342 | + te.setGroupId( ( attributes != null && attributes.getGroupId() != null) ? attributes.getGroupId() |
| 343 | + : options.getGid() ); |
354 | 344 |
|
355 | 345 | tOut.putNextEntry( te );
|
356 | 346 |
|
|
0 commit comments