title: ProcessBuilder and running OpenSSL command which contains spaces
body: <p>I am facing a problem while executing openSSL command using my jar in Ubuntu environemnt.
  I have concluded that this is happening because of the space in the path of the file which is being passed as a parameter in the command e.g. SHA 256 in below command.
  I have used both process and <code>ProcessBuilder</code> classes for executing the same:</p>
  
  <p><strong><em>First</em></strong>:</p>
  
  <pre><code>String certFilePath = "/home/mplusuer/Desktop/Nishant/210515/TestData/TestData/SHA 256/nishant.cer"
  String []cmdGetAlgorithm = new String[3];
  
  cmdGetAlgorithm[0] = "openssl x509 -in";
  cmdGetAlgorithm[1] = certFilePath;
  cmdGetAlgorithm[2] = "-noout -text -certopt no_subject,no_header,no_version,no_serial,no_validity,no_subject,no_issuer,no_pubkey,no_sigdump,no_aux,no_extensions";
  
  ProcessBuilder pb = new ProcessBuilder(cmdGetAlgorithm[0], cmdGetAlgorithm[1],cmdGetAlgorithm[2]);
  // setup other options ...
  
  Process processGetAlgorithm = pb.start();
  processGetAlgorithm.waitFor();
  </code></pre>
  
  <p><strong><em>Second</em></strong>:</p>
  
  <pre><code>Runtime runtime = Runtime.getRuntime();
  String cmdGetAlgorithm = "openssl x509 -in "
          + certFilePAth
          + " -noout -text -certopt no_subject,no_header,no_version,no_serial,no_validity,no_subject,no_issuer,no_pubkey,no_sigdump,no_aux,no_extensions ";
  
  Process processGetAlgorithm = runtime.exec(cmdGetAlgorithm);
  </code></pre>
  
  <p>the final command is as below, which works fine if executed separately on command prompt but fails when executed using java code: </p>
  
  <pre class="lang-none prettyprint-override"><code>openssl x509 -in /home/mplusuer/Desktop/Nishant/210515/TestData/TestData/SHA 256/suketu.cer  \
    -noout -text -certopt no_subject,no_header,no_version,no_serial,no_validity,no_subject, \
     no_issuer,no_pubkey,no_sigdump,no_aux,no_extensions
  </code></pre>
  
  <p>I have used the below methods also for resolving this issue, but nothing worked as per expectation:</p>
  
  <pre><code>String quoted = "\"" + certFilePath + "\"";
  String escaped = certFilePath.replace(" ", "\\ ");
  </code></pre>
  
  <p>Please see to it and help me in resolving the same.</p>