You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by pe...@apache.org on 2004/12/01 15:39:07 UTC

cvs commit: ant/src/main/org/apache/tools/ant/taskdefs SignJar.java

peterreilly    2004/12/01 06:39:07

  Modified:    src/main/org/apache/tools/ant/taskdefs SignJar.java
  Log:
  stylecheck
  
  Revision  Changes    Path
  1.42      +24 -5     ant/src/main/org/apache/tools/ant/taskdefs/SignJar.java
  
  Index: SignJar.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/SignJar.java,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- SignJar.java	26 Nov 2004 10:07:59 -0000	1.41
  +++ SignJar.java	1 Dec 2004 14:39:07 -0000	1.42
  @@ -18,10 +18,7 @@
   
   import java.io.File;
   import java.io.IOException;
  -import java.util.Enumeration;
   import java.util.Vector;
  -import java.util.zip.ZipEntry;
  -import java.util.zip.ZipFile;
   import org.apache.tools.ant.BuildException;
   import org.apache.tools.ant.DirectoryScanner;
   import org.apache.tools.ant.Project;
  @@ -95,6 +92,7 @@
   
       /**
        * the jar file to sign; required
  +     * @param jar the jar file to sign
        */
       public void setJar(final File jar) {
           this.jar = jar;
  @@ -102,6 +100,7 @@
   
       /**
        * the alias to sign under; required
  +     * @param alias the alias to sign under
        */
       public void setAlias(final String alias) {
           this.alias = alias;
  @@ -109,6 +108,7 @@
   
       /**
        * keystore location; required
  +     * @param keystore the keystore location
        */
       public void setKeystore(final String keystore) {
           this.keystore = keystore;
  @@ -116,6 +116,7 @@
   
       /**
        * password for keystore integrity; required
  +     * @param storepass the password for the keystore
        */
       public void setStorepass(final String storepass) {
           this.storepass = storepass;
  @@ -123,6 +124,7 @@
   
       /**
        * keystore type; optional
  +     * @param storetype the keystore type
        */
       public void setStoretype(final String storetype) {
           this.storetype = storetype;
  @@ -130,6 +132,7 @@
   
       /**
        * password for private key (if different); optional
  +     * @param keypass the password for the key (if different)
        */
       public void setKeypass(final String keypass) {
           this.keypass = keypass;
  @@ -137,6 +140,7 @@
   
       /**
        * name of .SF/.DSA file; optional
  +     * @param sigfile the name of the .SF/.DSA file
        */
       public void setSigfile(final String sigfile) {
           this.sigfile = sigfile;
  @@ -144,6 +148,7 @@
   
       /**
        * name of signed JAR file; optional
  +     * @param signedjar the name of the signed jar file
        */
       public void setSignedjar(final File signedjar) {
           this.signedjar = signedjar;
  @@ -152,6 +157,7 @@
       /**
        * Enable verbose output when signing
        * ; optional: default false
  +     * @param verbose if true enable verbose output
        */
       public void setVerbose(final boolean verbose) {
           this.verbose = verbose;
  @@ -160,6 +166,7 @@
       /**
        * Flag to include the .SF file inside the signature;
        * optional; default false
  +     * @param internalsf if true include the .SF file inside the signature
        */
       public void setInternalsf(final boolean internalsf) {
           this.internalsf = internalsf;
  @@ -168,6 +175,7 @@
       /**
        * flag to compute hash of entire manifest;
        * optional, default false
  +     * @param sectionsonly flag to compute hash of entire manifest
        */
       public void setSectionsonly(final boolean sectionsonly) {
           this.sectionsonly = sectionsonly;
  @@ -177,6 +185,7 @@
        * flag to control whether the presence of a signature
        * file means a JAR is signed;
        * optional, default false
  +     * @param lazy flag to control whether the presence of a signature
        */
       public void setLazy(final boolean lazy) {
           this.lazy = lazy;
  @@ -185,6 +194,7 @@
       /**
        * Adds a set of files to sign
        * @since Ant 1.4
  +     * @param set a set of files to sign
        */
       public void addFileset(final FileSet set) {
           filesets.addElement(set);
  @@ -193,6 +203,7 @@
   
       /**
        * sign the jar(s)
  +     * @throws BuildException on errors
        */
       public void execute() throws BuildException {
           if (null == jar && filesets.size() == 0) {
  @@ -315,6 +326,15 @@
           }
       }
   
  +    /**
  +     * Compare a jar file with its corresponding signed jar
  +     *
  +     * @param jarFile  the unsigned jar file
  +     * @param signedjarFile the result signed jar file
  +     * @return true if the signedjarfile is newer than the jar file
  +     *         false if the signedjarfile is the same as the jarfile or if
  +     *         jarfile or the signedjar does not exist.
  +     */
       protected boolean isUpToDate(File jarFile, File signedjarFile) {
           if (null == jarFile) {
               return false;
  @@ -346,7 +366,7 @@
       /**
        * test for a file being signed, by looking for a signature in the META-INF
        * directory
  -     * @param file
  +     * @param file the file to be checked
        * @return true if the file is signed
        */
       protected boolean isSigned(File file) {
  @@ -366,4 +386,3 @@
           this.preserveLastModified = preserveLastModified;
       }
   }
  -
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org