home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / VCAFE.3.0A / Main.bin / NetscapeSigning.java < prev    next >
Text File  |  1998-10-16  |  2KB  |  74 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 NetscapeSigning
  18.     extends TypeSigning
  19. {
  20.  
  21.     /**
  22.      * @since VCafe 3.0
  23.      */
  24.     protected ProcessManager processManager;
  25.  
  26.     public NetscapeSigning(Options options)
  27.     {
  28.         super(options);
  29.     }
  30.  
  31.     /**
  32.      * @param errorMsg TODO
  33.      * @since VCafe 3.0
  34.      */
  35.  
  36.     public boolean sign(StringBuffer errorMsg)
  37.     {
  38.         StringBuffer command;
  39.  
  40.         command = new StringBuffer();
  41. //        command = new StringBuffer(FileSystem.quoteIfNeeded(FileSystem.getCanonicalPath(options.getNetscapeTools(), true) + "signtool.exe"));
  42.         command.append(FileSystem.quoteIfNeeded(options.getOutputLocation()));
  43.  
  44.         try
  45.         {
  46.             processManager = new ProcessManager();
  47.  
  48.             if(processManager.monitorLaunchedProcess(Runtime.getRuntime().exec(command.toString())) != 0)
  49.             {
  50.                 return (false);
  51.             }
  52.         }
  53.         catch(IOException ex)
  54.         {
  55.             Debug.logException(ex);
  56.             return (false);
  57.         }
  58.  
  59.         return (true);
  60.     }
  61.  
  62.     /**
  63.      * @since VCafe 3.0
  64.      */
  65.  
  66.     public void cancel()
  67.     {
  68.         if(processManager != null)
  69.         {
  70.             processManager.destroyProcess();
  71.             processManager = null;
  72.         }
  73.     }
  74. }