View Javadoc

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