| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.AbstractJarSignerTask
public abstract class AbstractJarSignerTask
This is factored out from SignJar; a base class that can be used
 for both signing and verifying JAR files using jarsigner
| Field Summary | |
|---|---|
| protected  java.lang.String | aliasThe alias of signer. | 
| static java.lang.String | ERROR_NO_SOURCEerror string for unit test verification: "jar must be set through jar attribute or nested filesets" | 
| protected  java.util.Vector<FileSet> | filesetsthe filesets of the jars to sign | 
| protected  java.io.File | jarThe name of the jar file. | 
| protected static java.lang.String | JARSIGNER_COMMANDname of JDK program we are looking for | 
| protected  java.lang.String | keypasspassword for the key in the store | 
| protected  java.lang.String | keystoreThe url or path of keystore file. | 
| protected  java.lang.String | maxMemoryThe maximum amount of memory to use for Jar signer | 
| protected  java.lang.String | storepasspassword for the store | 
| protected  java.lang.String | storetypetype of store,-storetype param | 
| protected  boolean | strictstrict checking | 
| protected  boolean | verboseverbose output | 
| Fields inherited from class org.apache.tools.ant.Task | 
|---|
| target, taskName, taskType, wrapper | 
| Fields inherited from class org.apache.tools.ant.ProjectComponent | 
|---|
| description, location, project | 
| Constructor Summary | |
|---|---|
| AbstractJarSignerTask() | |
| Method Summary | |
|---|---|
|  void | addFileset(FileSet set)Adds a set of files to sign | 
|  void | addSysproperty(Environment.Variable sysp)Add a system property. | 
| protected  void | addValue(ExecTask cmd,
         java.lang.String value)add a value argument to a command | 
| protected  void | beginExecution()init processing logic; this is retained through our execution(s) | 
| protected  void | bindToKeystore(ExecTask cmd)bind to a keystore if the attributes are there | 
| protected  ExecTask | createJarSigner()create the jarsigner executable task | 
|  Path | createPath()Adds a path of files to sign. | 
| protected  Path | createUnifiedSourcePath()clone our path and add all explicitly specified FileSets as well, patch in the jar attribute as a new fileset if it is defined. | 
| protected  java.util.Vector<FileSet> | createUnifiedSources()clone our filesets vector, and patch in the jar attribute as a new fileset, if is defined | 
| protected  void | declareSysProperty(ExecTask cmd,
                   Environment.Variable property) | 
| protected  void | endExecution()any cleanup logic | 
|  RedirectorElement | getRedirector()get the redirector. | 
| protected  boolean | hasResources()Has either a path or a fileset been specified? | 
|  void | setAlias(java.lang.String alias)the alias to sign under; required | 
| protected  void | setCommonOptions(ExecTask cmd)these are options common to signing and verifying | 
|  void | setExecutable(java.lang.String executable)Sets the actual executable command to invoke, instead of the binary jarsignerfound in Ant's JDK. | 
|  void | setJar(java.io.File jar)the jar file to sign; required | 
|  void | setKeypass(java.lang.String keypass)password for private key (if different); optional | 
|  void | setKeystore(java.lang.String keystore)keystore location; required | 
|  void | setMaxmemory(java.lang.String max)Set the maximum memory to be used by the jarsigner process | 
|  void | setStorepass(java.lang.String storepass)password for keystore integrity; required | 
|  void | setStoretype(java.lang.String storetype)keystore type; optional | 
|  void | setStrict(boolean strict)do strict checking | 
|  void | setVerbose(boolean verbose)Enable verbose output when signing ; optional: default false | 
| Methods inherited from class org.apache.tools.ant.Task | 
|---|
| bindToOwner, execute, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType | 
| Methods inherited from class org.apache.tools.ant.ProjectComponent | 
|---|
| clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject | 
| Methods inherited from class java.lang.Object | 
|---|
| equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected java.io.File jar
protected java.lang.String alias
protected java.lang.String keystore
protected java.lang.String storepass
protected java.lang.String storetype
protected java.lang.String keypass
protected boolean verbose
protected boolean strict
protected java.lang.String maxMemory
protected java.util.Vector<FileSet> filesets
protected static final java.lang.String JARSIGNER_COMMAND
public static final java.lang.String ERROR_NO_SOURCE
| Constructor Detail | 
|---|
public AbstractJarSignerTask()
| Method Detail | 
|---|
public void setMaxmemory(java.lang.String max)
max - a string indicating the maximum memory according to the JVM
            conventions (e.g. 128m is 128 Megabytes)public void setJar(java.io.File jar)
jar - the jar file to signpublic void setAlias(java.lang.String alias)
alias - the alias to sign underpublic void setKeystore(java.lang.String keystore)
keystore - the keystore locationpublic void setStorepass(java.lang.String storepass)
storepass - the password for the keystorepublic void setStoretype(java.lang.String storetype)
storetype - the keystore typepublic void setKeypass(java.lang.String keypass)
keypass - the password for the key (if different)public void setVerbose(boolean verbose)
verbose - if true enable verbose outputpublic void setStrict(boolean strict)
strict - public void addFileset(FileSet set)
set - a set of files to signpublic void addSysproperty(Environment.Variable sysp)
sysp - system property.public Path createPath()
protected void beginExecution()
protected void endExecution()
public RedirectorElement getRedirector()
beginExecution() and endExecution()
public void setExecutable(java.lang.String executable)
jarsigner found in Ant's JDK.
executable - the command to invoke.protected void setCommonOptions(ExecTask cmd)
cmd - command to configure
protected void declareSysProperty(ExecTask cmd,
                                  Environment.Variable property)
                           throws BuildException
cmd - command to configureproperty - property to set
BuildException - if the property is not correctly defined.protected void bindToKeystore(ExecTask cmd)
cmd - command to configureprotected ExecTask createJarSigner()
protected java.util.Vector<FileSet> createUnifiedSources()
protected Path createUnifiedSourcePath()
protected boolean hasResources()
protected void addValue(ExecTask cmd,
                        java.lang.String value)
cmd - command to manipulatevalue - value to add| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||