Package org.apache.tools.ant.taskdefs
Class AbstractJarSignerTask
- java.lang.Object
- 
- org.apache.tools.ant.ProjectComponent
- 
- org.apache.tools.ant.Task
- 
- org.apache.tools.ant.taskdefs.AbstractJarSignerTask
 
 
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.lang.StringaliasThe alias of signer.static java.lang.StringERROR_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 signprotected java.io.FilejarThe name of the jar file.protected static java.lang.StringJARSIGNER_COMMANDname of JDK program we are looking forprotected java.lang.Stringkeypasspassword for the key in the storeprotected java.lang.StringkeystoreThe url or path of keystore file.protected java.lang.StringmaxMemoryThe maximum amount of memory to use for Jar signerprotected java.lang.Stringstorepasspassword for the storeprotected java.lang.Stringstoretypetype of store,-storetype paramprotected booleanstrictstrict checkingprotected booleanverboseverbose output- 
Fields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
 
- 
 - 
Constructor SummaryConstructors Constructor Description AbstractJarSignerTask()
 - 
Method SummaryModifier and Type Method Description voidaddArg(Commandline.Argument arg)Adds a nested <arg> element that can be used to specify command line arguments not supported via specific attributes.protected voidaddArgument(ExecTask cmd, Commandline.Argument arg)add an argument to a commandvoidaddFileset(FileSet set)Adds a set of files to signvoidaddSysproperty(Environment.Variable sysp)Add a system property.protected voidaddValue(ExecTask cmd, java.lang.String value)add a value argument to a commandprotected voidbeginExecution()init processing logic; this is retained through our execution(s)protected voidbindToKeystore(ExecTask cmd)bind to a keystore if the attributes are thereprotected ExecTaskcreateJarSigner()create the jarsigner executable taskPathcreatePath()Adds a path of files to sign.protected PathcreateUnifiedSourcePath()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 definedprotected voiddeclareSysProperty(ExecTask cmd, Environment.Variable property)protected voidendExecution()any cleanup logicRedirectorElementgetRedirector()get the redirector.protected booleanhasResources()Has either a path or a fileset been specified?voidsetAlias(java.lang.String alias)the alias to sign under; requiredprotected voidsetCommonOptions(ExecTask cmd)these are options common to signing and verifyingvoidsetExecutable(java.lang.String executable)Sets the actual executable command to invoke, instead of the binaryjarsignerfound in Ant's JDK.voidsetJar(java.io.File jar)the jar file to sign; requiredvoidsetKeypass(java.lang.String keypass)password for private key (if different); optionalvoidsetKeystore(java.lang.String keystore)keystore location; requiredvoidsetMaxmemory(java.lang.String max)Set the maximum memory to be used by the jarsigner processvoidsetProviderArg(java.lang.String providerArg)Sets the value for the -providerArg command line argument.voidsetProviderClass(java.lang.String providerClass)Sets the value for the -providerClass command line argument.voidsetProviderName(java.lang.String providerName)Sets the value for the -providerName command line argument.voidsetStorepass(java.lang.String storepass)password for keystore integrity; requiredvoidsetStoretype(java.lang.String storetype)keystore type; optionalvoidsetStrict(boolean strict)do strict checkingvoidsetVerbose(boolean verbose)Enable verbose output when signing; optional: default false- 
Methods inherited from class org.apache.tools.ant.TaskbindToOwner, 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.ProjectComponentclone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
- 
 
- 
- 
- 
Field Detail- 
ERROR_NO_SOURCEpublic static final java.lang.String ERROR_NO_SOURCE error string for unit test verification: "jar must be set through jar attribute or nested filesets"- See Also:
- Constant Field Values
 
 - 
JARSIGNER_COMMANDprotected static final java.lang.String JARSIGNER_COMMAND name of JDK program we are looking for- See Also:
- Constant Field Values
 
 - 
jarprotected java.io.File jar The name of the jar file.
 - 
aliasprotected java.lang.String alias The alias of signer.
 - 
keystoreprotected java.lang.String keystore The url or path of keystore file.
 - 
storepassprotected java.lang.String storepass password for the store
 - 
storetypeprotected java.lang.String storetype type of store,-storetype param
 - 
keypassprotected java.lang.String keypass password for the key in the store
 - 
verboseprotected boolean verbose verbose output
 - 
strictprotected boolean strict strict checking- Since:
- Ant 1.9.1
 
 - 
maxMemoryprotected java.lang.String maxMemory The maximum amount of memory to use for Jar signer
 - 
filesetsprotected java.util.Vector<FileSet> filesets the filesets of the jars to sign
 
- 
 - 
Method Detail- 
setMaxmemorypublic void setMaxmemory(java.lang.String max) Set the maximum memory to be used by the jarsigner process- Parameters:
- max- a string indicating the maximum memory according to the JVM conventions (e.g. 128m is 128 Megabytes)
 
 - 
