home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / VCAFE.3.0A / Main.bin / Sun1_1Signing.java < prev    next >
Text File  |  1998-10-14  |  2KB  |  72 lines

  1. package com.symantec.itools.tools.archive;
  2.  
  3.  
  4. import java.io.File;
  5. import java.io.IOException;
  6. import com.symantec.itools.io.FileSystem;
  7. import com.symantec.itools.lang.Debug;
  8. import com.symantec.itools.lang.ProcessManager;
  9.  
  10.  
  11. /**
  12.  * @author Symantec Internet Tools Division
  13.  * @version 1.0
  14.  * @since VCafe 3.0
  15.  */
  16.  
  17. public class Sun1_1Signing
  18.     extends SunSigning
  19. {
  20.     /**
  21.      * @since VCafe 3.0
  22.      */
  23.     protected ProcessManager processManager;
  24.  
  25.     public Sun1_1Signing(Options options)
  26.     {
  27.         super(options);
  28.     }
  29.  
  30.     /**
  31.      * @param errorMsg TODO
  32.      * @since VCafe 3.0
  33.      */
  34.  
  35.     public boolean sign(StringBuffer errorMsg)
  36.     {
  37.         StringBuffer command;
  38.  
  39.         command = new StringBuffer(FileSystem.quoteIfNeeded(FileSystem.getCanonicalPath(options.getSunTools(), true) + "javakey.exe"));
  40.         command.append(' ').append(options.getSignerArgs());
  41.  
  42.         try
  43.         {
  44.             processManager = new ProcessManager();
  45.             
  46.             if(processManager.monitorLaunchedProcess(Runtime.getRuntime().exec(command.toString())) != 0)
  47.             {
  48.                 return (false);
  49.             }
  50.         }
  51.         catch(IOException ex)
  52.         {
  53.             Debug.logException(ex);
  54.             return (false);
  55.         }
  56.  
  57.         return (true);
  58.     }
  59.  
  60.     /**
  61.      * @since VCafe 3.0
  62.      */
  63.  
  64.     public void cancel()
  65.     {
  66.         if(processManager != null)
  67.         {
  68.             processManager.destroyProcess();
  69.             processManager = null;
  70.         }
  71.     }
  72. }