Zip file with Adapter Module

Dear Frnds,
i created one file to file scenario i want output Zip file format for this requirement i used Adapter module ike below but am not able open the output Zip file  plpz help on this .
Module
Name:   loacalejbs/AF_Modules/PayloadZipbean
Module
Type:    Local Enterprise Bean
Module
Key: Zip  
Parameter
value:    zipAll                      --   To compress all payloads
Regards,
Rajendra K

Hi Rajendar,
Refer below blog on how to use payloadzip bean.
Working with the PayloadZipBean module of the XI Adapter Framework
You can also zip your output file by using OS command at receiver channel with a unix script.
Regards,
Aamir

Similar Messages

  • I am trying to organize a zip file with a bunch of links and files. But when I drag an image file to a folder, it always "Snaps to grid" instead of just landing where I put it.

    I am trying to organize a zip file with a bunch of links and files. But when I drag an image file to a folder, it always "Snaps to grid" instead of just landing where I put it. All of the files are going into the same zip file but I want them visually in the space that I put them and not at the bottom of the snap to grid folder location they are looking like.  I am trying to  drag and drop files in groups so that I can group them for now, but image files always do their own "sort by" when I drag them from my web pages. Links don't do it though.  I tried resetting the folder, and deleting the DS files. No luck.

    You keep asking variants on this same question. You've had replies in all your other threads. If you can't find them, go here and click where it says Activity:
    Thomas Cannon Jr.

  • Using a different user(other than default PI user) with adapter module

    Hi,
    We are having a custom adapter module built to interact with a Hardware Security Module(HSM). This custom adapter module by default uses a PI user configured in the system. However, we are not able to pass commands to HSM because of insufficient authorizations to this PI user. Now, we do not exactly know the permissions required for the user to access HSM. We have asked the HSM support team about the same. However, I wanted to explore the possibility of using a different PI user to work with the adapter module and eventually pass commands to HSM.
    We have an admin user configured which has all the necessary authorizations. Is it possible to use this admin user created on PI system to work with adapter module so that it passes commands to HSM?
    Thanks,
    Ravi Desai

    We have given the necessary authorizations to PI user.

  • Cannot extract Zip file with Winzip after zipping with java.util.zip

    Hi all,
    I write a class for zip and unzip the text files together which can be zip and unzip successfully with Java platform. However, I cannot extract the zip file with Winzip or even WinRAR after zipping with Java platform.
    Please help to comment, thanks~
    Below is the code:
    =====================================================================
    package myapp.util;
    import java.io.* ;
    import java.util.TreeMap ;
    import java.util.zip.* ;
    import myapp.exception.UserException ;
    public class CompressionUtil {
      public CompressionUtil() {
        super() ;
      public void createZip(String zipName, String fileName)
          throws ZipException, FileNotFoundException, IOException, UserException {
        FileOutputStream fos = null ;
        BufferedOutputStream bos = null ;
        ZipOutputStream zos = null ;
        File file = null ;
        try {
          file = new File(zipName) ; //new zip file
          if (file.isDirectory()) //check if it is a directory
         throw new UserException("Invalid zip file ["+zipName+"]") ;
          if (file.exists() && !file.canWrite()) //check if it is readonly
         throw new UserException("Zip file is ReadOnly ["+zipName+"]") ;
          if (file.exists()) //overwrite the existing file
         file.delete();
          file.createNewFile();
          //instantiate the ZipOutputStream
          fos = new FileOutputStream(file) ;
          bos = new BufferedOutputStream(fos) ;
          zos = new ZipOutputStream(bos) ;
          this.writeZipFileEntry(zos, fileName); //call to write the file into the zip
          zos.finish() ;
        catch (ZipException ze) {
          throw ze ;
        catch (FileNotFoundException fnfe) {
          throw fnfe ;
        catch (IOException ioe) {
          throw ioe ;
        catch (UserException ue) {
          throw ue ;
        finally {
          //close all the stream and file
          if (fos != null)
         fos.close() ;
          if (bos != null)
         bos.close();
          if (zos != null)
         zos.close();
          if (file != null)
         file = null ;
        }//end of try-catch-finally
      private void writeZipFileEntry(ZipOutputStream zos, String fileName)
          throws ZipException, FileNotFoundException, IOException, UserException {
        BufferedInputStream bis = null ;
        File file = null ;
        ZipEntry zentry = null ;
        byte[] bArray = null ;
        try {
          file = new File(fileName) ; //instantiate the file
          if (!file.exists()) //check if the file is not exist
         throw new UserException("No such file ["+fileName+"]") ;
          if (file.isDirectory()) //check if the file is a directory
         throw new UserException("Invalid file ["+fileName+"]") ;
          //instantiate the BufferedInputStream
          bis = new BufferedInputStream(new FileInputStream(file)) ;
          //Get the content of the file and put into the byte[]
          int size = (int) file.length();
          if (size == -1)
         throw new UserException("Cannot determine the file size [" +fileName + "]");
          bArray = new byte[(int) size];
          int rb = 0;
          int chunk = 0;
          while (((int) size - rb) > 0) {
         chunk = bis.read(bArray, rb, (int) size - rb);
         if (chunk == -1)
           break;
         rb += chunk;
          }//end of while (((int)size - rb) > 0)
          //instantiate the CRC32
          CRC32 crc = new CRC32() ;
          crc.update(bArray, 0, size);
          //instantiate the ZipEntry
          zentry = new ZipEntry(fileName) ;
          zentry.setMethod(ZipEntry.STORED) ;
          zentry.setSize(size);
          zentry.setCrc(crc.getValue());
          //write all the info to the ZipOutputStream
          zos.putNextEntry(zentry);
          zos.write(bArray, 0, size);
          zos.closeEntry();
        catch (ZipException ze) {
          throw ze ;
        catch (FileNotFoundException fnfe) {
          throw fnfe ;
        catch (IOException ioe) {
          throw ioe ;
        catch (UserException ue) {
          throw ue ;
        finally {
          //close all the stream and file
          if (bis != null)
         bis.close();
          if (file != null)
         file = null ;
        }//end of try-catch-finally
    }

    Tried~
    The problem is still here~ >___<
    Anyway, thanks for information sharing~
    The message is:
    Cannot open file: it does not appear to be a valid archive.
    If you downloaded this file, try downloading the file again.
    The problem may be here:
    if (fos != null)
    fos.close() ;
    if (bos != null)
    bos.close();
    if (zos != null)
    zos.close();
    if (file != null)
    file = null ;
    The fos is closed before bos so the last buffer is not
    saved.
    zos.close() is enough.

  • What is the max size of a zip file with the JDK1.5 ?

    Hello everybody,
    I'm a french student and for a project, I need to create a zip file, but I don't know in advance the number and the size of files to include in my zip.
    I wish to know if someone have the answer to my question : what is the max size of a zip file with the JDK1.5 ? I believe that with the JDK1.3, the limit size of a zip was about 2Go, wasn't ?
    Thank you for all answer !
    Good day !
    PS : sorry for my very poor english ;-)

    Here is all I have found for the moment :
    ...Okay, what about my suggestion of creating your own 10GB file?
    Try this:import java.io.File;
    import java.io.RandomAccessFile;
    import java.nio.ByteBuffer;
    import java.nio.channels.FileChannel;
    import java.util.Random;
    class Main {
        public static void main(String[] args) {
            long start = System.currentTimeMillis();
            int mbs = 1024;
            writeFile("E:/Temp/data/1GB.dat", mbs);
            long end = System.currentTimeMillis();
            System.out.println("Done writing "+mbs+" MB's to disk in "+
                    ((end-start)/1000)+" seconds.");
        private static void writeFile(String fileName, int numMegaBytes) {
            try {
                int numBytes = numMegaBytes*1024*1024;
                File file = new File(fileName);
                FileChannel rwChannel =
                        new RandomAccessFile(file, "rw").getChannel();
                ByteBuffer buffer = rwChannel.map(
                        FileChannel.MapMode.READ_WRITE, 0, numBytes);
                Random rand = new Random();
                for(int i = 1; i <= numMegaBytes; i++) {
                    for(int j = 1; j <= 1024; j++) {
                        byte[] bytes = new byte[1024];
                        rand.nextBytes(bytes);
                        buffer.put(bytes);
                rwChannel.close();
            } catch(Exception e) {
                e.printStackTrace();
    }On my machine it took me 43 seconds to create a 1GB file, so it shouldn't take too long to create your own 10GB. Then try zipping that file.
    Good luck.

  • Decrypt Zip File with AES Cryptography

    Hi,
    I want to make a programm to decrypt a zip file with aes cryptography in java with gui.
    Our professor as a help they gave us that code [http://code.google.com/p/winzipaes/source/browse/winzipaes/src/de/idyl/crypto/zip/AesZipFileDecrypter.java?r=4].
    I search in Internet to find out same help for the project but I understood , that other programm don't use all the packages in the example.And i am little confused.
    I want some help to find out a solution for this problem.And if you have a similar programm jusy sent it to occupy how I resolve my own problem.

    As your professor has given you the crypto code and wants you to write the GUI code this is not a Cryptography question at all. Locking this thread.

  • Decrypt Zip File with 128bit AES

    Hello my name is George ,
    I want to make a program to decrypt a zip file with 128-bit AES Algorithm using Brute Force and Dictionary Attack.
    Because it is my first time I try to make something with the encrytpion libraries I don't know much.
    Because that is an exercise they told us to use this library [http://www.javamex.com/arcmexer/].
    So I want to give me some help.
    Any help is welcoming.

    Hi.
    I want to make a program to read a zip file with a password(aes encrytpion) and I foun the password.
    At first i know the password and I want to do If I write it wright.
    I read a zip file but when I try to read it with encryption I take that exception.
    That is the program
    import com.javamex.arcmexer.*;*
    *import java.io.*;
    import java.lang.*;*
    *import java.util.*;
    public class Decryption {
         public static void main(String[] args){
              String pw = "12345678";
              System.out.print("\rEnter the filename to be encrypted (full path is needed if not located at the same directory): ");
                    try {
                   FileInputStream f = new FileInputStream("C://Giorgos.zip");
                   ArchiveReader r = ArchiveReader.getReader(f);
                   ArchiveEntry entry =r.nextEntry();     
                   BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
                            while ((entry = r.nextEntry())!= null) {
                        String filename = entry.getFilename();
                                    InputStream in = entry.getInputStream();
                                    String inputLine = input.readLine();
                                    if (inputLine.equalsIgnoreCase("yes")) {
               +BufferedReader br = new BufferedReader(new InputStreamReader(entry.getInputStream(filename)));+  //HERE IS MY PROBLEM
                                        +String line;+
                                         +while ((line = br.readLine())!= null) {+
                                        +System.out.println(line);+
    <                                    <em>input.close();+
    <                       <em>// }+
    +               if (entry.isProbablyCorrectPassword(pw)){+
    +                    System.out.println("Password found: "+  pw);
              } catch (Exception e){
                        System.out.println("Exception raised!");
    }And the exception is:
    *{color:#0000ff}C:\Documents and Settings\Ergasia\Decryption\src\Decryption.java:26: getInputStream() in com.javamex.arcmexer.ArchiveEntry cannot be applied to (java.lang.String)*
    *BufferedReader br = new BufferedReader(new InputStreamReader(entry.getInputStream(filename)));{color}*

  • Decompress ZIP file with Password

    Hi all,
    Does anybody know how to decompress a ZIP file with password protection?
    I have a decompress code, but I don't know how to insert the pass.
    Any solution?
    Regards

    I'm running out of suggestions over here.
    Your exact command line yields this result:
    zip warning: name not matched: in.txt
    zip error: Nothing to do! (out.zip)
    Well, it should, as I don't have an in.txt. Handing it an existing file, I get this:
    zip -P pass out.zip result.txt
      adding: result.txt (deflated 7%)
    .. and opening in the Finder correctly prompts me:
    so there must be something wrong with your system.
    Very Long Shot: What version do you get when you type this? (I can't imagine this is the actual problem, but you never know.)
    zip --version
    Mine is
    Copyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license.
    This is Zip 3.0 (July 5th 2008), by Info-ZIP.
    Currently maintained by E. Gordon.  Please send bug reports to
    the authors using the web page at www.info-zip.org; see README for details.
    Latest sources and executables are at ftp://ftp.info-zip.org/pub/infozip,
    as of above date; see http://www.info-zip.org/ for other sites.
    Compiled with gcc 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00) for Unix (Mac OS X) on May 25 2011.

  • Finder crashed after downloading a zip file with pictures

    First my desktop icons disappeared. Then the finder, appears and disappears every 3 seconds. Simultaneously the Finder also disappears and reappers in the "Force Quit Application" window. This started after I downloaded a zip file with family photos from a friend (on a windows machine). Rebooted off the Tiger installation dick. Running disk utility off the Tiger installation disk did not help. Permissions were repaired but the finder is still crashing Tried relaunching the Finder from the "Force Quit Application" window. No help. Ran Virex (outdated by 12 months) without any benefit.
    Any suggestions would be appreciated.

    There's a shameful glitch in Finder where if you drag certain attachments off a mail document onto the Desktop the Finder will do its quit/relaunch jitter bug--will also do it for illegally named files on the Desktop, and will hang for dang near forever it you accidently drop 100s of files onto the Desktop. The easy solution is to start the affected machine in target disk mode, hook it up by firewire to another Mac, then navigate to the affected user's Desktop folder and move the funky file or files into a new folder.
    Francine
    Francine
    Schwieder

  • Pull a zip file with multiple files unzip it, and finally load one of the f

    Hi Aill,
    I have following query.
    Could we do the following with XI: pull a zip file with multiple files from a vendor which resides outside of XI server network, unzip it, and finally load one of the files to SAP?
    Regards
    Rohan S

    Hi Varadharajan,
    I have 10 text files in some ZIP file on one server which is out side of network. We can reach that file through Proxy only to read ZIP file.
    I need to extract the file and on the bases of some condition one of the file i need to upload data to SAP.
    Is it possible. If possible then How?
    Regards

  • File adapter - Archive issue with adapter module

    Hi All,
    I have 2 issues here. We are currently using PI 7.11 EHp1 SP02.
    1. Arhival with "add time stamp" wont work. It just gives us an error message saying simpledate format exception.
    I have gone through the OSS note 1265534 and thought this will resolve the issue. But our BASIS team believes this note is only applicable for PI 7.1 SP01. Can you one using PI 7.11 SP02 comment on this?
    Note: Archive option with out add time stamp works fine.
    2. When I use adapter module in my sender file configuration, the archive option itself does not work. Read the official SAP help which says "To archive source files where a permanent error occurred during processing, set the indicator.
    A permanent error occurs either during the conversion of the file content, or in a module in the module processor."
    So the question here is, how do we make the error permanent? The only way to throw error from adapter module is using the ModuleException. It has 4  different constructors. I have used both
    ModuleException me = new ModuleException ("My error Msg"); and
    Module Exception me1 = new ModuleException ("Error String", new Throwable("My error Msg");
    In both the cases, the archival wont happen.
    Any ideas welcome.
    Thanks
    Jai

    Hi,
    I am using NFS protocol here not FTP. Sorry I dint mention that earlier.
    Thanks
    Jai
    Edited by: Jaishankar on Apr 1, 2010 9:55 AM
    Edited by: Jaishankar on Apr 6, 2010 11:10 AM

  • File sender adapter Module Error

    Hi Everybody,
    I have developed an adapter module for file sender to rename the file name which is picked from the directory and I am getting an error
    "Attempt to process file failed with java.lang.NullPointerException".
    Can anybody tell me why is this error?
    Thanks,
    Zabi

    Hi,
    first check that module has been succesfully executed or not .This you can check in RWB .
    Secondly go in the file adpater and click on to module tab and check
    1-there will be two things one will be adapter module that you have depolyed. other one will be call sap adapter.
    2- make sure that call sap adapter should come after the module you have deployed. and having the key value less then adapter module (let say your adapter module is having the key value 1 and  call sap adpater is having the key value 0 then you need to change the key value there)
    Thanks
    sachin

  • How can I create a zip file with LabVIEW?

    I would like to compress my data (ASCII format) to an archive.
    I use LVZlib.vi to compress and decompress data but I would like to be able to read the output file with a software archiver such as PowerArchiver/WinZIP.
    Someone knows how I can create a file compatible with zip or gz standard format, thanks !

    >> Yes but I have to install a special archiver (with ms-dos ommand line ability
    >> such as pkzip,arc,rar,arj...) on the computer where I install my LV application.
    Search for "gnu tools for windows" and get zip.exe, gzip.exe, bzip2.exe and others (even the source, if you like). These are about 50kB files that run in place (no installation) - easy to include in a distributed app. Oh, since I'm logged in I'll attach a couple, though I don't have the source on this machine).
    Attachments:
    bin.zip ‏67 KB

  • Download a zip file with gui_download = CRC error

    Hello erverybody,
    I download a zip compressed file with gui_download (cl_gui_interface_services) in binary mode.
    When I try to open it, I have a crc error. Does anybody has any idea why?
    here the code:
           TYPES: begin of t_zip,
                 text(1024) type c,
                 end of t_zip.
          DATA: itab_zip type table of t_zip,
                wa_zip type t_zip.
          OPEN DATASET p_fileon IN BINARY MODE FOR INPUT.
          IF sy-subrc <> 0.
            MESSAGE text-e01 TYPE 'E'.
          ENDIF.
          DO.
            READ DATASET p_fileon INTO wa_zip MAXIMUM LENGTH 1024.
            APPEND wa_zip TO itab_zip.
            IF sy-subrc <> 0.
              EXIT.
            ENDIF.
          ENDDO.
          CLOSE DATASET p_fileon.
          MOVE p_filedw TO filename.
          CALL METHOD cl_gui_frontend_services=>gui_download
            EXPORTING
              filename                  = filename
              FILETYPE                  = 'BIN'
            CHANGING
              data_tab                  = itab_zip
    Thanks
    Joachim

    Hi Joachim,
    1. use this code (just copy paste in new program)
    2. It will download from SERVER to front-end.
    3.
    *& Report  YBCR_FILEDOWNLOAD                                           *
    REPORT  ybcr_filedownload                       .
    DATA
    DATA : file_name TYPE string.
    DATA : BEGIN OF itab OCCURS 0,
           ln(255) TYPE c,
           END OF itab.
    SCREEN
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS : appfn(150) TYPE c LOWER CASE OBLIGATORY.
    PARAMETERS : p_file LIKE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION SCREEN
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CLEAR p_file.
      CALL FUNCTION 'F4_FILENAME'
        IMPORTING
          file_name = p_file.
      file_name = p_file.
    START-OF-SELECTION
    START-OF-SELECTION.
      OPEN DATASET appfn FOR INPUT IN TEXT MODE  ENCODING DEFAULT .
      IF sy-subrc <> 0.
        MESSAGE s999(yhr) WITH 'COULD NOT OPEN FILE ON APP SERVER'.
        LEAVE LIST-PROCESSING.
      ENDIF.
      DO.
        READ DATASET appfn INTO itab.
        IF sy-subrc = 0.
          APPEND itab.
        ELSE.
          EXIT.
        ENDIF.
      ENDDO.
      file_name = p_file.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
      BIN_FILESIZE                    =
          filename                        = file_name
      FILETYPE                        = 'ASC'
      APPEND                          = ' '
      WRITE_FIELD_SEPARATOR           = ' '
      HEADER                          = '00'
      TRUNC_TRAILING_BLANKS           = ' '
      WRITE_LF                        = 'X'
      COL_SELECT                      = ' '
      COL_SELECT_MASK                 = ' '
      DAT_MODE                        = ' '
      CONFIRM_OVERWRITE               = ' '
      NO_AUTH_CHECK                   = ' '
      CODEPAGE                        = ' '
      IGNORE_CERR                     = ABAP_TRUE
      REPLACEMENT                     = '#'
      WRITE_BOM                       = ' '
      TRUNC_TRAILING_BLANKS_EOL       = 'X'
      WK1_N_FORMAT                    = ' '
      WK1_N_SIZE                      = ' '
      WK1_T_FORMAT                    = ' '
      WK1_T_SIZE                      = ' '
    IMPORTING
      FILELENGTH                      =
        TABLES
          data_tab                        = itab
      FIELDNAMES                      =
    EXCEPTIONS
      FILE_WRITE_ERROR                = 1
      NO_BATCH                        = 2
      GUI_REFUSE_FILETRANSFER         = 3
      INVALID_TYPE                    = 4
      NO_AUTHORITY                    = 5
      UNKNOWN_ERROR                   = 6
      HEADER_NOT_ALLOWED              = 7
      SEPARATOR_NOT_ALLOWED           = 8
      FILESIZE_NOT_ALLOWED            = 9
      HEADER_TOO_LONG                 = 10
      DP_ERROR_CREATE                 = 11
      DP_ERROR_SEND                   = 12
      DP_ERROR_WRITE                  = 13
      UNKNOWN_DP_ERROR                = 14
      ACCESS_DENIED                   = 15
      DP_OUT_OF_MEMORY                = 16
      DISK_FULL                       = 17
      DP_TIMEOUT                      = 18
      FILE_NOT_FOUND                  = 19
      DATAPROVIDER_EXCEPTION          = 20
      CONTROL_FLUSH_ERROR             = 21
      OTHERS                          = 22
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    regards,
    amit m.

  • File Receiver adapter module Dynamic Configuration

    Hi All
    I have a adapter module in a receiver file adapter. In the code I try to access the file name through dynamic configuration,The file name gets set in the mapping.
    String strFileName = msg.getMessageProperty(new MessagePropertyKey("FileName","http://sap.com/xi/XI/System/File"));
    When my module get executed I get error: nested exception is: java.lang.NullPointerException: while trying to invoke the method com.sap.engine.interfaces.messaging.api.Message.getMessageProperty(com.sap.engine.interfaces.messaging.api.MessagePropertyKey) of an object loaded from local variable 'msg'
    Is it possible to get file name in receiver adapter? if so why does this error occur?

    Yes it is possible...chk this
    /people/daniel.graversen/blog/2006/10/05/dynamic-configuration-in-adapter-modules
    i guess u have added this import statement in ur code:
    import com.sap.engine.interfaces.messaging.api.MessagePropertyKey;
    Code will be soemthing like this (FOR PI7.1)
    MessagePropertyKey mpk = new MessagePropertyKey("FileName","http://sap.com/xi/XI/System/File");
    String filename = msg.getMessageProperty(mpk);
    Thanks
    Amit

Maybe you are looking for