integration-tests/src/test/java/oracle/kubernetes/operator/utils/TestUtils.java
public static void buildZipArchive(
      String zipPath, String srcDir) {

    try {
      StringBuffer cmd = new StringBuffer();
      cmd
          .append("cd ")
          .append(srcDir)
          .append(" ; zip -r ")
          .append(zipPath)
          .append(" . ")
      ;
      LoggerHelper.getLocal().log(Level.INFO, "Command to call build a zip file " + cmd);
      ExecResult result = ExecCommand.exec(cmd.toString());
      if (result.exitValue() != 0) {
        throw new RuntimeException(
            "FAILURE: command " + cmd + " failed, returned " + result.stderr());
      }
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
/**
   * Build a zip archive.  The archive will only include the directory structure below the srcDir.
   *
   * @param zipPath zip file path for resulting archive
   * @param srcDir  source directory
   */
Build a zip archive.  The archive will only include the directory structure below the srcDir.
@param zipPath zip file path for resulting archive
@param srcDir  source directory
Build a zip archive . The archive will only include the directory structure below the srcDir . @param zipPath zip file path for resulting archive @param srcDir source directory
public static void buildZipArchive(
      String zipPath, String srcDir) {
    try {
      StringBuffer cmd = new StringBuffer();
      cmd
          .append("cd ")
          .append(srcDir)
          .append(" ; zip -r ")
          .append(zipPath)
          .append(" . ")
      ;
      LoggerHelper.getLocal().log(Level.INFO, "Command to call build a zip file " + cmd);
      ExecResult result = ExecCommand.exec(cmd.toString());
      if (result.exitValue() != 0) {
        throw new RuntimeException(
            "FAILURE: command " + cmd + " failed, returned " + result.stderr());
      }
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
public static void buildZipArchive ( String zipPath , String srcDir ) { try { StringBuffer cmd = new StringBuffer ( ) ; cmd . append ( "cd " ) . append ( srcDir ) . append ( " ; zip -r " ) . append ( zipPath ) . append ( " . " ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "Command to call build a zip file " + cmd ) ; ExecResult result = ExecCommand . exec ( cmd . toString ( ) ) ; if ( result . exitValue ( ) != 0 ) { throw new RuntimeException ( "FAILURE: command " + cmd + " failed, returned " + result . stderr ( ) ) ; } } catch ( Exception e ) { throw new RuntimeException ( e ) ; } }
Build a zip archive.
Build a zip archive .