How to ZIP a File from File adapter

Hi All,
How Can I create a ZIP file after reading from the directory.
Is there any property which zip's all the read file?
The requirement is to read an xml and create a zip of the same file in different location. Appreciate your response.
Thanks,

Hi,
You can use OOTB Pipelines and Valves to achieve this. Refer below and let us know if you have any questions.
http://docs.oracle.com/cd/E23943_01/integration.1111/e10231/adptr_file.htm#autoId19
Regards,
Neeraj Sehgal

Similar Messages

  • How to Zip Excel files using File Adapter?

    Hi,
    We have tried to ZIP the Excel file with  PayloadZipBean in File adapter. But we faced some issue while zipping.
    We have seen some zunk data in excel file after zipping with PayloadZipBean. Someone please help how to zip Excel files in PI with File Adapter.
    Regards,
    Sreeramulu Konjeti.

    Hi Sree,
    If you are facing any issue with PayloadZipBean then you can use java mapping to Zip the files.
    Please find the complete Java mapping code to zipt the file
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/50ce0433-4309-2b10-4bb4-d421e78463f7?quicklink=index&overridelayout=true

  • How to zip multi files into one zip file in ABAP

    hi all:
    As you know, ABAP has CL_ABAP_GZIP class to support zip file function. But it only support one file zip. If I want to zip two files into one zip file, how to do it?
    thanks.

    Hi,
    <li>If you know how to zip one file,  to zip two files , you can follow the below steps.
    DATA:g_zipper     TYPE REF TO cl_abap_zip.
    "create our zipper object
    CREATE OBJECT g_zipper.
    "add 1st file to zip
    CALL METHOD g_zipper->add
       EXPORTING
         name    = file_name
         content = content_x.
      "add 2nd file to zip
    CALL METHOD g_zipper->add
       EXPORTING
         name    = file_name
         content = content_y.
    "save zip
    CALL METHOD g_zipper->save
       RECEIVING
         zip = zip.
    Thanks
    Venkat.O

  • How to zip one file i have on disk with java.util.zip

    I don't know how to zip a file. I managed to do new html file, but i don't know how to zip it.
    This is my code:
    PrintWriter pw = new PrintWriter (new FileWriter(export), true);
    Thanks!

    heres a zipper class i wrote which i have butchered a bit to make more generic (its basic and at present only takes one zipentry etc, but very simple and should be easy to extend etc) Just pass it your file in its constructor and then call its zipme method. PS if it can be made better let me know so i can update my class, cheers.
    import java.io.*;
    import java.util.zip.*;
    import java.awt.*;
    class zipper
         public File file;
         public zipper(File f)
              file = new File(f);
         public void zipme()
              try
                   FileInputStream fin = new FileInputStream(file);
                   int a = (int)file.length();
                   byte b[] = new byte[a];
                   fin.read(b);
                   ZipEntry k = new ZipEntry(fin.getName());//represents a single file in a zip archive!
                   File newFile = new File("D:\\AZipFile.zip");
                   ZipOutputStream zi = new ZipOutputStream(new FileOutputStream(newFile));
                   zi.putNextEntry(k);
                   zi.write(b,0,a);
                   zi.close();
                   fin.close();
              catch(FileNotFoundException e)
                   //System.out.println("ERROR File not found");
              catch(IOException ee)
                   //System.out.println("ERROR IO exception in Zipping file");
    }

  • How to ZIP the files and folders/sub folder files using java

    HI All,
    I'm New to this Forum, Could anybody tell me how to zip the files and folders/sub folders using java. For example I have a folder with the name testfolder and side that folder I have some files and some sub folders inside subfolders I have some other files. I need to ZIP the files and folders as they are in same hierarchy.
    Any pointers or help wolud be appritiated.
    Thanks,
    Rajeshbabu V

    [http://www.devx.com/tips/Tip/14049]

  • How to zip a file on mac pro?

    how to zip a file on mac pro?

    Tristan,
    Select multiple items that you want to zip, right click and choose "Compress XX Items."

  • How to Zip server files(in a directory) and throwing back to client

    Can someone tell me how to zip all the files in a particular directory of my web application and throwing back to client to give option for save that zipped file.
    i have used the below used function to zip in servlet. But I cann't zip a particular directory of my application in server.
    Please help
    private void zipDir(String dir2zip, ZipOutputStream zos)
    try
    //create a new File object based on the directory we
    // have to zip File
    File fileDir2Zip = new File(dir2zip);
    System.out.println("is directory ..."+fileDir2Zip.isDirectory());
    //get a listing of the directory content
    String[] dirList = fileDir2Zip.list();
    for(int i = 0 ; i < dirList.length ; i++)
    System.out.println("Dir list ..."+dirList);
    byte[] readBuffer = new byte[2156];
    int bytesIn = 0;
    //loop through dirList, and zip the files
    for(int i=0; i<dirList.length; i++)
    File f = new File(fileDir2Zip, dirList[i]);
    if(f.isDirectory())
    //if the File object is a directory, call this
    //function again to add its content recursively
    String filePath = f.getPath();
    zipDir(filePath, zos);
    //loop again
    continue;
    //if we reached here, the File object f was not
    //a directory
    //create a FileInputStream on top of f
    FileInputStream fis = new FileInputStream(f);
    //create a new zip entry
    ZipEntry anEntry = new ZipEntry(f.getPath());
    //place the zip entry in the ZipOutputStream object
    zos.putNextEntry(anEntry);
    //now write the content of the file to the ZipOutputStream
    while((bytesIn = fis.read(readBuffer)) != -1)
    zos.write(readBuffer, 0, bytesIn);
    System.out.println("Last");
    //close the Stream
    fis.close();
    catch(Exception e)
    e.printStackTrace();

    Hi
    Whatever file exist in directory should execute with out any condition because they delete all files after exection of my process chain. They are using another process chain once a day for deletion of all files in that directory.
    So directory always contains fresh files.
    Here by using routine in infopackge i am unable to run all files one by one at a time.
    As of my knowledge  by using infopackage we can run only one file at a time.
    Here my question is , can we run more than one file in single run of infopackage?
    or can we have any function module to run the infopackage from externally? so that i can use function module in abap program? any ideas..
    Regards
    Raju

  • How to make BPEL File Adapter read only new files?

    Hello
    we have BPEL processes that define to run from bpel component - file adatper-
    when a file come into location that it is path on the linux server . the bpel start run when "File Adapter" bpel component recognize that new file come to the location. its PollingFrequency define to 5. property name="DeleteFile" value="false" so the files remaine there.
    we want to migrate the bpel to new SOA version so we did export and deploy to new SOA Domain.
    the location of the file adapter is the same.
    but when the BPEL processes deployed its start to run for all the files that are in this location- that the file adapter define on .
    even the original soa tooks those files and start the BPEL processes for each one of them. also the new SOA that we did deploy to the BPEL processes take those files even if they are very old.
    we want the file adatper we take only new files . the start point is the time when we do deploy to the process so if we do deploy in 10:00 am we dont want this bpel will take files from 9:00 or earlier time
    Please help , how we can do this?
    Thanks

    thank you
    do you kno hat the value means in the example:
    Java mon amour: File Adapter metadata with SOA Suite
    <property name="jca.file.LastModifiedTime" value="1293041258635">
    what should I rite for read only the files that are only neer then yesterday?

  • How to zip keynote files?

    How to Zip or Reduce Keynote Files?

    Newer versions of Keynote zip the documents as part of the save process by default; these files can't be compressed much further without losing content. To check, control-click the document in the Finder and see if Show Package Contents is an option; if not, it's already zipped. If it is, choose to compress or archive it from that menu.
    (63532)

  • How to Zip a file and find it size using ABAP code

    Hi All,
    My requirement is to extract a file from Al11 ZIP it and find it size. 
    Please let me know whether there are any Function modules or Classes for Zipping and finding the size of it.
    Note : Used Class "cl_abap_zip" but the output at in chinese language.
    Thanks in advancve for your support.
    Regards
    Jithu

    Check https://wiki.sdn.sap.com/wiki/display/profile/GZIP
    and how to zip and unzip a file in abap
    May it useful
    Kanagaraja L

  • How to configure Sender File Adapter to pick couples files in order !!

    Hi Folks,
    I am really looking for one requirement like, Sender file adapter has to pick multiple files by file name based with some time gap? Can we?
    I have got one BPM in this, I have tried with Process mode : Name and Date, with wait step on BPM, but no use. The way how PI behaving, if 40 files in file directory, it is picking all files in one shot. Start processing but not in order.
    The problem is on Receiver system side. The receiver system is SNC system, if old data receives later than earlier date data; we get data obsolete application error.
    Ex: If I receive 25th and 26th files, first I need to process 25th first on PI sends to SNC, I need to give some time gap and pick another file or even  PI picks and process 26th file, no problem but  I need to give some time gap to send SNC to this 26th date file?
    Please how guys, throw me your great ideas
    Thanks in advance!!
    Regards
    San

    @ Sandhya
    If there are 40 files , can you please specify how many types of files are ther like say first A type shud be picked then B type then C type and so on so forth ?
    LIke in my case I had only three types of files file1 and file 2 file 3
    and in the directory also only three  files will be placed at a time
    you need to have some logic to separate the type of files in  differnt folders and then  process them
    @ farooq yes . it will create problem if 40 files are kept at a time .
    Regards
    Ninad

  • How to know when File Adapter is complete when debatching?

    I have a BPEL process that reads in a file and debatches it into records of 1 and inserts them into a table.
    How do I know when the entire process is complete and all records in the file have been handled?

    Thats the problem with the file adapter. If you use it in debatch mode, you cannot really control the different BPEL processes that get spawned off one file.
    The other approach for scenarios where the file is huge, could be to use the adapter in notification mode. So the file adapter will notify the BPEL process, that the file is available, and then BPEL process can read the file using xpath functions or java code etc.
    Hope this helps.
    -@

  • How to zip a file?

    Hi folks...
    I need to zip a file from Oracle Forms 6i (Oracle EBS 11.5.2.10) or a PL/SQL object to send it by e-mail.
    I did a search and the only solution that I found was using Java:
    *1) Create a java file like:*
    import java.util.zip.*;
    import java.io.*;
    public class zipfile
    public boolean addFile(String filename,String outFilename)
    try {
    int len;
    ZipOutputStream out = new ZipOutputStream(new FileOutputStream(outFilename));
    FileInputStream in = new FileInputStream(filename);
    // Add ZIP entry to output stream.
    out.putNextEntry(new ZipEntry(filename));
    byte[] buf = new byte[1024];
    while ((len = in.read(buf)) > 0)
    out.write(buf, 0, len);
    in.close();
    out.closeEntry();
    out.close();
    return true;
    } catch (IOException e)
    return false;
    *2) Compile this file and import it at Oracle forms using Import Java Classes. But when I try to import this file I get the following error:*
    Importing Class Zipfile...
    Exception occurred: java.lang.UnsupportedClassVersionError: Zipfile (Unsupported major.minor version 50.0)
    What can be? Other Ideas to zip a file using Forms or PL/SQL?
    tks

    This might work, but you have to compile it with an older version of the java-compiler than you do. You might try JDeveloper 9.x which comes with the developersuite10g, but it might also be that you have to use an even older version.

  • How to activate the File Adapter

    Hi All,
       There is a strange problem that i am faceing now.
    I am using a file adapter to push and pull the file. The problem is just before two days the file adapter was working fine but as the location for the file pushing(file location) was not correct , so it went in the HOLD status. I just cancle the queue to make it clear and then re processed the file .
    The starange thing is that it is now not picking of the file , when checked the adapter monitoring, i found that the file adapter is in grey status saying "inactive Led : Component status is not defined "
      So also i dont found any item (communication channel) for file adapter.
    Any idea from your side will be a great help for me.
    Thanks in advance.
    JAY.

    Hi,
    When you activate or deactivate the adapter, then its corresponding services in the J2EE engine become active and inactive.
    If possible try to manually activate it. Or try to do some changes in your channel and activate it.
    If still this problem persist, do full adapter cache refresh.
    And finally restart J2EE engine if possible.
    Thanks
    Farooq
    Edited by: Farooq Farooqui on Aug 25, 2008 4:01 PM

  • How to ZIP, PDF file attachment

    Hi,
    I have an ABAP report requirement to send an email to a user. This program will send an email with PDF attachement. However, the PDF attachment is quite big (9MB) and our email server couldn't handle it (5MB only). Is there any way to ZIP this PDF file attachment?
    I am using a SAP release ECC 6.0with OS WinNT. And the ABAP program should be able to run in Foreground/Background.
    Thanks for your help in advance...

    Hi,
    Try this code:
    data ca_attach_zip(22)     TYPE c VALUE 'Attch.',
    OPEN DATASET va_filename_zip  FOR INPUT  IN BINARY MODE.
       DO.
         READ DATASET va_filename_zip INTO objbin.
         IF sy-subrc NE 0. EXIT. ENDIF.
         APPEND objbin.
       ENDDO.
        APPEND objbin.
      DESCRIBE TABLE objbin LINES tab_lines.
       CLOSE  DATASET va_filename_zip.
        DELETE DATASET va_filename.
        DELETE DATASET va_filename_zip.
        DESCRIBE TABLE objbin LINES tab_lines.
        objhead = ca_attach_zip.
        APPEND objhead.
    ***Creation of the entry for the compressed attachment
       objpack-transf_bin = 'X'.
        objpack-head_start = 1.
      objpack-head_num = 1.
        objpack-body_start = 1.
        objpack-body_num = tab_lines.
       objpack-doc_type = ca_zip.
       objpack-obj_name  = ca_attach_zip.
      objpack-obj_descr = ca_attach_zip.
       objpack-doc_size = tab_lines * ca_255.
        APPEND objpack.
    *** Completing the recipient list
        reclist-receiver = va_mail_address.
        reclist-express  = 'X'.
        reclist-rec_type = 'U'.
        APPEND reclist.
    *** Sending the document
        CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
          EXPORTING
           document_data              = doc_chng
           put_in_outbox              = ca_x
            commit_work                = 'X'
          TABLES
           packing_list               = objpack
            object_header              = objhead
            contents_bin               = objbin
            contents_txt               = objtxt
            receivers                  = reclist
          EXCEPTIONS
            too_many_receivers         = 1
            document_not_sent          = 2
            document_type_not_exist    = 3
           operation_no_authorization = 4
            parameter_error            = 5
            x_error                    = 6
            enqueue_error              = 7
            OTHERS                     = 8.
    You have to load your file in the contents_bin table of FM.
    You can load the file by OPEN DATASET and the READ DATASET command.
    In the object_header you can put some description.
    For your info:
    1. Zip the data and send as an email attachment
    2. How to Zip the data in an internal table
    3. Re: How to ZIP a PDF file email attachment
    May it helps you.
    Regards.
    Deepak Sharma.

  • How to customize the File Adapter to put the header line in a variable?

    I have a file in which the first line contains the number of records contained by the file itself.
    Like this:
    4
    record1
    record2
    record3
    record4
    where each record is a delimited list of values
    I need to validate that the records are actually 4.
    in the documentation of the File Adapter I see that you can declare the first line as "header", but I have the impression that in this case it would be simply ignored, and not stored in a variable for later use......
    Is this correct?
    Any trick or workaround?
    thank you soooo much!

    it worked like a charm,
    here is the XSD I have used:
    http://www.javamonamour.org/2010/12/soa-sutie-file-adapter-parsing-complex.html
    ( I don't seem to be able to display correctly XML in this post :o( )

Maybe you are looking for

  • How do I make this script: Hide dock while Gimp is open, automatically?

    Scenario: I need to maximize my 1024x768 screen when I do photo editing, so every time I open Gimp.app, I hide my dock. Since I tend to re-arrange icons on my dock periodically, I generally like to leave it showing. When I quit Gimp.app, I sometimes

  • Itunes wont update on my iPhone 5S

    im trying to connect my phone to itunes but it continues to say i must download itunes 11.1 or later and i go to itunes.com to search for the update but I cant find where on the webpage to find it. Help please?

  • Apple Mail (10.7) Sent Emails...where are they

    I have sent over 140 emails since August 3rd using OSX Lion and NONE, Yes NONE are showing in Apple Mail's "Sent" files. As usual I went back to Outlook 2011 and all 142 sent emails are there. What the heck is going on with Apple Mail?????? ....Canno

  • Newbie in JSP...help

    pls post some codes in jsp in adding,editing,deleting and viewing data in the database..i am using tomcat,apache,mysql...thanx

  • Macintosh OS X, 802.1x, EAP-TLS

    Wanting to implement 802.1x authentication on my wired network. using Windows IAS as the radius and Windows 2000/XP/MAC OS X as clients. The Windows clients works perfectly, 802.1x authentication occurs before user login box. The Max OS X clients are