setJarpublic void setJar(java.io.File jar) the jar file to sign; required- Parameters:
- jar- the jar file to sign
 
 - 
setAliaspublic void setAlias(java.lang.String alias) the alias to sign under; required- Parameters:
- alias- the alias to sign under
 
 - 
setKeystorepublic void setKeystore(java.lang.String keystore) keystore location; required- Parameters:
- keystore- the keystore location
 
 - 
setStorepasspublic void setStorepass(java.lang.String storepass) password for keystore integrity; required- Parameters:
- storepass- the password for the keystore
 
 - 
setStoretypepublic void setStoretype(java.lang.String storetype) keystore type; optional- Parameters:
- storetype- the keystore type
 
 - 
setKeypasspublic void setKeypass(java.lang.String keypass) password for private key (if different); optional- Parameters:
- keypass- the password for the key (if different)
 
 - 
setVerbosepublic void setVerbose(boolean verbose) Enable verbose output when signing; optional: default false- Parameters:
- verbose- if true enable verbose output
 
 - 
setStrictpublic void setStrict(boolean strict) do strict checking- Parameters:
- strict- boolean
- Since:
- Ant 1.9.1
 
 - 
addFilesetpublic void addFileset(FileSet set) Adds a set of files to sign- Parameters:
- set- a set of files to sign
- Since:
- Ant 1.4
 
 - 
addSyspropertypublic void addSysproperty(Environment.Variable sysp) Add a system property.- Parameters:
- sysp- system property.
 
 - 
createPathpublic Path createPath() Adds a path of files to sign.- Returns:
- a path of files to sign.
- Since:
- Ant 1.7
 
 - 
setProviderNamepublic void setProviderName(java.lang.String providerName) Sets the value for the -providerName command line argument.- Parameters:
- providerName- the value for the -providerName command line argument
- Since:
- Ant 1.10.6
 
 - 
setProviderClasspublic void setProviderClass(java.lang.String providerClass) Sets the value for the -providerClass command line argument.- Parameters:
- providerClass- the value for the -providerClass command line argument
- Since:
- Ant 1.10.6
 
 - 
setProviderArgpublic void setProviderArg(java.lang.String providerArg) Sets the value for the -providerArg command line argument.- Parameters:
- providerArg- the value for the -providerArg command line argument
- Since:
- Ant 1.10.6
 
 - 
addArgpublic void addArg(Commandline.Argument arg) Adds a nested <arg> element that can be used to specify command line arguments not supported via specific attributes.- Parameters:
- arg- the argument to add
- Since:
- Ant 1.10.6
 
 - 
beginExecutionprotected void beginExecution() init processing logic; this is retained through our execution(s)
 - 
endExecutionprotected void endExecution() any cleanup logic
 - 
getRedirectorpublic RedirectorElement getRedirector() get the redirector. Non-null between invocations ofbeginExecution()andendExecution()- Returns:
- a redirector or null
 
 - 
setExecutablepublic void setExecutable(java.lang.String executable) Sets the actual executable command to invoke, instead of the binaryjarsignerfound in Ant's JDK.- Parameters:
- executable- the command to invoke.
- Since:
- Ant 1.8.0
 
 - 
setCommonOptionsprotected void setCommonOptions(ExecTask cmd) these are options common to signing and verifying- Parameters:
- cmd- command to configure
 
 - 
declareSysPropertyprotected void declareSysProperty(ExecTask cmd, Environment.Variable property) throws BuildException - Parameters:
- cmd- command to configure
- property- property to set
- Throws:
- BuildException- if the property is not correctly defined.
 
 - 
bindToKeystoreprotected void bindToKeystore(ExecTask cmd) bind to a keystore if the attributes are there- Parameters:
- cmd- command to configure
 
 - 
createJarSignerprotected ExecTask createJarSigner() create the jarsigner executable task- Returns:
- a task set up with the executable of jarsigner, failonerror=true and bound to our redirector
 
 - 
createUnifiedSourcesprotected java.util.Vector<FileSet> createUnifiedSources() clone our filesets vector, and patch in the jar attribute as a new fileset, if is defined- Returns:
- a vector of FileSet instances
 
 - 
createUnifiedSourcePathprotected 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.- Returns:
- a path that contains all files to sign
- Since:
- Ant 1.7
 
 - 
hasResourcesprotected boolean hasResources() Has either a path or a fileset been specified?- Returns:
- true if a path or fileset has been specified.
- Since:
- Ant 1.7
 
 - 
addValueprotected void addValue(ExecTask cmd, java.lang.String value) add a value argument to a command- Parameters:
- cmd- command to manipulate
- value- value to add
 
 - 
addArgumentprotected void addArgument(ExecTask cmd, Commandline.Argument arg) add an argument to a command- Parameters:
- cmd- command to manipulate
- arg- argument to add
 
 
- 
 
-