Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to encrypt file on linux using Gnupg command in Java Embedding in BPEL.

ShahNov 12 2013 — edited Feb 26 2020

Hi All,

I am trying to invoke a command script using the java embedding in BPEL Process.I am using the below code to execute the particular command to encrypt the file :-

try {    

        Runtime rt = Runtime.getRuntime();    

     

Process pr = rt.exec(new String[] {"/bin/bash", "-c", "/u01/GnuPG/bin/gpg", "-e", "-r", "Developer","/u01/oracle/ConfigFiles/Adapter_controlDir/abc.csv"});    

         int exitVal = pr.waitFor();            

        String result = "SUCCESS: Process exit with " + exitVal;         

        addAuditTrailEntry("result = "+result);      

        setVariableData("outputVariable","payload","/client:processResponse/client:result",result);    

     

} catch(Exception e) {    

   

        e.printStackTrace();      

  String result = "FAILURE: Exception with " + e.toString();    

        addAuditTrailEntry("result = "+result);      

        setVariableData("outputVariable","payload","/client:processResponse/client:result",result);    

           

}

The above statement does nothing. I am not sure what command i need to use to access to the command line.

When i try this particular statement from linux machine command prompt :- /u01/GnuPG/bin/gpg -e  -r  Developer /u01/oracle/ConfigFiles/Adapter_controlDir/abc.csv

It works absolutely fine and it creates the encrypted files also.

Please suggest , which command i need to use from the java embedding.

Please suggest!!

Regards,

Shah

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 11 2013
Added on Nov 12 2013
2 comments
580 views