1
- package org .codehaus .plexus .archiver ;
2
-
3
1
/**
4
2
*
5
3
* Copyright 2004 The Apache Software Foundation
6
4
*
7
- * Licensed under the Apache License, Version 2.0 (the "License");
8
- * you may not use this file except in compliance with the License.
9
- * You may obtain a copy of the License at
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
10
8
*
11
- * http://www.apache.org/licenses/LICENSE-2.0
9
+ * http://www.apache.org/licenses/LICENSE-2.0
12
10
*
13
- * Unless required by applicable law or agreed to in writing, software
14
- * distributed under the License is distributed on an "AS IS" BASIS,
15
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- * See the License for the specific language governing permissions and
17
- * limitations under the License.
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
18
16
*/
17
+ package org .codehaus .plexus .archiver ;
19
18
20
19
import java .io .Closeable ;
21
20
import java .io .File ;
56
55
import static org .codehaus .plexus .archiver .util .DefaultArchivedFileSet .archivedFileSet ;
57
56
import static org .codehaus .plexus .archiver .util .DefaultFileSet .fileSet ;
58
57
59
- /**
60
- * @version $Id$
61
- */
62
58
public abstract class AbstractArchiver
63
59
extends AbstractLogEnabled
64
60
implements Archiver , Contextualizable , FinalizerEnabled
@@ -114,6 +110,7 @@ public abstract class AbstractArchiver
114
110
115
111
private static class AddedResourceCollection
116
112
{
113
+
117
114
private final PlexusIoResourceCollection resources ;
118
115
119
116
private final int forcedFileMode ;
@@ -435,7 +432,6 @@ private ArchiveEntry asArchiveEntry( final AddedResourceCollection collection, f
435
432
collection .resources );
436
433
}
437
434
438
-
439
435
@ Override
440
436
public void addResource ( final PlexusIoResource resource , final String destFileName , final int permissions )
441
437
throws ArchiverException
@@ -465,8 +461,7 @@ public void addFile( @Nonnull final File inputFile, @Nonnull String destFileName
465
461
try
466
462
{
467
463
// do a null check here, to avoid creating a file stream if there are no filters...
468
- doAddResource (
469
- ArchiveEntry .createFileEntry ( destFileName , inputFile , permissions , getDirectoryMode () ) );
464
+ doAddResource ( ArchiveEntry .createFileEntry ( destFileName , inputFile , permissions , getDirectoryMode () ) );
470
465
}
471
466
catch ( final IOException e )
472
467
{
@@ -481,6 +476,7 @@ public ResourceIterator getResources()
481
476
{
482
477
return new ResourceIterator ()
483
478
{
479
+
484
480
private final Iterator addedResourceIter = resources .iterator ();
485
481
486
482
private AddedResourceCollection currentResourceCollection ;
@@ -555,7 +551,7 @@ else if ( o instanceof AddedResourceCollection )
555
551
final String path = nextEntry .getName ();
556
552
557
553
if ( Archiver .DUPLICATES_PRESERVE .equals ( duplicateBehavior )
558
- || Archiver .DUPLICATES_SKIP .equals ( duplicateBehavior ) )
554
+ || Archiver .DUPLICATES_SKIP .equals ( duplicateBehavior ) )
559
555
{
560
556
if ( nextEntry .getType () == ArchiveEntry .FILE )
561
557
{
@@ -645,7 +641,6 @@ private static void closeQuietlyIfCloseable( Object resource )
645
641
}
646
642
}
647
643
648
-
649
644
@ Override
650
645
public Map <String , ArchiveEntry > getFiles ()
651
646
{
@@ -1087,7 +1082,6 @@ protected void cleanUp()
1087
1082
resources .clear ();
1088
1083
}
1089
1084
1090
-
1091
1085
protected abstract void execute ()
1092
1086
throws ArchiverException , IOException ;
1093
1087
0 commit comments