Skip to Main Content

Application Development Software

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!

Error in Downloading file from ucm to local directory using ridc

3698041Feb 7 2019 — edited Feb 8 2019

Hi Experts,

I am using RIDC to download the files from content server below is my code given :

        

                  IdcClientManager manager = new IdcClientManager ();

            

                try

                {

                 

                                        IdcClient idcClient = manager.createClient ("idc://192.168.0.215:4448");

                  

                     IdcContext userContext = new IdcContext ("oudadmin");

                

                     HdaBinderSerializer serializer = new HdaBinderSerializer ("UTF-8", idcClient.getDataFactory ());

               

                  

                     DataBinder dataBinder = idcClient.createBinder();

                   System.out.println("inside dataBinder and above GET_FILE");

                    dataBinder.putLocal("IdcService", "GET_FILE");

                

                    System.out.println("after GET_FILE");

                    dataBinder.putLocal("dID","1804" );

                    dataBinder.putLocal("dDocName","WCC215.GENX.COM001804");

                    System.out.println("after did and ddocname");

                   //  dataBinder.putLocal("dDocName", "MYDOCNAME");

                    dataBinder.putLocal("allowInterrupt", "1");

                     serializer.serializeBinder(System.out, dataBinder);

                    FileOutputStream fos = new FileOutputStream("test.txt");

                       ServiceResponse response1 =

                       idcClient.sendRequest(userContext, dataBinder);

                    

                       InputStream fis = response1.getResponseStream();

                       ByteArrayOutputStream bos = null;

                    System.out.println("after bytearrayoutputstream assis");

                 

                       byte[] readData = new byte[1024];

                       int i = fis.read(readData);

                       while (i != -1) {

                         fos.write(readData, 0, i);

                         i = fis.read(readData);

                       }

                           System.out.println("after bos.write");

                           // Close the socket connection

                              response1.close();

                              // Don't leave the streams open

                              fos.close();

                              fis.close();

                      

                   

                }

                  

              

}

I   am calling this code from jsp page although the code is running successfully without any error but document is not getting download to the local system.

I don't why its not functioning as expected.

Regards.

Comments

Post Details

Added on Feb 7 2019
3 comments
518 views