View Javadoc
1   package org.apache.maven.plugin.assembly.archive;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import junit.framework.Assert;
23  import org.apache.maven.artifact.repository.ArtifactRepository;
24  import org.apache.maven.model.Model;
25  import org.apache.maven.plugin.assembly.AssemblerConfigurationSource;
26  import org.apache.maven.plugin.assembly.InvalidAssemblerConfigurationException;
27  import org.apache.maven.plugin.assembly.archive.phase.AssemblyArchiverPhase;
28  import org.apache.maven.plugin.assembly.artifact.DependencyResolutionException;
29  import org.apache.maven.plugin.assembly.artifact.DependencyResolver;
30  import org.apache.maven.plugin.assembly.format.AssemblyFormattingException;
31  import org.apache.maven.plugin.assembly.model.Assembly;
32  import org.apache.maven.plugin.assembly.mojos.AbstractAssemblyMojo;
33  import org.apache.maven.plugin.assembly.testutils.TestFileManager;
34  import org.apache.maven.project.MavenProject;
35  import org.codehaus.plexus.DefaultPlexusContainer;
36  import org.codehaus.plexus.PlexusContainer;
37  import org.codehaus.plexus.PlexusContainerException;
38  import org.codehaus.plexus.archiver.Archiver;
39  import org.codehaus.plexus.archiver.ArchiverException;
40  import org.codehaus.plexus.archiver.diags.NoOpArchiver;
41  import org.codehaus.plexus.archiver.manager.ArchiverManager;
42  import org.codehaus.plexus.archiver.manager.NoSuchArchiverException;
43  import org.codehaus.plexus.archiver.tar.TarArchiver;
44  import org.codehaus.plexus.archiver.tar.TarLongFileMode;
45  import org.codehaus.plexus.archiver.war.WarArchiver;
46  import org.codehaus.plexus.archiver.zip.ZipArchiver;
47  import org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator;
48  import org.codehaus.plexus.logging.Logger;
49  import org.codehaus.plexus.logging.console.ConsoleLogger;
50  import org.codehaus.plexus.util.FileUtils;
51  import org.easymock.classextension.EasyMockSupport;
52  import org.junit.AfterClass;
53  import org.junit.Before;
54  import org.junit.Test;
55  
56  import java.io.File;
57  import java.io.IOException;
58  import java.util.ArrayList;
59  import java.util.Collections;
60  import java.util.List;
61  
62  import static org.easymock.EasyMock.*;
63  import static org.junit.Assert.*;
64  
65  public class DefaultAssemblyArchiverTest
66  {
67  
68      private static final TestFileManager fileManager = new TestFileManager( "def-assy-archiver.test.", "" );
69  
70      private PlexusContainer container;
71  
72      @Before
73      public void setup()
74          throws PlexusContainerException
75      {
76          container = new DefaultPlexusContainer();
77          container.initialize();
78          container.start();
79      }
80  
81      @AfterClass
82      public static void tearDown()
83          throws Exception
84      {
85          fileManager.cleanUp();
86      }
87  
88      @Test( expected = InvalidAssemblerConfigurationException.class )
89      public void failWhenAssemblyIdIsNull()
90          throws ArchiveCreationException, AssemblyFormattingException, InvalidAssemblerConfigurationException
91      {
92          final EasyMockSupport mm = new EasyMockSupport();
93  
94          final MockAndControlForAssemblyArchiver macMgr = new MockAndControlForAssemblyArchiver( mm );
95  
96          final AssemblerConfigurationSource configSource = mm.createControl().createMock(
97              AssemblerConfigurationSource.class );
98  
99          mm.replayAll();
100 
101         final DefaultAssemblyArchiver archiver = createSubject( macMgr, null, null );
102         archiver.createArchive( new Assembly(), "full-name", "zip", configSource, false );
103 
104         mm.verifyAll();
105     }
106 
107     @Test
108     public void testCreateArchive()
109         throws ArchiveCreationException, AssemblyFormattingException, InvalidAssemblerConfigurationException,
110         IOException, DependencyResolutionException
111     {
112         final EasyMockSupport mm = new EasyMockSupport();
113 
114         final MockAndControlForAssemblyArchiver macMgr = new MockAndControlForAssemblyArchiver( mm );
115 
116         macMgr.expectGetArchiver( "zip", Archiver.class );
117         macMgr.expectGetDestFile( new File( "test" ) );
118 
119         final AssemblyArchiverPhase phase = mm.createControl().createMock(AssemblyArchiverPhase.class  );
120 
121         phase.execute( (Assembly)anyObject(), (Archiver)anyObject(), (AssemblerConfigurationSource)anyObject() );
122 
123         final AssemblerConfigurationSource configSource =
124             mm.createControl().createMock( AssemblerConfigurationSource.class );
125 
126         final File tempDir = fileManager.createTempDir();
127         FileUtils.deleteDirectory( tempDir );
128 
129         expect(configSource.getTemporaryRootDirectory()).andReturn( tempDir ).anyTimes();
130         expect( configSource.isDryRun()).andReturn( false ).anyTimes();
131         expect( configSource.isIgnoreDirFormatExtensions()).andReturn( false ).anyTimes();
132 
133         final File outDir = fileManager.createTempDir();
134 
135         macMgr.archiver.setDestFile( new File( outDir, "full-name.zip" ) );
136 
137         try
138         {
139             macMgr.archiver.createArchive();
140         }
141         catch ( final ArchiverException e )
142         {
143             fail( "Should never happen" );
144         }
145         catch ( final IOException e )
146         {
147             fail( "Should never happen" );
148         }
149 
150         expect(configSource.getOutputDirectory()).andReturn( outDir );
151         expect( configSource.getFinalName() ).andReturn( "finalName" );
152         expect( configSource.getArchiverConfig()).andReturn( null ).anyTimes();
153         expect(    configSource.getWorkingDirectory()).andReturn( new File( "." )).anyTimes();
154         expect( configSource.isUpdateOnly()).andReturn( false ).anyTimes();
155         expect( configSource.isIgnorePermissions()).andReturn( false ).anyTimes();
156 
157         final Assembly assembly = new Assembly();
158         assembly.setId( "id" );
159 
160        // try
161        // {
162    //         expect( macMgr.dependencyResolver.resolve( (Assembly) anyObject(), (AssemblerConfigurationSource) anyObject() )).andReturn( new HashSet<Artifact>(  ) );
163 //            macMgr.dependencyResolverControl.setMatcher( MockControl.ALWAYS_MATCHER );
164    //     }
165       //  catch ( final DependencyResolutionException e )
166        // {
167         //    fail( "Should never happen" );
168        // }
169 
170         mm.replayAll();
171 
172         final DefaultAssemblyArchiver subject = createSubject( macMgr, Collections.singletonList( phase ), null );
173 
174         subject.createArchive( assembly, "full-name", "zip", configSource, false );
175 
176         mm.verifyAll();
177     }
178 
179     @Test
180     public void testCreateArchiver_ShouldConfigureArchiver()
181         throws NoSuchArchiverException, ArchiverException
182     {
183         final EasyMockSupport mm = new EasyMockSupport();
184 
185         final MockAndControlForAssemblyArchiver macArchiverManager = new MockAndControlForAssemblyArchiver( mm );
186 
187         final TestArchiverWithConfig archiver = new TestArchiverWithConfig();
188 
189         macArchiverManager.expectGetArchiver( "dummy", archiver );
190 
191         final AssemblerConfigurationSource configSource = mm.createMock(  AssemblerConfigurationSource.class);
192 
193         final String simpleConfig = "value";
194 
195         expect( configSource.getArchiverConfig()).andReturn(
196         "<configuration><simpleConfig>" + simpleConfig + "</simpleConfig></configuration>").anyTimes();
197 
198         final MavenProject project = new MavenProject( new Model() );
199 
200         expect(configSource.getProject()).andReturn( project ).anyTimes();
201 
202         expect(configSource.getMavenSession()).andReturn( null ).anyTimes();
203 
204         expect(configSource.isDryRun()).andReturn( false ).anyTimes();
205 
206         expect(configSource.getWorkingDirectory()).andReturn(  new File( "." )).anyTimes();
207 
208         expect(configSource.isUpdateOnly()).andReturn( false ).anyTimes();
209 
210         final ArtifactRepository lr = mm.createMock( ArtifactRepository.class );
211 
212         expect(lr.getBasedir()).andReturn(  "/path/to/local/repo" ).anyTimes();
213 
214         expect(configSource.getLocalRepository()).andReturn( lr ).anyTimes();
215         expect( configSource.isIgnorePermissions() ).andReturn( true );
216         setupInterpolators( configSource, project );
217 
218 
219         mm.replayAll();
220 
221         final DefaultAssemblyArchiver subject =
222             createSubject( macArchiverManager, new ArrayList<AssemblyArchiverPhase>(), null );
223 
224         subject.createArchiver( "dummy", false, "finalName", configSource, null, false );
225 
226         assertEquals( simpleConfig, archiver.getSimpleConfig() );
227 
228         mm.verifyAll();
229     }
230 
231     public static  void setupInterpolators( AssemblerConfigurationSource configSource )
232     {
233         expect( configSource.getRepositoryInterpolator() ).andReturn( FixedStringSearchInterpolator.create() ).anyTimes();
234         expect( configSource.getCommandLinePropsInterpolator() ).andReturn( FixedStringSearchInterpolator.create() ).anyTimes();
235         expect( configSource.getEnvInterpolator() ).andReturn( FixedStringSearchInterpolator.create() ).anyTimes();
236         expect( configSource.getMainProjectInterpolator() ).andReturn( FixedStringSearchInterpolator.create() ).anyTimes();
237 
238     }
239 
240     public static  void setupInterpolators( AssemblerConfigurationSource configSource, MavenProject mavenProject )
241     {
242         expect( configSource.getRepositoryInterpolator() ).andReturn( FixedStringSearchInterpolator.create() ).anyTimes();
243         expect( configSource.getCommandLinePropsInterpolator() ).andReturn( FixedStringSearchInterpolator.create() ).anyTimes();
244         expect( configSource.getEnvInterpolator() ).andReturn( FixedStringSearchInterpolator.create() ).anyTimes();
245         expect( configSource.getMainProjectInterpolator() ).andReturn( AbstractAssemblyMojo.mainProjectInterpolator( mavenProject) ).anyTimes();
246 
247     }
248 
249 
250     @Test
251     public void testCreateArchiver_ShouldCreateTarArchiverWithNoCompression()
252         throws NoSuchArchiverException, ArchiverException
253     {
254         final EasyMockSupport mm = new EasyMockSupport();
255 
256         final TestTarArchiver ttArchiver = new TestTarArchiver();
257 
258         final MockAndControlForAssemblyArchiver macArchiverManager = new MockAndControlForAssemblyArchiver( mm );
259 
260         macArchiverManager.expectGetArchiver( "tar", ttArchiver );
261 
262         final AssemblerConfigurationSource configSource = mm.createMock( AssemblerConfigurationSource.class );
263 
264         expect( configSource.getTarLongFileMode()).andReturn( TarLongFileMode.fail.toString()).anyTimes();
265         expect( configSource.isDryRun()).andReturn( false ).anyTimes();
266 
267         expect( configSource.getArchiverConfig()).andReturn( null ).anyTimes();
268 
269         expect( configSource.getProject()).andReturn( new MavenProject( new Model() ) ).anyTimes();
270 
271         expect( configSource.getJarArchiveConfiguration()).andReturn( null ).anyTimes();
272 
273         expect( configSource.getWorkingDirectory()).andReturn(  new File( "." ) ).anyTimes();
274 
275         expect( configSource.isUpdateOnly()).andReturn( false ).anyTimes();
276 
277         expect( configSource.isIgnorePermissions()).andReturn( true ).anyTimes();
278 
279         mm.replayAll();
280 
281         final DefaultAssemblyArchiver subject =
282             createSubject( macArchiverManager, new ArrayList<AssemblyArchiverPhase>(), null );
283 
284         subject.createArchiver( "tar", false, "finalName", configSource, null, false );
285 
286         assertNull( ttArchiver.compressionMethod );
287         assertEquals( TarLongFileMode.fail, ttArchiver.longFileMode );
288 
289         mm.verifyAll();
290     }
291 
292     @Test
293     public void testCreateArchiver_ShouldCreateWarArchiverWithIgnoreWebxmlSetToFalse()
294         throws NoSuchArchiverException, ArchiverException
295     {
296         final EasyMockSupport mm = new EasyMockSupport();
297 
298         final TestWarArchiver twArchiver = new TestWarArchiver();
299 
300         final MockAndControlForAssemblyArchiver macArchiverManager = new MockAndControlForAssemblyArchiver( mm );
301 
302         macArchiverManager.expectGetArchiver( "war", twArchiver );
303 
304         final AssemblerConfigurationSource configSource = mm.createMock( AssemblerConfigurationSource.class );
305 
306         expect( configSource.isDryRun()).andReturn( false ).anyTimes();
307         expect( configSource.getArchiverConfig()).andReturn( null ).anyTimes();
308         expect( configSource.getMavenSession()).andReturn( null ).anyTimes();
309         expect( configSource.getProject()).andReturn( new MavenProject( new Model() ) ).anyTimes();
310         expect( configSource.getJarArchiveConfiguration()).andReturn( null ).anyTimes();
311         expect( configSource.getWorkingDirectory()).andReturn( new File( "." ) ).anyTimes();
312         expect( configSource.isUpdateOnly()).andReturn( false ).anyTimes();
313         expect( configSource.isIgnorePermissions()).andReturn( true ).anyTimes();
314 
315         mm.replayAll();
316 
317         final DefaultAssemblyArchiver subject =
318             createSubject( macArchiverManager, new ArrayList<AssemblyArchiverPhase>(), null );
319 
320         subject.createArchiver( "war", false, null, configSource, null, false );
321 
322         assertFalse( twArchiver.ignoreWebxml );
323     }
324 
325     @Test
326     public void testCreateArchiver_ShouldCreateZipArchiver()
327         throws NoSuchArchiverException, ArchiverException
328     {
329         final EasyMockSupport mm = new EasyMockSupport();
330 
331         final ZipArchiver archiver = new ZipArchiver();
332 
333         final MockAndControlForAssemblyArchiver macArchiverManager = new MockAndControlForAssemblyArchiver( mm );
334 
335         macArchiverManager.expectGetArchiver( "zip", archiver );
336 
337         final AssemblerConfigurationSource configSource = mm.createMock( AssemblerConfigurationSource.class );
338 
339         expect( configSource.isDryRun()).andReturn( false ).anyTimes();
340         expect( configSource.getArchiverConfig()).andReturn( null ).anyTimes();
341         expect( configSource.getWorkingDirectory()).andReturn( new File( "." ) ).anyTimes();
342         expect( configSource.isUpdateOnly()).andReturn( false ).anyTimes();
343         expect( configSource.getJarArchiveConfiguration()).andReturn( null ).anyTimes();
344         expect( configSource.isIgnorePermissions()).andReturn( true ).anyTimes();
345 
346         mm.replayAll();
347 
348         final DefaultAssemblyArchiver subject =
349             createSubject( macArchiverManager, new ArrayList<AssemblyArchiverPhase>(), null );
350 
351         subject.createArchiver( "zip", false, null, configSource, null, false );
352     }
353 
354     @Test
355     public void testCreateWarArchiver_ShouldDisableIgnoreWebxmlOption()
356         throws NoSuchArchiverException
357     {
358         final EasyMockSupport mm = new EasyMockSupport();
359 
360         final TestWarArchiver twArchiver = new TestWarArchiver();
361 
362         final MockAndControlForAssemblyArchiver macArchiverManager = new MockAndControlForAssemblyArchiver( mm );
363 
364         macArchiverManager.expectGetArchiver( "war", twArchiver );
365 
366         mm.replayAll();
367 
368         final DefaultAssemblyArchiver subject =
369             createSubject( macArchiverManager, new ArrayList<AssemblyArchiverPhase>(), null );
370 
371         subject.createWarArchiver();
372 
373         assertFalse( twArchiver.ignoreWebxml );
374     }
375 
376     @Test
377     public void testCreateTarArchiver_ShouldNotInitializeCompression()
378         throws NoSuchArchiverException, ArchiverException
379     {
380         final EasyMockSupport mm = new EasyMockSupport();
381 
382         final TestTarArchiver ttArchiver = new TestTarArchiver();
383 
384         final DefaultAssemblyArchiver subject = createSubject(mm, ttArchiver);
385 
386         subject.createTarArchiver( "tar", TarLongFileMode.fail );
387 
388         assertNull( ttArchiver.compressionMethod );
389         assertEquals( TarLongFileMode.fail, ttArchiver.longFileMode );
390 
391         mm.verifyAll();
392     }
393 
394     private DefaultAssemblyArchiver createSubject(EasyMockSupport mm,
395             TestTarArchiver ttArchiver) throws NoSuchArchiverException {
396         final MockAndControlForAssemblyArchiver macArchiverManager = new MockAndControlForAssemblyArchiver( mm );
397 
398         macArchiverManager.expectGetArchiver( "tar", ttArchiver );
399 
400         mm.replayAll();
401 
402         return createSubject( macArchiverManager, new ArrayList<AssemblyArchiverPhase>(), null );
403     }
404 
405     @Test
406     public void testCreateTarArchiver_TarGzFormat_ShouldInitializeGZipCompression()
407         throws NoSuchArchiverException, ArchiverException
408     {
409         final EasyMockSupport mm = new EasyMockSupport();
410 
411         final TestTarArchiver ttArchiver = new TestTarArchiver();
412 
413         final DefaultAssemblyArchiver subject = createSubject(mm, ttArchiver);
414 
415         subject.createTarArchiver( "tar.gz", TarLongFileMode.fail );
416 
417         assertEquals( TarArchiver.TarCompressionMethod.gzip, ttArchiver.compressionMethod );
418         assertEquals( TarLongFileMode.fail, ttArchiver.longFileMode );
419 
420         mm.verifyAll();
421     }
422 
423     @Test
424     public void testCreateTarArchiver_TgzFormat_ShouldInitializeGZipCompression()
425         throws NoSuchArchiverException, ArchiverException
426     {
427         final EasyMockSupport mm = new EasyMockSupport();
428 
429         final TestTarArchiver ttArchiver = new TestTarArchiver();
430 
431         final DefaultAssemblyArchiver subject = createSubject(mm, ttArchiver);
432 
433         subject.createTarArchiver( "tgz", TarLongFileMode.fail );
434 
435         assertEquals( TarArchiver.TarCompressionMethod.gzip, ttArchiver.compressionMethod );
436         assertEquals( TarLongFileMode.fail, ttArchiver.longFileMode );
437 
438         mm.verifyAll();
439     }
440 
441     @Test
442     public void testCreateTarArchiver_TarBz2Format_ShouldInitializeBZipCompression()
443         throws NoSuchArchiverException, ArchiverException
444     {
445         final EasyMockSupport mm = new EasyMockSupport();
446 
447         final TestTarArchiver ttArchiver = new TestTarArchiver();
448 
449         final DefaultAssemblyArchiver subject = createSubject(mm, ttArchiver);
450 
451         subject.createTarArchiver( "tar.bz2", TarLongFileMode.fail );
452 
453         assertEquals( TarArchiver.TarCompressionMethod.bzip2, ttArchiver.compressionMethod );
454         assertEquals( TarLongFileMode.fail, ttArchiver.longFileMode );
455 
456         mm.verifyAll();
457     }
458 
459     @Test
460     public void testCreateTarArchiver_Tbz2Format_ShouldInitializeBZipCompression()
461         throws NoSuchArchiverException, ArchiverException
462     {
463         final EasyMockSupport mm = new EasyMockSupport();
464 
465         final TestTarArchiver ttArchiver = new TestTarArchiver();
466 
467         final DefaultAssemblyArchiver subject = createSubject(mm, ttArchiver);
468 
469         subject.createTarArchiver( "tbz2", TarLongFileMode.fail );
470 
471         assertEquals( TarArchiver.TarCompressionMethod.bzip2, ttArchiver.compressionMethod );
472         assertEquals( TarLongFileMode.fail, ttArchiver.longFileMode );
473 
474         mm.verifyAll();
475     }
476 
477     @Test
478     public void testCreateTarArchiver_InvalidFormat_ShouldFailWithInvalidCompression()
479         throws NoSuchArchiverException, ArchiverException
480     {
481         final EasyMockSupport mm = new EasyMockSupport();
482 
483         final TestTarArchiver ttArchiver = new TestTarArchiver();
484 
485         final DefaultAssemblyArchiver subject = createSubject(mm, ttArchiver);
486 
487         try
488         {
489             subject.createTarArchiver( "tar.Z", null );
490 
491             fail( "Invalid compression formats should throw an error." );
492         }
493         catch ( final IllegalArgumentException e )
494         {
495             // expected.
496         }
497 
498         mm.verifyAll();
499     }
500 
501     private DefaultAssemblyArchiver createSubject( final MockAndControlForAssemblyArchiver macMgr,
502                                                    final List<AssemblyArchiverPhase> phases, Logger logger )
503     {
504         final DefaultAssemblyArchiver subject =
505             new DefaultAssemblyArchiver( macMgr.archiverManager, phases );
506 
507         subject.setContainer( container );
508 
509         if ( logger == null )
510         {
511             logger = new ConsoleLogger( Logger.LEVEL_DEBUG, "test" );
512         }
513 
514         subject.enableLogging( logger );
515 
516         return subject;
517     }
518 
519     private final class MockAndControlForAssemblyArchiver
520     {
521         final ArchiverManager archiverManager;
522 
523 
524         Archiver archiver;
525 
526         final DependencyResolver dependencyResolver;
527 
528         private final EasyMockSupport mm;
529 
530         public MockAndControlForAssemblyArchiver( final EasyMockSupport mm )
531         {
532             this.mm = mm;
533             archiverManager = mm.createControl().createMock(  ArchiverManager.class );
534 
535             dependencyResolver = mm.createControl().createMock( DependencyResolver.class );
536 
537         }
538 
539         void expectGetDestFile( final File file )
540         {
541             expect(archiver.getDestFile()).andReturn( file ).anyTimes();
542         }
543 
544         void createArchiver( final Class<? extends Archiver> archiverClass )
545         {
546             archiver = mm.createControl().createMock(archiverClass);
547 
548             archiver.setForced( anyBoolean() );
549             expectLastCall().anyTimes();
550 
551             archiver.setIgnorePermissions( false );
552             expectLastCall().anyTimes();
553         }
554 
555         void expectGetArchiver( final String format, final Class<? extends Archiver> archiverClass )
556         {
557             createArchiver( archiverClass );
558 
559             try
560             {
561                 expect(archiverManager.getArchiver( format )).andReturn( archiver );
562             }
563             catch ( final NoSuchArchiverException e )
564             {
565                 Assert.fail( "should never happen" );
566             }
567 
568         }
569 
570         void expectGetArchiver( final String format, final Archiver archiver )
571             throws NoSuchArchiverException
572         {
573             expect(archiverManager.getArchiver( format )).andReturn( archiver );
574         }
575     }
576 
577     private static final class TestTarArchiver
578         extends TarArchiver
579     {
580 
581         TarCompressionMethod compressionMethod;
582 
583         TarLongFileMode longFileMode;
584 
585         @Override
586         protected void execute()
587             throws ArchiverException, IOException
588         {
589             super.createArchive();
590         }
591 
592         @Override
593         public void setCompression( final TarCompressionMethod mode )
594         {
595             compressionMethod = mode;
596             super.setCompression( mode );
597         }
598 
599         @Override
600         public void setLongfile( final TarLongFileMode mode )
601         {
602             longFileMode = mode;
603             super.setLongfile( mode );
604         }
605 
606     }
607 
608     private static final class TestWarArchiver
609         extends WarArchiver
610     {
611 
612         boolean ignoreWebxml;
613 
614         @Override
615         public void setIgnoreWebxml( final boolean ignore )
616         {
617             ignoreWebxml = ignore;
618             super.setIgnoreWebxml( ignore );
619         }
620 
621     }
622 
623     public static final class TestArchiverWithConfig
624         extends NoOpArchiver
625     {
626 
627         private String simpleConfig;
628 
629         public String getSimpleConfig()
630         {
631             return simpleConfig;
632         }
633 
634 
635         public String getDuplicateBehavior()
636         {
637             return Archiver.DUPLICATES_ADD;
638         }
639     }
640 
641 }