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 1541710 2013-11-13 21:01:00Z 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 alias;
51  
52      /**
53       * The maximum memory available to the JAR signer, e.g. <code>256M</code>. See <a
54       * href="http://docs.oracle.com/javase/6/docs/technotes/tools/windows/java.html#Xms">-Xmx</a> for more details.
55       */
56      private String maxMemory;
57  
58      /**
59       * List of additional arguments to append to the jarsigner command line.
60       */
61      private String[] arguments;
62  
63      /**
64       * Location of the working directory.
65       */
66      private File workingDirectory;
67  
68      /**
69       * Archive to treat.
70       */
71      private File archive;
72  
73      /**
74       * See <a href="http://java.sun.com/javase/6/docs/technotes/tools/windows/jarsigner.html#Options">options</a>.
75       */
76      protected boolean protectedAuthenticationPath;
77  
78      /**
79       * {@inheritDoc}
80       */
81      public boolean isVerbose()
82      {
83          return verbose;
84      }
85  
86      /**
87       * {@inheritDoc}
88       */
89      public String getKeystore()
90      {
91          return keystore;
92      }
93  
94      /**
95       * {@inheritDoc}
96       */
97      public String getAlias()
98      {
99          return alias;
100     }
101 
102     /**
103      * {@inheritDoc}
104      */
105     public String getMaxMemory()
106     {
107         return maxMemory;
108     }
109 
110     /**
111      * {@inheritDoc}
112      */
113     public String[] getArguments()
114     {
115         return arguments;
116     }
117 
118     /**
119      * {@inheritDoc}
120      */
121     public File getWorkingDirectory()
122     {
123         return workingDirectory;
124     }
125 
126     /**
127      * {@inheritDoc}
128      */
129     public File getArchive()
130     {
131         return archive;
132     }
133 
134     /**
135      * {@inheritDoc}
136      */
137     public boolean isProtectedAuthenticationPath()
138     {
139         return protectedAuthenticationPath;
140     }
141 
142     /**
143      * {@inheritDoc}
144      */
145     public void setVerbose( boolean verbose )
146     {
147         this.verbose = verbose;
148     }
149 
150     /**
151      * {@inheritDoc}
152      */
153     public void setKeystore( String keystore )
154     {
155         this.keystore = keystore;
156     }
157 
158     /**
159      * {@inheritDoc}
160      */
161     public void setAlias( String alias )
162     {
163         this.alias = alias;
164     }
165 
166     /**
167      * {@inheritDoc}
168      */
169     public void setMaxMemory( String maxMemory )
170     {
171         this.maxMemory = maxMemory;
172     }
173 
174     /**
175      * {@inheritDoc}
176      */
177     public void setArguments( String... arguments )
178     {
179         this.arguments = arguments;
180     }
181 
182     /**
183      * {@inheritDoc}
184      */
185     public void setWorkingDirectory( File workingDirectory )
186     {
187         this.workingDirectory = workingDirectory;
188     }
189 
190     /**
191      * {@inheritDoc}
192      */
193     public void setArchive( File archive )
194     {
195         this.archive = archive;
196     }
197 
198     /**
199      * {@inheritDoc}
200      */
201     public void setProtectedAuthenticationPath( boolean protect )
202     {
203         this.protectedAuthenticationPath = protect;
204     }
205 }