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