Zip file read problem

Hi
iam jayakumar from Inatech(oracle partner).I want to read the zip, write the zip file and create the zip file from BPEL .Is it possible? or use only java embedding in bpel to achieve this? or any config changes required?
normal file adapter not reading the file.
please help me in this
Regards
Jayakumar

Hi Ramana,
after java embedding code i have invoked write process straightly,.In file write operation,File naming convention field , i have mentioned .zip , so zip file is creating ,but no data in that file! what is the problem where i done the mistake?
and decompress code Base64Decoder.decode method not found.....
what is the solution
Regards
Jayakumar

Similar Messages

  • Jar (or Zip) file with problems in accents, special characters

    Hi! I've a servlet that creates a jar (or zip) file and then send it. My problem is that when I create an entry in which the filename has special characters such as accents, when I unjar or unzip de file, it brings a lot of garbage characters. For example, the nex entry:
    Ex�menes.doc
    when unzipped is:
    Ex?�menes.doc
    I've tried a lot of things:
    -Setting the locale to ES, MX
    -Replacing all the letters with special characters with its unicode (like s.replace('�','\u00E1')
    -Trying to convert it to UTF8 (new String(path.getBytes(),"UTF8") )
    -Replacing the file separator char (according to a workaround that I found in the bug database)
    But nothing of this worked, alone or together. I've read that this is (or was) a bug in the API, but don't know if a solution has been found.
    Any help will be greatly appreciated!

    It's not clear what you are asking. Maybe this will help
    http://www.cfdev.com/code_samples/code.cfm/CodeID/83/Java/Simple_Ant_build_xml_Build_Task

  • Zip file Read Linux

    I have a program which reads the content of a zip file(selected by browse button in an html form)and shows to the user. The program runs fine in Windows2000. But the same program is giving NullPointerException when I am trying
    "ZipFile myzipfile = new ZipFile(strFilePath);"
    i.e it is not able to create the File instance from /root/dirName/a.zip
    Please tell me how can I get rid of this problem.
    Regards
    Rajarshi Ghosh

    Does your file name or folder contains special characters? It should also be case sensitive.

  • Simple File Reading problem

    hi guys,
    i have a GUI that executes a certain program based on user inputs. In order to execute the program, the GUI has to edit a text file with a single line in it. the line is provided by user thru GUI. the executable program uses this text file as input, call it input.txt. When I run the program once, everything works fine. But if i use the same GUI to run the program again (without closing the GUI window) with different user input, the program does not run. I check input.txt and I find that the GUI was succesfully able to make the changes the user wanted. I use the simple readline method to read the file as follows:
    BufferedReader reader = new BufferedReader(new FileReader("input.txt"));
    String curStr = null;
    while ((curStr = reader.readLine()) != null) {
      String url = curStr.trim();
      if (addPage(url))
        blah
      else
        blah             
    }addPage(url) complains that the string url is null! Does anyone know what could be the problem.

    You aren't executing that code.
    It is impossible to enter the while-loop if curStr is
    null, because the loop condition says not to. And
    since curStr is not null, then curStr.trim() cannot be
    null either.hmmmm .... the problem is that the print statements indicate that addPage is executed for sure!!! the addPage function does this:
    if (url != null)
      do something
      return true;
    return false;as far as adding more print statements is concerned I can't do that cuz I do not have access to certain source files needed for compiling this one. (I already have the pre-compiled version of this file).

  • Jai CCITT file read problem

    HI,
    I have a file from hp fax machine, probably it's CCITT3 or 4. How can I check this?
    I want to write application to convert this file to pdf format but i can't read this file.
    I would be very grateful if someone could help me.
    Bye

    never mind. I figured it out.

  • File Reader problem

    Hi,
    I am using the following code to read from a text file but whenever the file is not empty i get a NullPointer Exception. May someone help plaease?
    void readScores(Player [] playertable){
               i=0;
              try{
              FileReader filereader=new FileReader("HighScores.txt");
              BufferedReader buffread=new BufferedReader(filereader);
              boolean eof=false;
              while(!eof){
                   String line=buffread.readLine();
                   if(line==null){
                        eof=true;}
                   else{
                   StringTokenizer tokenizer=new StringTokenizer(line);
                   playertable.name=tokenizer.nextToken();
                   playertable[i].score=Integer.parseInt(tokenizer.nextToken());
                   i++;}
              buffread.close();}}
              catch(IOException e){ System.out.println("Exception "+e.toString());}}

    Your playertable probably doesn't contain any Players. Try this:
    else{
    playertable[i] = new Player(); // ADD THIS LINE
    StringTokenizer tokenizer=new StringTokenizer(line);And then rearrange your braces so that the "close" is done outside the while loop.
    And, the typical way to do this loop is without an "eof" flag:
    String line;
    while ((line=buffread.readLine()) != null)
       StringTokenizer tokenizer = new StringTokenizer(line);
    }

  • Quick Look file reading problems in mail.

    Are there certain files that quick look will not open in mail?
    I have sent myself pdf's, which opened ok, but a photo file, .jpg would not.
    (New iPad user, be kind!)

    Only those who have downloaded and are trying to export using the flip4mac trial version. If you want to see the 'rest of the story', pony up the cash for a full version.
    Have fun.
    x

  • Read Zip File and output it to the Stream

    Hi,
    I really need help with this topic. I need to write a function which as input read the zip file (inside: jpeg, mp3, xml)
    and as output provide the output Stream of this zip file.
    public OutputStream readZipToStream(String sourceZipFile) { ....}
    I've tried something....
    public static OutputStream    readZipToStream(String src, HttpServletResponse response) throws Exception {
            File fsrc = null;
            ZipOutputStream out = null;
            byte buffer [] = null;
            FileInputStream in = null;
            try {
                buffer = new byte[BUFFER_CREATE];
                fsrc = new File(src);
                out = new ZipOutputStream(response.getOutputStream());
                ZipEntry zipAdd = new ZipEntry(fsrc.getName());
                zipAdd.setTime(fsrc.lastModified());
                out.putNextEntry(zipAdd);
                // Read input & write to output
                in = new FileInputStream(fsrc);
                while (true) {
                    int nRead = in.read(buffer, 0, buffer.length);
                    if (nRead <= 0)
                        break;
                    out.write(buffer, 0, nRead);
                out.flush();
                in.close();
            } catch (IOException ioe) {
                logger.error("Zip Exception: " + ioe.getMessage());
                ioe.printStackTrace();
                throw ioe;
            return out;
        } But the problem with this code when it returns ( I called from servlet: bellow)
    it ask user to save the file as servlet.jsp file. So I would have to rename it to zip file later.
    What I want to achive is it would ask to save zip file from the stream as name of the original zip file (if that is possible)
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <%
    OutputStream stream = null;
    response.setContentType("application/zip");
    target = mount_media + File.separator + "test_swf.zip";       
    try {
    stream = ZipUtil.readZipToStream(target, response);
    } catch (Exception ex) {
            System.out.println(ex.getMessage());
        } finally {
    if(stream != null) {
                stream.close();
    %>
    <%@page import="java.io.File" %>
    <%@page import="java.io.OutputStream" %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>
    </body>
    </html>

    Hi oleg_s ,
    There's a contradiction of content in your JSP :
    response.setContentType("application/zip");
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">The html part of your JSP seems useless for what you mean to do. Therefore, instead of a JSP, you should use a simple servlet to send your zip file.

  • How do I read a zipped file I have received in my mail?

    Hi
    I have received a zipped word file in the mail but cannot open it. Can I fix this?
    J

    You need an app that's capable of reading zipped files to open the attachment in and then unzip it e.g. GoodReader (not sure whether it deals with password protected zip files)

  • Path in ZIP Files

    I have a program that compresses files into a ZIP File.
    How do you get the data extractable in something like WinZip and how do you get Ride of the Path in WinZip?

    Well what I'm trying to do is use the class files in java.util.zip.* to make a program that compresses files into a ZIP Archive. I figured out the question you didn't understand. What I'm trying to do right now is get the data in the archive extractable. When I open my archive that I created with my program, WinZip says that the enties are there. When I try to extract them WinZip crashes. I used a code that is something like this:
    ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(outzip));
    int q = 0;
    for (q = 0; q < infile.length; q++) {
    FileInputStream in = new FileInputStream(infile[q]);
    size = in.available();
    byte b[] = new byte[size];
    in.read(b);
    File f = new File(infile[q]);
    ZipEntry ze = new ZipEntry(f.getPath());
    zos.setLevel(9);
    ze.setTime(f.lastModified());
    zos.putNextEntry(ze);
    zos.write(b);
    zos.closeEntry();
    in.close();
    zos.flush();
    zos.close();
    Infile is an array of file names in the form of strings. Then the program loops through them strings turning each into a file so that it is written without a path name (which wa part of my last problem) into the zip file.

  • Finder making ZIP file password protected on Windows

    Here's an odd one. Someone (on OS X.5.7) makes an archive (ZIP) of a folder and gives the same file to two people, one on XP and one on Leopard (10.5.8).
    The Leopard user can open the zip file no problem. The XP user has a password prompt, and can't extract or copy the files out of the ZIP file without the password. But no password was set and nobody can guess what the password might be.
    Anybody see anything like this while making ZIPs from Leopard?

    I am having the same problem, occasionally and randomly.
    It seems to be problem with XP and not Vista.
    The standard advice is to right click the zip in Windows, then properties, then "unblock", but this doesn't work in the case of my most recent problem zip.
    I have tried zipping todays problem folder with Finder, FileChute and Betterzip, and none of them will open in XP, but all will in Vista.
    Note that XP will open the zip and show the jpegs, but the jpegs will not open.
    Really would appreciate some help on this.

  • How to set password for a zip file?

    I am able to add files to a zip file using java.util.zip.ZipOutputStream. I'd like to set password for the generated zip file, but could not find any relevant API in JDK doc.
    How to do that in Java? Maybe using a third party library?
    Any suggestions are welcome.
    Thanks.

    Thanks bro, I am looking at the Zip4J :) one of its feature is "Read/Write password protected Zip files" :)

  • Writing to a Zip File

    Hello, anyone that can help with this would be greatly appreciated.
    As of right now I am writing to a file line by line from a vector. I would like to write a zip file instead. I would like to eliminate writing to the file (at a certain path) and just create a zip file instead and write to it line by line.
    Is this possible?
    I think it is but I was not real clear on the
    zipoutputstream.write(this stuff).
    Thank you.

    Got it to write to the zip file.

  • Error opening .zip files in EP

    hello to all, my problem is the following one:
    I have an url iview, this one points at a flash file witch opens a .zip file. When I preview the iview  I'm able to download the .zip file without problems BUT when I assign this role to my user, the .zip file download popup doesn't open (it appears and sudenly dissapears).
    Any idea?
    thank you.

    Hi,
         Check if it is browser popup problem (You will get one popup bar blocked). If not, check the logs for any useful hint.
    Regards,
    Harini S

  • How to append to zip files

    I would like to know how to append to a zip file, I know how to write a zip file and I can put as many entries in the first time but if I run my program again and try to add a file to the same zip file it erases what was already in it. I use ZipOutputStream(new FileOutputStream), I have tried the FileOutputStream append but it does not seem to work for zip files, I have tried RandomAccessFile on my zip file but that just seems to add the bytes to the file that already in the zip file, and makes the file unopenable, corrupt. If you can help, please tell me how.

    You actually have to open the previous zipped file, read it's entries and their data and then rewrite a new zip file with these entries and their data. You can then delete your first file and rename the new one so the effect is that you have "appended" zip files to the existing archive.
    Here is an example which I pieced together from a larger bit of code that I have. This would need to be in a try/catch but this should give you a start.
    /** This method adds a new file to an existing zip file. It * includes all the zipped entries previously written.
    * @param file The old zip archive
    * @param filename The name of the file to be Added
    * @param data The data to go into the zipped file
    * NOTE: This method will write a new file and data to an archive, to
    * write an existing file, we must first read the data frm the file,
    * then you could call this method.
    public void addToArchive(File file, String filename, String data)
         ZipOutputStream zipOutput = null;
    ZipFile zipFile = null;
    Enumeration zippedFiles = null;
    ZipEntry currEntry = null;
    ZipEntry entry = null;
    zipFile = new ZipFile( file.getAbsolutePath() );
         //get an enumeration of all existing entries
    zippedFiles = zipFile.entries();
         //create your output zip file
    zipOutput = new ZipOutputStream( new FileOutputStream ( new File( "NEW" + file.getAbsolutePath() ) ) );
    //Get all the data out of the previously zipped files and write it to a new ZipEntry to go into a new file archive
    while (zippedFiles.hasMoreElements())
    //Retrieve entry of existing files
    currEntry = (ZipEntry)zippedFiles.nextElement();
    //Read data from existing file
    BufferedReader reader = new BufferedReader( new InputStreamReader( zipFile.getInputStream( currEntry ) ) );
    String currentLine = null;
    StringBuffer buffer = new StringBuffer();
    while( (currentLine = reader.readLine() ) != null )
    buffer.append( currentLine);
    //Commit the data
    zipOutput.putNextEntry(new ZipEntry(currEntry.getName()) ) ;
    zipOutput.write (buffer.toString().getBytes() );
    zipOutput.flush();
    zipOutput.closeEntry();
    //Close the old zip file
    zipFile.close();
    //Write the 'new' file to the archive, commit, and close
    entry = new ZipEntry( newFileEntryName );
    zipOutput.putNextEntry( entry );
    zipOutput.write( data.getBytes() );
    zipOutput.flush();
    zipOutput.closeEntry();
    zipOutput.close();
         //delete the old file and rename the new one
    File toBeDeleted = new File ( file.getAbsolutePath() );
    toBeDeleted.delete();
         File toBeRenamed = new File ( "NEW" + file.getAbsolutePath() );
    toBeRenamed.rename( file );
    Like I said I haven't tested this code as it is here but hopefully it can help. Good luck.

Maybe you are looking for

  • Is that possible to convert logical standby to physical standby ?

    Hi guys, My steps for testing as below: 1.create a primary database 2.duplicate a physical standby database; 3.turn on flashback on both databases. 4.record SCN xxx on physical standby database. 5.convert physical standby to logical standby (using ke

  • Photoshop elements 9 not reproducing avi video in organizer

    Hello, I have read different posts of people having problems to reproduce video media in PE organizer with different degrees of succes to solve it. In my case, I have just updated a computer to windows 7 - 64bit and after installing Photoshop Element

  • Control Bar Help

    When making a custom list of keywords for the Control Bar, does anyone know where that information is stored. I would like to port the same list over to another machine. Thanks!

  • My rex2 loops stopped working?

    All the sudden I cant import them..it givs me some error like : "couldnt load rex shared library. The file may be corrupt. Please reinstall then try again. If that doesnt work contact tech support" then if I click "ok" it says: "What kind of file is

  • Accidental damage to screen, any way to get it fixed?

    I have a first-gen nano thats not quite a year old and today it got ran over by an electric wheelchair weighing about 350 lbs. Thankfully I have a very good double-layer cover that probably saved my nano's life, but it did get hurt. It still plays mu