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

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

I think, you can try, writing these commands into a separate shell script and call that shell script from bpel via Java embedding. However, you might not get a return response.. but you can still give a shot.
Hope it helps.

Similar Messages

  • Open a PDF file in linux using java

    Hi..
    How can I open a PDF file in linux using java.
    I am able to open PDF in windows and mac using this code
    in Windows
    Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + path_of_PDF);
    in mac
    Runtime.getRuntime().exec("open " + path_of_PDF);
    But nothing is working with linux.
    Please help
    Thanks

    One thread is enough:
    http://forum.java.sun.com/thread.jspa?threadID=5267458

  • Open PDF file in linux using java

    Hi..
    How can I open a PDF file in linux using java.
    I am able to open PDF in windows and mac using this code
    in Windows
    Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + path_of_PDF);
    in mac
    Runtime.getRuntime().exec("open " + path_of_PDF);
    But nothing is working with linux.
    Please help
    Thanks

    appi wrote:
    Hi.. I found the JDIC binary files. There are different binaries for all the plateform. Is there any solution which is independent of plateform.Yes, and we already told you: Use JDK6, which has those libraries built into the standard class library.
    How can I use these binaries in my existing project. does it work, If I place them at same place where other .class files are kept.Read the documentation of the JDIC project. I'm sure they answer this question in their FAQ.

  • Convert .fmb and .rdf files to .txt using unix commands

    I want to know how to convert .fmb and .rdf files to .txt using unix commands
    Example ACCT_ACCOUNTS_ADMIN.fmb ---> ACCT_ACCOUNTS_ADMIN.txt
    agent_balances.rdf ---> agent_balances.txt
    NOTE: i don't want to use form builder or report builder.
    is there anyone who can help me
    Regards
    Harsh

    Thanks it helped and Just to add little bit on it
    for i in `ls *.fmb`
    do
    f60gen module=$i userid=$unpw forms_doc=yes batch=yes
    done
    Might help someone too.
    Thanks

  • How to get Systemstate Backup size using PowerShell command in Windows 2008 R2

    Hi,
    We using WBSummary command to get completed backup status.
    I need to find how much data is backed up  using powerShell command .
    Is there any way to get the details , i can see the GUI but no in command.
    Please advise
    Regards Gopi K

    Hi,
    You mentioned that you can see the system state backup size in the GUI. Does the backup size mean the amount of date transferred?
    It seems that there is no such a PowerShell to get Systemstate Backup size. You may need to you need a PowerShell scripts to do this work.
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=ITCG
    Regards,
    Mandy
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • How to load the boot menu using the command line , after the configuration change ?

    how to load the boot menu using the command line , after the configuration change ?

    Hi @Bask-48 
    Welcome to the HP Forums!
    It is a terrific place to find answers.
    For you to have the best experience in the HP forum I would like to direct your attention to the HP Forums Guide Learn How to Post and More
    I grasp you are trying to change the boot order.  Here is a link to Configuring the Boot Order in the System BIOS
    that will assist you.
    Good Luck and Happy Holidays!
    Sparkles1
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the bottom right to say “Thanks” for helping!

  • How to verify ISAKMP Aggressive mode using show command only?

    How to verify ISAKMP Aggressive mode using show command only?

    Ah OK, my mistake. I was thinking ASA - I believe you are using an IOS-based VPN.
    The state after establishment should be "QM Idle" (quick mode) - whether the Phase 1 was MM or AM.
    I think you'll only see the AM in the debugs (like you have) or if you watch the output of the "show cry isa sa" command during establishment of the Phase 1 SA. If you're quick, you may see it cycle through as shown in this reference:
    http://www.cisco.com/c/en/us/td/docs/ios-xml/ios/security/s1/sec-s1-cr-book/sec-cr-s3.html#wp5743341910

  • Add & use custom jars in "Java embedding" component

    I need to generate pdf file in process.
    So I included "Java embedding" component, and write my code. For clarity example:
    com.itextpdf.text.Document document = new com.itextpdf.text.Document( 
                        com.itextpdf.text.PageSize.A4, 50, 50, 50, 50); 
              try { 
                   com.itextpdf.text.pdf.PdfWriter pdf = com.itextpdf.text.pdf.PdfWriter 
                             .getInstance(document, new java.io.FileOutputStream("c:\\text.pdf")); 
                   document.open(); 
                   document.add(new com.itextpdf.text.Paragraph("This is test message")); 
                   catch (com.itextpdf.text.DocumentException de) { System.err.println(de.getMessage());  }
                   catch (Exception de) { System.err.println(de.getMessage());}
              document.close();Im using external jar file, of course I add it to classpath (right click soa project -> properties -> libraries and classpath ->add jar).
    But I get folowing error (no during compilation, but during deploying):
    Failed to compile bpel generated classes.
    failure to compile the generated BPEL classes for BPEL process "SimpleProcess" of composite "default/SOAProject!1.0*soa_9f8e80a4-346d-424e-9e12-1b69e2024e58"
    The class path setting is incorrect.
    Ensure that the class path is set correctly. If this happens on the server side, verify that the custom classes or jars which this BPEL process is depending on are deployed correctly. Also verify that the run time is using the same release/version.
    [04:35:23 PM] Check server log for more details.
    [04:35:23 PM] Error deploying archive sca_SOAProject_rev1.0.jar to soa_server1 [[fe80:0:0:0:5968:cb45:2001:f6ce]:8001] 
    [04:35:23 PM] ####  Deployment incomplete.  ####
    [04:35:23 PM] Error deploying archive file:/C:/Projects/SOAProject/deploy/sca_SOAProject_rev1.0.jar
    (oracle.tip.tools.ide.fabric.deploy.common.SOARemoteDeployer)where ist the problem???
    Edited by: user1175491 on Nov 2, 2010 4:39 PM

    Ajaykumar, can u please write me what exactly append to bpel:exec part (which classes include?)? it looks now:
    <bpelx:exec name="GeneratePDF" version="1.5" language="java">
    <![CDATA[
                  com.itextpdf.text.Document document = new com.itextpdf.text.Document(  
                        com.itextpdf.text.PageSize.A4, 50, 50, 50, 50);  
              try {  
                   com.itextpdf.text.pdf.PdfWriter pdf = com.itextpdf.text.pdf.PdfWriter  
                             .getInstance(document, new java.io.FileOutputStream("c:\\text.pdf"));  
                   document.open();  
                   document.add(new com.itextpdf.text.Paragraph("This is test message"));  
                   catch (com.itextpdf.text.DocumentException de) {System.err.println(de.getMessage());}
                   catch (java.lang.Exception de) {System.err.println(de.getMessage());}  
              document.close();]]>
    </bpelx:exec>Edited by: user1175491 on Nov 2, 2010 5:07 PM
    Edited by: user1175491 on Nov 2, 2010 5:08 PM

  • Advantage of using Spring Context over Java Embedding

    Hi ,
    Is there any advantage of using Spring Context over Java Embedding?
    --Steve                                                                                                                                                                               

    Hi All,
    Anybody can answer my question?
    --steve                                                                                                                                                                                                           

  • How to encrypt files

    Hi,
    My requirement is like...
    I have encrypt and store files in the db. We know that files are stored in some binary format in the db. But then, I dont want anyone who knows how to read blobs from db to read those files without my knowledge. Please let me know what kind of encryption I can make use of?
    Can I read a standard set of content from file. i.e. Read the first 1024 bytes, encrypt that and store it somewhere. Then read the next 1024 bytes, store it. And to retrieve in the same fashion as how stored earlier, and decrypt the content.
    This is the crude logic that I have in mind. If anyone could suggest me any other better approach, that will be helpful for me.
    Thanks in advance

    I have seen several posts to these forums regarding encrypting pieces of databases, and the trouble always occurs when the poster tries to figure out key management.
    Java makes encryption easy -- its just a few lines of code. The hard part is key management -- how do I generate an encryption key, arrange so that it is always available to the proper entities when needed, and that is never available to the entities that shouldn't have it.
    The correct answers to these questions depends on many factors specific to your problem context, and on whether you want "real" security or merely to deter the lazy snoop.

  • How to save file in km using web dynpro abap

    Hi Experts,
    We have a requirement that file should be saved in a folder in km, the name of the folder should be the employee number.
    Could you please tell me how to create folder with employee number in KM and store file in it using web dynpro abap.
    Thanks and Regards,
    Santhoshi.

    Thanks Naga Raju Meesala.
    How come all these methods are deprecated...getEP5User
    Also, since I am building a weddynpro DC, what is the proper way to include these jar files as Used DCs?
    Now proceed in the same way with the variable PORTAL_HOME and add the following .jar files:
    u2022 \lib\prtapi.jar The portal runtime APIs
    u2022 \portalapps\com.sap.portal.usermanagement\lib\com.sap.security.api.ep5.jar The user management APIs of the Enterprise Portal 5.0 are deprecated, but still in use in SAP NetWeaver 04
    u2022 \portalapps\com.sap.netweaver.bc.rf\lib\bc.rf.framework_api.jar KM Repository Framework APIs
    u2022 \portalapps\com.sap.netweaver.bc.rf.service\lib\bc.rf.global.service.urlgenerator_api.jar Repository Framework Utility: URL Generator
    u2022 \portalapps\com.sap.netweaver.bc.sf\lib\bc.sf.framework_api.jar Repository Framework: Repository Services
    u2022 \portalapps\com.sap.netweaver.bc.util\lib\bc.util.public_api.jar Repository Framework Utilities

  • How to encrypt a voice input using a symmetric key to be sent in a network?

    Hi all, i have retrieve voice input through a micro phone and stored it as byte packet used "*conman sound class*" to be sent on a network. The problem is that, "HOW TO ENCRYPT AND DECRYPT THIS *BYTE* OF DATA USING A SYMMETRIC KEY ALGORITHM". It will be helpful if related code is posted.
    with regards
    Marshall

    If you are calling the BDC in a program, create a job to run the program and specify the user you want each program to run under.

  • How to view file from vss using java Commandline

    Hi To ALL,
    I wanted to view a file from vss through java code.
    By using the folowing code,i could able to get vss file in to local folder.
    Runtime.getRuntime().exec
    ("cmd /c ss Get $/Mywork/Myfile.java -GLC:/New");
    But i wanted to view file from vss using java code.
    any one please help me..
    Thanks in advance.........

    As always, Google is your friend.
    Follow the bouncing link.
    http://www.google.com/search?hl=en&q=VisualSourceSafe+%2B+Java+API
    PS.

  • How to use 'bash' command in java?

    Hi,
    I am using Linux operating system
    when i run the following code, 'test.sh' not started
    ================================================================
    String cmd = "bash \"/home/kulandaivelu/Desktop/works/other's works/test.sh\"";
    Runtime.getRuntime().exec(cmd).waitFor();
    ================================================================
    but it started when i use same command(bash "/home/kulandaivelu/Desktop/works/other's works/test.sh") in terminal
    anyone let me know what mistake i made in the code piece..
    Thanks in Advance
    Kulandaivelu

    Hi,
    thanks a lot..
    I used the following code.. it worked well..
    ===============================================================
    String cmd[] = {"bash","/home/kulandaivelu/Desktop/works other's/test.sh"};
    Runtime.getRuntime().exec(cmd).waitFor();
    ===============================================================
    Thanks a lot again..

  • How do we refer Sub directories using UTL_FILE command

    Hi Gurus,
    I have created a DIRECTORY My_project using CREATE DIRECTORY COMMAND. This directory is linked to my OS D:\My_project folder.
    There are several sub directories under My_project folder such as D:\My_project\Outfile folder which I would like to refer while using UTL_FILE command to process files.
    When I try to run the following PLSQL
    DECLARE
    out_file utl_file.file_type;
    l_line VARCHAR2(100);
    BEGIN
    out_file :=UTL_FILE.FOPEN('My_project\Outfile','abc.txt','w');
    l_line := 'HELLO TESTING';
    utl_file.put_line(out_file,l_line);
    UTL_FILE.FCLOSE(out_file);
    EXCEPTION
    WHEN no_data_found then
    UTL_FILE.FCLOSE(out_file);
    when others then
    raise_application_error(-20912, 'Others ' ||sqlerrm);
    END;
    I get
    ORA-29280: invalid directory path
    error.
    As there are many directories involved under My_project folder and there will be new directories created in the future as well, so I was wondering if there is a way to read files from any sub directory of My_project directory
    Please advise. Thanks for all your help.

    Hi Anto!
    Try it like this:
    out_file :=UTL_FILE.FOPEN('My_project','Outfile\abc.txt','w');I hope this helps!
    your sincerely
    Florian W.

Maybe you are looking for

  • WIN 7 OEM license upgrade to WIN 8.1 Pro volume license

    Attempting to upgrade an OEM license of WIN 7 on a Viewsonic ViewPad 10pi to WIN 8.1 Pro actionpack license. Does not accept the product Key. Would prefer to do an upgrade due to multi-os - Win/Android tablet. How do I get past the license acceptance

  • Photoshop CS6 error "Could not complete your request because of a program error."

    I got this error today.  I am on PS CS6 version 13.0.06 x64.  Running on Mac OS X version 10.9. Installed the new Maverick on November 10 and not sure if that has anything to do with this. In PS I get the error above when I go to File/Open and look f

  • Parent-child hierarcy - row level security

    Hi, Im using OBI 11.1.1.5 and have a problem about row-level security in parent-child dimension. I have created a parent-child dimension, simlar to: a1 --a1.1 ----a1.1.1 ----a1.1.2 --a1.2 ----a1.2.1 By using a session variable 'SESVAR1', I want to re

  • How to read a file line by line in UTL

    Hi All, DECLARE fileID UTL_FILE.FILE_TYPE; strbuffer VARCHAR2(100); BEGIN fileID := UTL_FILE.FOPEN ('DR', 'New.txt', 'R'); UTL_FILE.GET_LINE (fileID, strbuffer); dbms_output.put_line(strbuffer); END; By this program I can read only first line of the

  • How can I extract parts of the EXIF metadata to use in a Smart Collection?

    I want to aggregate all of the images I've captured by Capture Month and identify those images that were scanned or have no Capture Date.  This question actually attempts to open the door for read access to all of the image metadata and the ability t