Top Description Inners Fields Constructors Methods
org.apache.tools.ant.taskdefs

public Class VerifyJar

extends AbstractJarSignerTask
Class Inheritance
Imports
java.io.File, .IOException, .Reader, org.apache.tools.ant.BuildException, .Project, org.apache.tools.ant.filters.ChainableReader, org.apache.tools.ant.types.FilterChain, .Path, .RedirectorElement, .Resource, org.apache.tools.ant.types.resources.FileProvider

JAR verification task. For every JAR passed in, we fork jarsigner to verify that it is correctly signed. This is more rigorous than just checking for the existence of a signature; the entire certification chain is tested
Since
Ant 1.7

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
VerifyJar.BufferingOutputFilter

we are not thread safe here.

private static class
VerifyJar.BufferingOutputFilterReader

catch the output of the buffer

Field Summary

Modifier and TypeField and Description
private boolean
certificates

certification flag

public static final String
ERROR_NO_FILE

no file message Not found :

public static final String
ERROR_NO_VERIFY

Error output if there is a failure to verify the jar.

private VerifyJar.BufferingOutputFilter
private String
private static final String
VERIFIED_TEXT

The string we look for in the text to indicate direct verification

Inherited from org.apache.tools.ant.taskdefs.AbstractJarSignerTask:
aliasERROR_NO_SOURCEfilesetsjarJARSIGNER_COMMANDkeypasskeystoremaxMemorystorepassstoretypestrictverbose

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
beginExecution()

Overrides org.apache.tools.ant.taskdefs.AbstractJarSignerTask.beginExecution.

init processing logic; this is retained through our execution(s)
protected void
public void
execute()

Overrides org.apache.tools.ant.Task.execute.

verify our jar files
public void
setCertificates(boolean
if true print certificates.
certificates
)

Ask for certificate information to be printed

private void
verifyOneJar(File
the jar to verify.
jar
)

verify a JAR.

Inherited from org.apache.tools.ant.taskdefs.AbstractJarSignerTask:
addArgaddArgumentaddFilesetaddSyspropertyaddValuebindToKeystorecreateJarSignercreatePathcreateUnifiedSourcePathcreateUnifiedSourcesdeclareSysPropertygetRedirectorhasResourcessetAliassetCommonOptionssetExecutablesetJarsetKeypasssetKeystoresetMaxmemorysetProviderArgsetProviderClasssetProviderNamesetStorepasssetStoretypesetStrictsetVerbose

Field Detail

certificatesback to summary
private boolean certificates

certification flag

ERROR_NO_FILEback to summary
public static final String ERROR_NO_FILE

no file message Not found :

ERROR_NO_VERIFYback to summary
public static final String ERROR_NO_VERIFY

Error output if there is a failure to verify the jar.

outputCacheback to summary
private VerifyJar.BufferingOutputFilter outputCache
savedStorePassback to summary
private String savedStorePass
VERIFIED_TEXTback to summary
private static final String VERIFIED_TEXT

The string we look for in the text to indicate direct verification

Constructor Detail

VerifyJarback to summary
public VerifyJar()

Method Detail

beginExecutionback to summary
protected void beginExecution()

Overrides org.apache.tools.ant.taskdefs.AbstractJarSignerTask.beginExecution.

Doc from org.apache.tools.ant.taskdefs.AbstractJarSignerTask.beginExecution.

init processing logic; this is retained through our execution(s)

Annotations
@Override
Since
1.10.3
endExecutionback to summary
protected void endExecution()

Overrides org.apache.tools.ant.taskdefs.AbstractJarSignerTask.endExecution.

Doc from org.apache.tools.ant.taskdefs.AbstractJarSignerTask.endExecution.

any cleanup logic

Annotations
@Override
Since
1.10.3
executeback to summary
public void execute() throws BuildException

Overrides org.apache.tools.ant.Task.execute.

verify our jar files

