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

public Class IsSigned

extends DataType
implements Condition
Class Inheritance
All Implemented Interfaces
org.apache.tools.ant.taskdefs.condition.Condition
Imports
java.io.File, .IOException, org.apache.tools.ant.BuildException, .Project, org.apache.tools.ant.taskdefs.ManifestTask, org.apache.tools.ant.types.DataType, org.apache.tools.ant.util.StreamUtils, org.apache.tools.zip.ZipFile

Checks whether a jarfile is signed: if the name of the signature is passed, the file is checked for presence of that particular signature; otherwise the file is checked for the existence of any signature.

Field Summary

Modifier and TypeField and Description
private File
private String
private static final int
private static final String
private static final String
Inherited from org.apache.tools.ant.types.DataType:
checkedref

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the file is signed.
eval
()

Implements org.apache.tools.ant.taskdefs.condition.Condition.eval.

Returns true if the file exists and is signed with the signature specified, or, if name wasn't specified, if the file contains a signature.
public static boolean

Returns:

true if the file is signed.
isSigned
(File
the zipfile to check
zipFile
,
String
the signature to check (may be killed)
name
)

Returns true if the file exists and is signed with the signature specified, or, if name wasn't specified, if the file contains a signature.

private static String
public void
setFile(File
jarfile to be tested.
file
)

The jarfile that is to be tested for the presence of a signature.

public void
setName(String
signature to look for.
name
)

The signature name to check jarfile for.

Inherited from org.apache.tools.ant.types.DataType:
checkAttributesAllowedcheckChildrenAllowedcircularReferenceclonedieOnCircularReferencedieOnCircularReferencedieOnCircularReferencegetCheckedRefgetCheckedRefgetCheckedRefgetCheckedRefgetCheckedRefgetDataTypeNamegetRefidinvokeCircularReferenceCheckisCheckedisReferencenoChildrenAllowedpushAndInvokeCircularReferenceChecksetCheckedsetRefidtooManyAttributestoString

Field Detail

fileback to summary
private File file
nameback to summary
private String name
SHORT_SIG_LIMITback to summary
private static final int SHORT_SIG_LIMIT
SIG_ENDback to summary
private static final String SIG_END
SIG_STARTback to summary
private static final String SIG_START

Constructor Detail

IsSignedback to summary
public IsSigned()

Method Detail

evalback to summary
public boolean eval()

Implements org.apache.tools.ant.taskdefs.condition.Condition.eval.

Returns true if the file exists and is signed with the signature specified, or, if name wasn't specified, if the file contains a signature.

Returns:boolean

true if the file is signed.

Annotations
@Override
isSignedback to summary
public static boolean isSigned(File zipFile, String name) throws IOException

Returns true if the file exists and is signed with the signature specified, or, if name wasn't specified, if the file contains a signature.

Parameters
zipFile:File

the zipfile to check

name:String

the signature to check (may be killed)

Returns:boolean

true if the file is signed.

Exceptions
IOException:
on error
replaceInvalidCharsback to summary
private static String replaceInvalidChars(final String name)
setFileback to summary
public void setFile(File file)

The jarfile that is to be tested for the presence of a signature.

Parameters
file:File

jarfile to be tested.

setNameback to summary
public void setName(String name)

The signature name to check jarfile for.

Parameters
name:String

signature to look for.