Reading ZIP files

Is it possible to read content of ZIP files.
Iam using ORACLE forms 6i.
In our company, we are creating a zip file with two folder src and lib, where SRC contains FMB files abd LIB contains PLLfiles.Now i want to know whether instead of us seeing the contents, is it possible to check whether fmx and plx are present in correspoding folder using some api methods.
If u can find any please tell me .. it will be of great use

I dont about the api's, but one way cud be unzipping the files in temp folder thru winzip command line and then checking the files existence.

Similar Messages

  • Error reading zip file in Java 6

    We have a bespoke installer program that fails, intermittently, in Java 6 on Windows. After installing some files, it then fails with a stack trace like this:
    java.util.zip.ZipException: error reading zip file
         at java.util.zip.ZipFile.read(Native Method)
         at java.util.zip.ZipFile.access$1200(ZipFile.java:29)
         at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:447)
         at java.util.zip.ZipFile$1.fill(ZipFile.java:230)
         at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:141)
         at java.io.FilterInputStream.read(FilterInputStream.java:90)
         at com.XXXX.trent.installer.Installer.writeStreamToFile(Unknown Source)
         at com.XXXX.trent.installer.Installer.installFile(Unknown Source)
         at com.XXXX.trent.installer.PatchFileInstaller.installFile(Unknown Source)
         at com.XXXX.trent.installer.PatchFileInstaller.installFiles(Unknown Source)
         at com.XXXX.trent.installer.UpgradeInstaller$TpfAction.run(Unknown Source)
         at com.XXXX.trent.installer.UpgradeInstaller.runActions(Unknown Source)
         at com.XXXX.trent.installer.UpgradeInstaller.install(Unknown Source)
         at com.XXXX.trent.installer.TrentInstall$SoftwareInstallStage.install(Unknown Source)
         at com.XXXX.trent.installer.TrentInstall$UpgradeInstallWorker.install(Unknown Source)
         at com.XXXX.trent.installer.PatchInstall$InstallWorker.construct(Unknown Source)
         at com.XXXX.trent.utils.SwingWorker$2.run(Unknown Source)
         at java.lang.Thread.run(Thread.java:619)The same code works in Java 5 on the same environments that it now fails in Java 6 (1.6.0_16).
    Any ideas?
    Thanks.

    gimbal2 wrote:
    it is not weird, it is a bug in the application. Don't let the upgrade from Java 5 to Java 6 make you believe otherwise.It's a singularly bad exception message though. I would have thought that something from java.util might be a bit more explicit about what the problem is.
    Winston

  • Program to read zip files???

    im looking for a program to read zip files?Is this even possible on a mac? Im running 10.4.11 on my ibook g4

    Hello,
    What you need is a program that can OPEN .zip files. Go here: http://my.smithmicro.com/mac/stuffitexpander/index.html
    Download the free installation and just follow the instructions to open .zip files.
    Carolyn

  • Error reading zip file containing an excel file

    Hi all,
    Using servlets I am able to zip an excel file using java.util.zip package. The excel file is created using POI API.
    While I save and extract the zip file on my machine and then open the file in MS Excel. Excel pops a message saying "MS Office Excel has encountered a problem and need to close" and it gives me an option to "Recover my work and restart MS Office Excel". I select the option and then MS Excel does a document recovery and I am able to view my data. I get an excel repair log file saying as follows
    "Microsoft Office Excel File Repair Log
    Errors were detected in file 'C:\Documents and Settings\JohnDoe\Desktop\excel\test.xls'
    The following is a list of repairs:
    Damage to the file was so extensive that repairs were not possible. Excel attempted to recover your formulas and values, but some data may have been lost or corrupted.
    I have attached my servlet code down below I suspect there is a problem with PrintWriter to output or do I need to use OutputStream to write excel data.
    Below is my servlet code:
    import java.io.*;
    import javax.servlet.*;
    import org.apache.log4j.Logger;
    import java.util.*;
    import java.util.zip.*;
    import java.net.*;
    import org.apache.poi.hssf.usermodel.*;
    import org.apache.poi.hssf.record.*;
    import org.apache.poi.hssf.util.*;
    public class ZipServlet extends HttpServlet {
         * @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest,
         * javax.servlet.http.HttpServletResponse)
         public void doGet(HttpServletRequest request, HttpServletResponse response)
              throws ServletException, IOException {
              makeZip(request, response, "GET");
         * @see javax.servlet.http.HttpServlet#doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
         protected void doPost(HttpServletRequest request, HttpServletResponse response)
                   throws ServletException, IOException {
                   makeZip(request, response, "POST");
         public void makeZip(HttpServletRequest request, HttpServletResponse response, String methodGetPost) {
              Logger logger = Logger.getLogger(ZipServlet.class);
              try
                   int id=1;
                   ServletContext sc = getServletContext();
         HttpSession session = request.getSession();          
                   ConnectionPoolManager cpm = (ConnectionPoolManager)sc.getAttribute("CONNECTION_POOL_MANAGER");
                   ConnectionPool cp = cpm.getConnectionPool(id);
              createTestExcelZip(request,response,methodGetPost,session);
              } catch (Exception e2) {
         public void createTestExcelZip(HttpServletRequest request, HttpServletResponse response,
                   String methodGetPost,HttpSession session
                   )throws ServletException, IOException
              Logger logger = Logger.getLogger(ZipServlet.class);
              try
              {      //Create an Excel Workbook and placing value "Test" in the first cell
                   HSSFWorkbook wb = new HSSFWorkbook();
                   HSSFSheet sheet = wb.createSheet("new sheet");
                   HSSFCell cell=null;
                   HSSFRow row = sheet.createRow((short) 0);
                   short column = 0;
                   cell = row.createCell(column);
                   cell.setCellValue(new HSSFRichTextString("Test"));
                   HSSFCellStyle fontStyle = wb.createCellStyle();
              HSSFFont f = wb.createFont();
              f.setFontHeight((short) 200);
              f.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
              fontStyle.setFont(f);
              cell.setCellStyle(fontStyle);
              response.setContentType("application/zip");
                   response.setHeader("Content-Disposition","attachment; filename=zipExcelRecordFiles.zip;");
                   int BUFFER = 2048;
                   byte buf[]=new byte[300000];
                   ByteArrayOutputStream baos = new ByteArrayOutputStream();
                   ZipOutputStream zos = new ZipOutputStream( baos );
                   ByteArrayInputStream is = null;
                   BufferedInputStream origin = null;
                   byte[] b = null;
                   String fileName = null;
                   b = wb.getBytes();
                   fileName = "testExcelRecords.xls";
                   try
                   is = new ByteArrayInputStream(b);
                   origin = new BufferedInputStream(is, BUFFER);
                   zos.putNextEntry(new ZipEntry(fileName)); // Add ZIP entry to output stream.
              int count;
              while((count = origin.read(buf, 0, BUFFER)) != -1)
              zos.write(buf, 0, count);
              zos.closeEntry(); // Complete the entry
                   is.close();
                   }catch(Exception e)
                        logger.error(e);
                   zos.close();
              PrintWriter pr = response.getWriter();
                   pr.write(baos.toString("ISO-8859-1"));
                   pr.close();
              catch(Exception e)
              logger.error(e);     
         * @see javax.servlet.GenericServlet#destroy()
         public void destroy() {
    Any help would be appreciated.
    Regards
    jdcunha

    Jdcunha,
    I am new to the field but encountered the same problem and recently found a solution. Hope this helps.
    For my project I wanted to create individual Excel 2003 workbooks for each file I created. Excel would give me the same error it gave you when I used the same HSSFWorkbook object. I tried creating a new Workbook object each time, but ran into the same issue.
    I ended up fixing the error by creating a new instance of my write-to-excel class each time I wanted to create a new workbook, instead of just recreating a new HSSFWorkbook object. It works perfectly and the Excel errors don't show. It may also be important to note I used OutputStream, I did not try it with printwriter.

  • How to read ZIP files(having PDFs,Image) using MQ Series link for R/3

    Hi,
    1)Is it possible to transfer a zip file (having an image or pdf) using IDocs in SAP 4.6C using MQ Series link for R/?
    Scenario: "MQ Series link for R/3" converts Business-Reports from a third-party software,into SAP IDocs.Each Business-Report contains one XML file and one ZIP file.
    2)Being on ABAP side,do I have to worry about how the zip file would be converted into IDocs?
    Detailed descrption:
    This scenario requires integration of a non-SAP software which talks in XML with SAP R/3(4.6C).The customer has decided to go with 'MQ Series link for R/3' (which integrates any non-SAP application running on IBM MQ Series to R/3,by converting data(in any format) into IDocs).He is not ready to go for XI.
    The Problem area is a functionality which requires the non-SAP software to send XML file along with an attached Zip file.So,XML document,basically,has a 'zippedFile' XML element having actual file in XML keyword 'file'.
    This XML document ideally, should be converted by the subsystem(MQSeries link for R/3) into IDocs i.e. into a stream which could be stored in a table on R/3 side and later, sent back to the non-SAP software through MQ Series link to be converted into zip-file again with corresponding pdfs,images.I want someone who has worked in a similar scenario to confirm this.

    Hi,
    I have a feeling I have posted this question in the wrong forum or maybe I will let you decide this.Any help would be appreciated (even the right forum name).
    My scenario requires integration of a non-SAP software which talks in XML with SAP R/3(4.6C).The customer has decided to go with 'MQ Series link for R/3' (which integrates any non-SAP application running on IBM MQ Series to R/3,by converting data(in any format) into IDocs).He is not ready to go for XI.
    The Problem area is a functionality which requires the non-SAP software to send XML file along with an attached Zip file.So,XML document,basically,has a 'zippedFile' XML element having actual file in XML keyword 'file'.
    This XML document ideally, should be converted by the subsystem(MQSeries link for R/3) into IDocs i.e. into a stream which could be stored in a table on R/3 side and later, sent back to the non-SAP software through MQ Series link to be converted into zip-file again with corresponding pdfs,images.I wanted someone who has worked in a similar scenario to confirm this.

  • File Adapter to read Zip file and send it as input to another webservice

    Hi,
    I have the below requirement:
    1. A service will generate 3 attachments and place it in a particular directory.
    2. SOA service has to pick those 3 files and send those files as input to another custom application which will email.
    Design :
    1. First SOA will create an archive file of those 3 attachements and then file adapter will poll for that zip file in that location and send that file as a whole to the custom application.
    Query:
    Now my question, is the above design feasible? If so, how to configure the file adapter to pass the file as input to that custom application?
    Kindly do the needful
    Thanks,
    Priya

    You can accomplish this via java embedding activity...Create a java embedding, which will create a zip file.. this java code is easy to implement..
    You can also do away with un-necessary polling file adapter.. and you can use "Synchronous File Read" operation of File Adapter.. For Sync Read, you'll have to pass the zip file name, which you can easily fetch from java embedding activity..
    Let me know, if this doesn't work.

  • Reading .ZIP files using File Adapter

    Hi,
    I am using BPEL File Adapter to read files. The files to be read are XML files which are in zipped format.
    so how should I read these .zip files and extract the XML files from that.
    Thanks
    /Kiran.

    If the xml files are all in the same directory (not in any directory structure relative to the parent directory), you can do something like this.
    - create a bpel process to read the zip files as it comes into the directory]
    - Have a file adapter inbound for the receive
    - Call windows .bat command within the bpel process to run an unzip command on that directory
    - Have another bpel process that reads *.xml files and this will get kicked off.
    There are so many ways of solving this: like having a cron job to unzip the files coming in etc. But, if you have a directory structure for these XML files and if the structure is dynamic, it is difficult to configure the file adapter for that.

  • JVM Setting for performance as reading zip files.....??

    I am not too familiar with VM options but I noticed that reading from Zip files is pretty process intensive. I am basically searching through zip files to find a file and then taking that inputstream for processing. I am basically looping through the zip file until i match the filename....pretty crazy.
    Anyway, it is somewhat slower than I'd like so I want to see what I can do to increase performance. I am using the following parameters:
    -Xms512m -Xmx1024M -Xss16M -XX:ThreadStackSize=256 -XX:MaxPermSize=256m
    The machine I have is a single P4 3GHZ, ~3GB RAM.
    Do those params look ok?
    Thanks!
    Michael

    intensive. I am basically searching through zip
    files to find a file and then taking that inputstream
    for processing. I am basically looping through the
    zip file until i match the filename....pretty crazy.I think it is pretty I/O intensive...hence slower
    to see what I can do to increase performance. I am
    using the following parameters:
    -Xms512m -Xmx1024M -Xss16M -XX:ThreadStackSize=256
    -XX:MaxPermSize=256m
    Parameters look ok. I am not sure what -XX:ThreadStackSize will do as -Xss also sets the stack size? you can also try to pass -server and keep both Xms and Xmx to 1024 and see if it brings any improvement.
    -BJ

  • Read Zip File

    Hi,
    I have one zip file and want to read it file by file can you please tell me how can I achieve this???
    OR
    Can anyone please tell me about how can I get absolute path of the file which is resided in the zip file
    For example,
    if I have an zip file Test.zip which contains 4 zip files t1.xml,t2.xml.... and so on and resided on my local drive (D:).
    So, is there any way where I can get absolute path of these files like "D:\\Test.zip\\t1.xml","D:\\Test.zip\\t2.xml"
    Thanks in advance!!!

    rpdesh wrote:
    You can read the contents of the Zip file by creating ZipInputStream object.
    The constructor takes the file path and using the method getNextEntry() you will get the ZipEntry present in the zip file.
    Something like this...
    File file = new File("Zip file path here");
    ZipInputStream zip = new ZipInputStream( new FileInputStream( file ))
    ZipEntry zipEntry = null;
    while( zip.getNextEntry() != null )
    zipEntry = zip.getNextEntry();
    // Other operaions here
    <shakes-head/>
    That code is skipping over every other ZipEntry. Try this:
    for(ZipEntry zipEntry; (zipEntry= zip.getNextEntry()) != null;) {
         System.out.println(zipEntry.getName());
    }One could also use java.util.zip.ZipFile.

  • How to read zip files?

    Hi,
    I am trying to read data from zip files. can anyone say what i did wrong in this configuration?
    <?xml version="1.0" encoding="UTF-8"?>
    <Graph author="123" created="Mon Oct 08 10:06:08 IST 2012" guiVersion="3.2.1" licenseCode="CloverETL Designer single license" licenseType="CloverETL Designer single license" modified="Mon Oct 08 10:06:08 IST 2012" modifiedBy="123" name="Default graph name" revision="1.0" showComponentDetails="false">
    <Global>
    <Dictionary/>
    </Global>
    <Phase number="0">
    <Node enabled="enabled" fileURL="zip:(${DATAIN_DIR}/Archive1.7z)" guiHeight="93" guiName="UniversalDataReader" guiWidth="148" guiX="230" guiY="116" id="DATA_READER1" type="DATA_READER"/>
    <Node enabled="enabled" guiHeight="67" guiName="Trash" guiWidth="128" guiX="670" guiY="157" id="TRASH0" type="TRASH"/>
    <Edge debugMode="true" fromNode="DATA_READER1:0" guiBendpoints="632:312|632:175" guiLocks="572|null|null" guiRouter="Manual" id="Edge0" inPort="Port 0 (in)" metadata="Metadata1" outPort="Port 0 (output)" toNode="TRASH0:0"/>
    </Phase>
    </Graph>

    Based on your filename Archive1.7z you might have a 7z format 7zip file. I don't think this archive format is supported - you'll need to use a supported format such as ZIP.
    Best
    Brett

  • 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.

  • Read zip files created by ZipOutputStream

    Hello :)
    I am wondering if it is possible to create a zipfile using ZipOutputStream, which can be read using ZipInputStream with out using the ZipFile work-around discussed in http://forum.java.sun.com/thread.jspa?forumID=256&threadID=492219. This is no option for me, because we have a lot of client applications deployed, which cannot easily be altered.
    Are there any (third-party) libraries which I can use?
    -M1chael

    try it
    // These are the files to include in the ZIP file
    String[] source = new String[]{"source1", "source2"};
    // Create a buffer for reading the files
    byte[] buf = new byte[1024];
    try {
    // Create the ZIP file
    String target = "target.zip";
    ZipOutputStream out = new ZipOutputStream(new FileOutputStream(target));
    // Compress the files
    for (int i=0; i<source.length; i++) {
    FileInputStream in = new FileInputStream(source);
    // Add ZIP entry to output stream.
    out.putNextEntry(new ZipEntry(source[i]));
    // Transfer bytes from the file to the ZIP file
    int len;
    while ((len = in.read(buf)) > 0) {
    out.write(buf, 0, len);
    // Complete the entry
    out.closeEntry();
    in.close();
    // Complete the ZIP file
    out.close();
    } catch (IOException e) {

  • How to read zip file

    How to read zip file

    Zip files are not files you read. They are compressed archives containing other files. There are many utilities available for iOS that will expand zip files into its component files. I believe Documents by Readdle will expand zip files.
    However, if these zip files are attached to a pdf, I am unsure if Documents will do that. Reader and Acrobat will not open zip attachments on Macs and PCs as a security precaution.

  • Alternative APIs for reading Zip files?

    Hi all.
    At the moment, our application handles zip files by copying the zip file to the temp directory and then creating a new ZipFile. However, the larger the zip file we encounter, the slower this copy becomes. We also need random access to the Zip file, so the usual workaround of using ZipInputStream is also slow, although slightly faster for random access than copying the entire file.
    I raised a bug requesting a better constructor for ZipFile, but it was turned down as they seemed to think I didn't want random access.
    But does anyone know of any alternative APIs which can access Zip files in a more random access fashion? I've discovered a few other alternative implementations of ZipFile, but all of them so far have had this issue of requiring a File.

    intensive. I am basically searching through zip
    files to find a file and then taking that inputstream
    for processing. I am basically looping through the
    zip file until i match the filename....pretty crazy.I think it is pretty I/O intensive...hence slower
    to see what I can do to increase performance. I am
    using the following parameters:
    -Xms512m -Xmx1024M -Xss16M -XX:ThreadStackSize=256
    -XX:MaxPermSize=256m
    Parameters look ok. I am not sure what -XX:ThreadStackSize will do as -Xss also sets the stack size? you can also try to pass -server and keep both Xms and Xmx to 1024 and see if it brings any improvement.
    -BJ

  • 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)

Maybe you are looking for

  • Problem with Javascript and opening a new page

    Hi, I'm developping a website with Java Server Faces. I've a problem with JavaScript. I have a table, and each row of that table, has a button, to display more information about that specific row. I want to display this information in a new window. F

  • Location of the attachments in Guided Procedures

    Hi, does anybody know the location where the attachments from the Guided Procedure Runtime are stored? Are they stored somewhere in the KM or in the database/filesystem directly? In the Guided Procedure Monitoring i can see the attached documents, bu

  • Is it possible to downgrade your I phone 4s to ISO 6?

    I would just like to know if i can downgrade my iphone 4s to ISO 6, just for a change?

  • I cannot import my photos with Preview and iOS 5. Help!

    I've just update my iPhone 4 to iOS5 and now i can't import my pic with Preview on a Macbook Pro (OSX fully updated). Someone knows something or has had the same problem?

  • DSL Dropping

    My DSL has been dropping for 2 weeks,  Had Verizon tech out finally, to test line.Giving up on current modem and router and  ordered a d-link  DSL-2640B . I have 4 computers wired via ethernet .  Any suggestions on how to set this up and solve this p