Annotations
@Override
Exceptions
BuildException:
on error.
setCertificatesback to summary
public void setCertificates(boolean certificates)

Ask for certificate information to be printed

Parameters
certificates:boolean

if true print certificates.

verifyOneJarback to summary
private void verifyOneJar(File jar)

verify a JAR.

Parameters
jar:File

the jar to verify.

Exceptions
BuildException:
if the file could not be verified
org.apache.tools.ant.taskdefs back to summary

private Class VerifyJar.BufferingOutputFilter

extends Object
implements ChainableReader
Class Inheritance
  • java.lang.Object
  • org.apache.tools.ant.taskdefs.VerifyJar.BufferingOutputFilter
All Implemented Interfaces
org.apache.tools.ant.filters.ChainableReader

we are not thread safe here. Do not use on multiple threads at the same time.

Field Summary

Modifier and TypeField and Description
private VerifyJar.BufferingOutputFilterReader

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Reader
chain(Reader
the reader which the returned reader should be filtering
rdr
)

Implements org.apache.tools.ant.filters.ChainableReader.chain.

Returns a reader with the same configuration as this one, but filtering input from the specified reader.
public void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

bufferback to summary
private VerifyJar.BufferingOutputFilterReader buffer

Constructor Detail

BufferingOutputFilterback to summary
private BufferingOutputFilter()

Method Detail

chainback to summary
public Reader chain(Reader rdr)

Implements org.apache.tools.ant.filters.ChainableReader.chain.

Doc from org.apache.tools.ant.filters.ChainableReader.chain.

Returns a reader with the same configuration as this one, but filtering input from the specified reader.

Parameters
rdr:Reader

the reader which the returned reader should be filtering

Returns:Reader

a reader with the same configuration as this one, but filtering input from the specified reader

Annotations
@Override
clearback to summary
public void clear()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override
org.apache.tools.ant.taskdefs back to summary

private Class VerifyJar.BufferingOutputFilterReader

extends Reader
Class Inheritance

catch the output of the buffer

Field Summary

Modifier and TypeField and Description
private StringBuffer
private Reader
Inherited from java.io.Reader:
lock

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
close()

Implements abstract java.io.Reader.close.

Implements java.io.Closeable.close.

Closes the stream and releases any system resources associated with it.
public int
read(char[]
Destination buffer
cbuf
,
int
Offset at which to start storing characters
off
,
int
Maximum number of characters to read
len
)

Implements abstract java.io.Reader.read.

Reads characters into a portion of an array.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.io.Reader:
markmarkSupportednullReaderreadreadreadreadyresetskiptransferTo

Field Detail

bufferback to summary
private StringBuffer buffer
nextback to summary
private Reader next

Constructor Detail

BufferingOutputFilterReaderback to summary
public BufferingOutputFilterReader(Reader next)

Method Detail

clearback to summary
public void clear()
closeback to summary
public void close() throws IOException

Implements abstract java.io.Reader.close.

Implements java.io.Closeable.close.

Doc from java.io.Reader.close.

Closes the stream and releases any system resources associated with it. Once the stream has been closed, further read(), ready(), mark(), reset(), or skip() invocations will throw an IOException. Closing a previously closed stream has no effect.

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs
readback to summary
public int read(char[] cbuf, int off, int len) throws IOException

Implements abstract java.io.Reader.read.

Doc from java.io.Reader.read.

Reads characters into a portion of an array. This method will block until some input is available, an I/O error occurs, or the end of the stream is reached.

If len is zero, then no characters are read and 0 is returned; otherwise, there is an attempt to read at least one character. If no character is available because the stream is at its end, the value -1 is returned; otherwise, at least one character is read and stored into cbuf.

Parameters
cbuf:char[]

Destination buffer

off:int

Offset at which to start storing characters

len:int

Maximum number of characters to read

Returns:int

The number of characters read, or -1 if the end of the stream has been reached

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override