KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > maven > archiver > MavenArchiveConfiguration


1 package org.apache.maven.archiver;
2
3 /*
4  * Copyright 2001-2005 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19 import java.io.File JavaDoc;
20 import java.util.ArrayList JavaDoc;
21 import java.util.HashMap JavaDoc;
22 import java.util.List JavaDoc;
23 import java.util.Map JavaDoc;
24
25 /**
26  * Capture common archive configuration.
27  *
28  * @author <a HREF="mailto:brett@apache.org">Brett Porter</a>
29  * @version $Id: MavenArchiveConfiguration.java 345380 2005-11-18 00:18:20Z evenisse $
30  * @todo is this general enough to be in Plexus Archiver?
31  */

32 public class MavenArchiveConfiguration
33 {
34     private boolean compress = true;
35
36     private boolean index;
37
38     private boolean addMavenDescriptor = true;
39
40     private File JavaDoc manifestFile;
41
42     private ManifestConfiguration manifest;
43
44     private Map JavaDoc manifestEntries = new HashMap JavaDoc();
45
46     private List JavaDoc manifestSections = new ArrayList JavaDoc();
47     
48     public boolean isCompress()
49     {
50         return compress;
51     }
52
53     public boolean isIndex()
54     {
55         return index;
56     }
57
58     public boolean isAddMavenDescriptor()
59     {
60         return addMavenDescriptor;
61     }
62
63     public File JavaDoc getManifestFile()
64     {
65         return manifestFile;
66     }
67
68     public ManifestConfiguration getManifest()
69     {
70         if ( manifest == null )
71         {
72             manifest = new ManifestConfiguration();
73         }
74         return manifest;
75     }
76
77     public void setCompress( boolean compress )
78     {
79         this.compress = compress;
80     }
81
82     public void setIndex( boolean index )
83     {
84         this.index = index;
85     }
86
87     public void setAddMavenDescriptor( boolean addMavenDescriptor )
88     {
89         this.addMavenDescriptor = addMavenDescriptor;
90     }
91
92     public void setManifestFile( File JavaDoc manifestFile )
93     {
94         this.manifestFile = manifestFile;
95     }
96
97     public void setManifest( ManifestConfiguration manifest )
98     {
99         this.manifest = manifest;
100     }
101
102     public void addManifestEntry( Object JavaDoc key, Object JavaDoc value )
103     {
104         manifestEntries.put( key, value );
105     }
106
107     public void addManifestEntries( Map JavaDoc map )
108     {
109         manifestEntries.putAll( map );
110     }
111
112     public boolean isManifestEntriesEmpty()
113     {
114         return manifestEntries.isEmpty();
115     }
116
117     public Map JavaDoc getManifestEntries()
118     {
119         return manifestEntries;
120     }
121     
122     public void addManifestSection( ManifestSection section ) {
123         manifestSections.add( section );
124     }
125     
126     public void addManifestSections( List JavaDoc list ) {
127         manifestSections.addAll( list );
128     }
129     
130     public boolean isManifestSectionsEmpty() {
131         return manifestSections.isEmpty();
132     }
133     
134     public List JavaDoc getManifestSections() {
135         return manifestSections;
136     }
137 }
138
Popular Tags