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.StreamConsumer;
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.html 885985 2013-11-09 08:11:31Z tchemit $
31   * @since 1.0
32   */
33  public abstract class AbstractJarSignerRequest
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       * The maximum memory available to the JAR signer, e.g. <code>256M</code>. See <a
43       * href="http://docs.oracle.com/javase/6/docs/technotes/tools/windows/java.html#Xms">-Xmx</a> for more details.
44       */
45      private String maxMemory;
46  
47      /**
48       * List of additional arguments to append to the jarsigner command line.
49       */
50      private String[] arguments;
51  
52      /**
53       * Location of the working directory.
54       */
55      private File workingDirectory;
56  
57      /**
58       * Archive to treat.
59       */
60      private File archive;
61  
62      /**
63       * Optional system out stream consumer used by the commandline execution.
64       */
65      private StreamConsumer systemOutStreamConsumer;
66  
67      /**
68       * Optional system error stream consumer used by the commandline execution.
69       */
70      private StreamConsumer systemErrorStreamConsumer;
71  
72      public boolean isVerbose()
73      {
74          return verbose;
75      }
76  
77      public String getMaxMemory()
78      {
79          return maxMemory;
80      }
81  
82      public String[] getArguments()
83      {
84          return arguments;
85      }
86  
87      public File getWorkingDirectory()
88      {
89          return workingDirectory;
90      }
91  
92      public File getArchive()
93      {
94          return archive;
95      }
96  
97      public StreamConsumer getSystemOutStreamConsumer()
98      {
99          return systemOutStreamConsumer;
100     }
101 
102     public StreamConsumer getSystemErrorStreamConsumer()
103     {
104         return systemErrorStreamConsumer;
105     }
106 
107     public void setVerbose( boolean verbose )
108     {
109         this.verbose = verbose;
110     }
111 
112     public void setMaxMemory( String maxMemory )
113     {
114         this.maxMemory = maxMemory;
115     }
116 
117     public void setArguments( String[] arguments )
118     {
119         this.arguments = arguments;
120     }
121 
122     public void setWorkingDirectory( File workingDirectory )
123     {
124         this.workingDirectory = workingDirectory;
125     }
126 
127     public void setArchive( File archive )
128     {
129         this.archive = archive;
130     }
131 
132     public void setSystemOutStreamConsumer( StreamConsumer systemOutStreamConsumer )
133     {
134         this.systemOutStreamConsumer = systemOutStreamConsumer;
135     }
136 
137     public void setSystemErrorStreamConsumer( StreamConsumer systemErrorStreamConsumer )
138     {
139         this.systemErrorStreamConsumer = systemErrorStreamConsumer;
140     }
141 }