1 package org.apache.maven.shared.jarsigner;
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 org.apache.maven.shared.utils.cli.javatool.AbstractJavaToolRequest;
23
24 import java.io.File;
25
26 /**
27 * Specifies the commons parameters used to control a jar signer invocation.
28 *
29 * @author Tony Chemit
30 * @since 1.0
31 */
32 public abstract class AbstractJarSignerRequest
33 extends AbstractJavaToolRequest
34 implements JarSignerRequest
35 {
36 /**
37 * See <a href="http://docs.oracle.com/javase/6/docs/technotes/tools/windows/jarsigner.html#Options">options</a>.
38 */
39 private boolean verbose;
40
41 /**
42 * See <a href="http://docs.oracle.com/javase/6/docs/technotes/tools/windows/jarsigner.html#Options">options</a>.
43 */
44 private String keystore;
45
46 /**
47 * See <a href="http://docs.oracle.com/javase/6/docs/technotes/tools/windows/jarsigner.html#Options">options</a>.
48 */
49 private String storetype;
50
51 /**
52 * See <a href="http://docs.oracle.com/javase/6/docs/technotes/tools/windows/jarsigner.html#Options">options</a>.
53 */
54 private String storepass;
55
56 /**
57 * See <a href="http://docs.oracle.com/javase/6/docs/technotes/tools/windows/jarsigner.html#Options">options</a>.
58 */
59 private String alias;
60
61 /**
62 * See <a href="http://docs.oracle.com/javase/6/docs/technotes/tools/windows/jarsigner.html#Options">options</a>.
63 */
64 private String providerName;
65
66 /**
67 * See <a href="http://docs.oracle.com/javase/6/docs/technotes/tools/windows/jarsigner.html#Options">options</a>.
68 */
69 private String providerClass;
70
71 /**
72 * See <a href="http://docs.oracle.com/javase/6/docs/technotes/tools/windows/jarsigner.html#Options">options</a>.
73 */
74 private String providerArg;
75
76 /**
77 * The maximum memory available to the JAR signer, e.g. <code>256M</code>. See <a
78 * href="http://docs.oracle.com/javase/6/docs/technotes/tools/windows/java.html#Xms">-Xmx</a> for more details.
79 */
80 private String maxMemory;
81
82 /**
83 * List of additional arguments to append to the jarsigner command line.
84 */
85 private String[] arguments;
86
87 /**
88 * Location of the working directory.
89 */
90 private File workingDirectory;
91
92 /**
93 * Archive to treat.
94 */
95 private File archive;
96
97 /**
98 * See <a href="http://java.sun.com/javase/6/docs/technotes/tools/windows/jarsigner.html#Options">options</a>.
99 */
100 protected boolean protectedAuthenticationPath;
101
102 /**
103 * {@inheritDoc}
104 */
105 public boolean isVerbose()
106 {
107 return verbose;
108 }
109
110 /**
111 * {@inheritDoc}
112 */
113 public String getKeystore()
114 {
115 return keystore;
116 }
117
118 /**
119 * {@inheritDoc}
120 */
121 public String getStoretype()
122 {
123 return storetype;
124 }
125
126 /**
127 * {@inheritDoc}
128 */
129 public String getStorepass()
130 {
131 return storepass;
132 }
133
134 /**
135 * {@inheritDoc}
136 */
137 public String getAlias()
138 {
139 return alias;
140 }
141
142 /**
143 * {@inheritDoc}
144 */
145 public String getProviderName()
146 {
147 return providerName;
148 }
149
150 /**
151 * {@inheritDoc}
152 */
153 public String getProviderClass()
154 {
155 return providerClass;
156 }
157
158 /**
159 * {@inheritDoc}
160 */
161 public String getProviderArg()
162 {
163 return providerArg;
164 }
165
166 /**
167 * {@inheritDoc}
168 */
169 public String getMaxMemory()
170 {
171 return maxMemory;
172 }
173
174 /**
175 * {@inheritDoc}
176 */
177 public String[] getArguments()
178 {
179 return arguments;
180 }
181
182 /**
183 * {@inheritDoc}
184 */
185 public File getWorkingDirectory()
186 {
187 return workingDirectory;
188 }
189
190 /**
191 * {@inheritDoc}
192 */
193 public File getArchive()
194 {
195 return archive;
196 }
197
198 /**
199 * {@inheritDoc}
200 */
201 public boolean isProtectedAuthenticationPath()
202 {
203 return protectedAuthenticationPath;
204 }
205
206 /**
207 * {@inheritDoc}
208 */
209 public void setVerbose( boolean verbose )
210 {
211 this.verbose = verbose;
212 }
213
214 /**
215 * {@inheritDoc}
216 */
217 public void setKeystore( String keystore )
218 {
219 this.keystore = keystore;
220 }
221
222 /**
223 * {@inheritDoc}
224 */
225 public void setStoretype( String storetype )
226 {
227 this.storetype = storetype;
228 }
229
230 /**
231 * {@inheritDoc}
232 */
233 public void setStorepass( String storepass )
234 {
235 this.storepass = storepass;
236 }
237
238 /**
239 * {@inheritDoc}
240 */
241 public void setProviderName( String providerName )
242 {
243 this.providerName = providerName;
244 }
245
246 /**
247 * {@inheritDoc}
248 */
249 public void setProviderClass( String providerClass )
250 {
251 this.providerClass = providerClass;
252 }
253
254 /**
255 * {@inheritDoc}
256 */
257 public void setProviderArg( String providerArg )
258 {
259 this.providerArg = providerArg;
260 }
261
262 /**
263 * {@inheritDoc}
264 */
265 public void setAlias( String alias )
266 {
267 this.alias = alias;
268 }
269
270 /**
271 * {@inheritDoc}
272 */
273 public void setMaxMemory( String maxMemory )
274 {
275 this.maxMemory = maxMemory;
276 }
277
278 /**
279 * {@inheritDoc}
280 */
281 public void setArguments( String... arguments )
282 {
283 this.arguments = arguments;
284 }
285
286 /**
287 * {@inheritDoc}
288 */
289 public void setWorkingDirectory( File workingDirectory )
290 {
291 this.workingDirectory = workingDirectory;
292 }
293
294 /**
295 * {@inheritDoc}
296 */
297 public void setArchive( File archive )
298 {
299 this.archive = archive;
300 }
301
302 /**
303 * {@inheritDoc}
304 */
305 public void setProtectedAuthenticationPath( boolean protect )
306 {
307 this.protectedAuthenticationPath = protect;
308 }
309 }