How to Read a CAB File from JAVA?

Hi,
Anyone knows how to read a CAB File from java. I need to read a property file of txt file that is packaged in CAB file & then based on that, I have to do processing. Is there anyway to do it.
I had tried using java.util.zip.ZipFile Class, but it does work for JAR, but not for CAB.
siva.

Perhaps there's something in the Cabinet SDK that will help:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncabsdk/html/cabdl.asp

Similar Messages

  • How to read a text file using Java

    Guys,
    Good day!
    Please help me how to read a text file using Java and create/convert that text file into XML.
    Thanks and God Bless.
    Regards,
    I-Talk

         public void fileRead(){
                 File aFile =new File("myFile.txt");
             BufferedReader input = null;
             try {
               input = new BufferedReader( new FileReader(aFile) );
               String line = null;
               while (( line = input.readLine()) != null){
             catch (FileNotFoundException ex) {
               ex.printStackTrace();
             catch (IOException ex){
               ex.printStackTrace();
         }This code is to read a text file. But there is no such thing that will convert your text file to xml file. You have to have a defined XML format. Then you can read your data from text files and insert them inside your xml text. Or you may like to read xml tags from text files and insert your own data. The file format of .txt and .xml is far too different.
    cheers
    Mohammed Jubaer Arif.

  • How to call a .bat file from java code?

    How to call a .bat file from java code? and how can i pass parameters to that .bat file?
    Thanks in advance

    thanks for ur reply
    but still i am getting the same error.
    I am trying to run a .bat file of together tool, my code looks like below
    import java.lang.Runtime;
    import java.lang.Process;
    import java.io.File;
    class SysCall{
         public static void main(String args[]){
              String cmd="D://Borland//Together6.2//bin//Together.bat -script:com.togethersoft.modules.qa.QA -metrics out:D://MySamples//Metrics// -fmt:html D://Borland//Together6.2//samples//java//CashSales//CashSales.tpr";
              //String path="D://Borland//Together6.2//bin//Together.bat ";
              Runtime r= Runtime.getRuntime(); //Declare the system call
              try{
                   System.out.println("Before batch is called");
                   Process p=r.exec(cmd);
                   System.out.println(" Exit value =" + p.exitValue());
                   System.out.println("After batch is called");
              /*can produce errors which must be caught*/
              catch(Exception e) {
                   e.printStackTrace();
                   System.out.println (e.toString());
    I am getting the below exception
    Before batch is called
    java.lang.IllegalThreadStateException: process has not exited
    at java.lang.Win32Process.exitValue(Native Method)
    at SysCall.main(SysCall.java:17)
    java.lang.IllegalThreadStateException: process has not exited

  • How to read an ARPA file in java

    Hi
    Im new in java and dont know many thing about it, I want to know how can read an ARPA file in java.
    pleas describ it step bye step and esy to understand.
    Edited by: 836719 on Feb 14, 2011 8:15 PM

    836719 wrote:
    ok i explain what i want to do maybe u can help me more,
    i want to read an arpa file and search it to find for example a word.so u think which method that u mentioned above is beter???
    It will be pleasure if u have any tip that can help me.1. Learn the basics of programming as well as how to logically construct and deconstruct a problem domain.
    2. Learn the basics of programming java.
    3. Learn about java.io.*
    4. Learn about java swing
    5. Find documentation that describes the format of the ARPA file.
    6. Read the documentation and understand it.
    7. Find a source for ARPA files (if this is online then there is more java to learn as well.)
    8. Use 1,2 and 3 to write java code that consumes the ARPA file.
    9. Use 4 to ask the user for a word.
    10. Use 1 and 2 to write code that 'searches' what you read in 8.

  • How to read and XSD file in java prospective in NWDS

    Hi !!
    anybody can help me that
    how to read and XSD file in java prospective in Netweaver developer Studio
    Regards
    Abhishek Agrahari

    I guess you can make it more clear...

  • How to read Oracle Package file in Java?

    Hello Expert!
    I have a package file which is generating XML blocks from the mapped information of another database. What I need to do:
    1) Run the package file from JAVA (or JSP)
    2) Catch the exceptions if have any in the scripts.
    3) Store the generated XML blocks into one CLOB object.
    Could you please advice me how to proceed?
    Affirmations:
    a) Will JDBC support?
    b) How to catch exception of package file in Java?
    PS: I am NOT sure whether my query relevant to this sections or not. If NOT, please direct me to the correct sections of Oracle Forums.
    With Thanks!
    Newkid

    836719 wrote:
    ok i explain what i want to do maybe u can help me more,
    i want to read an arpa file and search it to find for example a word.so u think which method that u mentioned above is beter???
    It will be pleasure if u have any tip that can help me.1. Learn the basics of programming as well as how to logically construct and deconstruct a problem domain.
    2. Learn the basics of programming java.
    3. Learn about java.io.*
    4. Learn about java swing
    5. Find documentation that describes the format of the ARPA file.
    6. Read the documentation and understand it.
    7. Find a source for ARPA files (if this is online then there is more java to learn as well.)
    8. Use 1,2 and 3 to write java code that consumes the ARPA file.
    9. Use 4 to ask the user for a word.
    10. Use 1 and 2 to write code that 'searches' what you read in 8.

  • How to read time capsule files from iphone

    any one knows how to do this?
    i have used in the past an application call Soonr to access the mac but haven't tried if it works with time capsule.
    thanks for any thoughts/suggestions...

    Hi Harish,
    U can read all the files from a App's dir with this FM.
      CONCATENATE  '' '.'
             INTO LV_FILE1.
    *FM lists out the files present in App Server directory matching with given pattern.
      CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
        EXPORTING
          DIR_NAME                     = DIR_NAME
          FILE_MASK                    = LV_FILE1
       IMPORTING
    DIR_NAME                     =
         FILE_COUNTER                 =  FLE_CNT
    ERROR_COUNTER                =
        TABLES
          DIR_LIST                     = IT_DIRTAB
       EXCEPTIONS
         INVALID_EPS_SUBDIR           = 1
         SAPGPARAM_FAILED             = 2
         BUILD_DIRECTORY_FAILED       = 3
         NO_AUTHORIZATION             = 4
         READ_DIRECTORY_FAILED        = 5
         TOO_MANY_READ_ERRORS         = 6
         EMPTY_DIRECTORY_LIST         = 7
         OTHERS                       = 8
    Regards,
    KC

  • How to read an audio file from the disk and play it?

    Do you know who to read an audio file from the hard disk and play it. It's for an application and not an applet. I tried with the Applet.newAudioClip(URL url) thing, but I keep getting a MalformedURLException.
    And is there a way to get the path of the file you are using? Currently I'm doing this:
    File file = new file("randomname");
    string = file.getAbsolutePath();
    file.delete();
    I'm sure there's a better way. And this is not for an applet, just a normal app.

    Below is a class that should be of use to you.
    package com.sound;
    import java.io.File;
    import javax.sound.sampled.AudioFormat;
    import javax.sound.sampled.AudioInputStream;
    import javax.sound.sampled.AudioSystem;
    import javax.sound.sampled.Clip;
    import javax.sound.sampled.DataLine;
    public class SoundPlayer implements Runnable {
         String filename;
         public SoundPlayer(String filename){
              this.filename = filename;
              Thread t = new Thread(this);
              t.start();
         }//SoundPlayer constructor
         public void run(){
              playSound();
         }//run method
         public boolean playSound(){
              try {
                   File file = new File(filename);
                   AudioInputStream stream = AudioSystem.getAudioInputStream(file);
                   AudioFormat     format = stream.getFormat();
                   DataLine.Info info = new DataLine.Info(Clip.class, format);
                   Clip clip = (Clip)AudioSystem.getLine(info);
                   clip.open(stream);
                   clip.start();
                   while (clip.isRunning()) {
                       Thread.sleep(100);
                   clip.close();
              catch (Exception e) {
                  System.err.println("Error in run in SoundPlayer");
                   return false;
              return true;
         }//playSound() method
    }//Class SoundPlayer

  • How to read a text file from a Jar file

    Hi
    How can I read a text file from a Jar file?
    Thanx in advance..

    thanx
    helloWorld it works.damn, I didn't remove it fast enough. Even if it is urgent, it is best not to mention it, telling people just makes them take longer.

  • How to read an xml file from headers

    Hi ,
    I am not getting how to read an xml file sent by client device in header to server.
    Thankx.

    There is a getHeader() in HttpServletRequest interface
    String locationURL=request.getHeader("Location");If URL of your file was set in Location attribute of header.
    Edited by: ngpgeeta on Dec 19, 2008 8:03 AM

  • How to read a PDF file from server

    Hi All,
    I am strucked while creating new file instance .
    Here i know the URL.
    How to create the File instance by using this URL.
    I tried the following way:
    URI uri = url.toURI();
    File f = new File(uri);
    Here i got the following exception :
    <code>
    Exception in thread "main" java.lang.IllegalArgumentException: URI scheme is not "file"
    </code>
    Can any one help me?
    Thanks in advance......

    Can any one help me how can i down load a file
    from server by using URL?RTFAPI. Url.openStream().

  • How to read a XML file from BLOB column and insert in a table - PL/SQL Only

    Hi,
    To make data load more simple to end user instead placing file on the server and use SQL-LOADER, I came up with new idea that using oracle ebusiness suite attachment functionality. that loads a XML file from local PC to a database column(table is fnd_attachments, default data type is BLOB over here).
    I tried with DBMS_LOB and didnt get around.
    Please can anyone tell me how to read the BLOB column using PL/SQL and store the data in a oracle table. Here's the sample XML file and table structure FYI.
    <?xml version="1.0" encoding="UTF-8"?>
    <dataroot xmlns:od="urn:schemas-microsoft-com:officedata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Corporate_alloc.xsd" generated="2009-07-07T14:17:49">
    <Corporate_alloc>
    <PKG_CODE>BKCORP</PKG_CODE>
    <PKG_NAME>Corporate Edition - Books</PKG_NAME>
    <DET_CODE>B9780080543758</DET_CODE>
    <DET_NAME>Waves, Tides and Shallow-Water Processes</DET_NAME>
    <ALLOCATION_RATIO>0.000041</ALLOCATION_RATIO>
    </Corporate_alloc>
    <Corporate_alloc>
    <PKG_CODE>BKCORP</PKG_CODE>
    <PKG_NAME>Corporate Edition - Books</PKG_NAME>
    <DET_CODE>B9780080534343</DET_CODE>
    <DET_NAME>Hydrostatically Loaded Structures</DET_NAME>
    <ALLOCATION_RATIO>0.000127</ALLOCATION_RATIO>
    </Corporate_alloc>
    </dataroot>
    CREATE TABLE TEST_XML
    ( PKG_CODE VARCHAR2(50),
    PKG_NAME VARCHAR2(100),
    DET_CODE VARCHAR2(20),
    DET_NAME VARCHAR2(500),
    ALLOCATION_RATIO NUMBER )
    Thanks
    EBV

    In regards to #3, use the COLUMNS functionality of XMLTable instead of using Extract. Two simple examples are
    Re: XML Data - Caliculate fields
    Re: Extractvalue function not recognised

  • How to read an XML file from embedded PAR file?

    I have an XML file that has been included in the PAR file as a means of storage (instead of hosting it to a web server).  Is there a way to read this file from within a java iView?  I have tried various methods without much luck.  (I can't seem to locate the file in the portal repository like I could with htmlb's Image class.
    Any thoughts?
    Thanks

    Hi,
    try this one:
    File myxmlFile = new File(portalRequest.getPrivateResourcePath(),"Path/to/my/file/after/PORTAL-INF/myfile.xml");

  • How to read a text file from other machine???

    I have a text file located in local machine. I use th e code below to retrieve data from that particular text file.
    String realPath     = (String)getServletContext().getRealPath("");
    BufferedReader holsFile = new BufferedReader(new FileReader(realPath + "/webpages/holidays.txt"));My question is , how could I retrieve the records from the tsxt file if the file is located in another machine or webserver?
    Thanks for advanced.

    It's ok to be new.
    The answer is yes. (But I'll let you look in the javadoc to see which package it's in).
    Also it may be worth understanding that there is no such thing as a "function" in java, operations are termed "methods". To go further, you should realise that URL is a class not a "function" or method. The parentheses mean you're calling the constructor.
    HTH
    /k1

  • How to open an existing file from java

    Hi Guys,
    I have one problem Please help me in this.
    How to open file(i.e. file can be any type, it is may be image file, doc file or pdf file) using java.
    Even i tryed in one way but it is static way that is working in windows not for other OS.
    Code :
    import java.io.*;
    public class CmdExec {
    public static void main(String argv[]) {
    try {
         DataInputStream din=new DataInputStream(System.in);
         System.out.println("Enter File Path to Open");
         String fName=din.readLine();
         File file=new File(fName);
    Runtime.getRuntime().exec("rundll32 SHELL32.DLL,ShellExec_RunDLL " + file.getAbsolutePath());
    catch (Exception err) {
    err.printStackTrace();
    If any other way to do please tell me.
    Regards
    Siva Prasad

    Well, if the OS doesn't provide a mechanism to associate a file name with a certain program, there's nothing you can do.
    I don't know whether something like JDIC can help you - otherwise, you'd have to find the solution for each OS. What's inside the exec()'s parenthesisses is not a Java problem anymore.

Maybe you are looking for

  • Install windows 10 64 bit on windows 7 professional 32 bit.

    Hi. If I install the last build of windows 10 64 bit over windows 7 32 bit (formatting and not making the windows 7 to windows 10 update with windows update) then I'll have windows 10 for free or not? Thanks.

  • Preventing the creation of direct PO

    Hi there experts, I would like to know if there is some way to prevent the creation of direct PO. I want that the PO is always created with reference to a PR or a contract. Tanks in advance

  • FI Prerequisites for HR(PY)

    Hi Experts, Although i am aware that we need the following FI configs in place before starting with the HR & Payroll like Chart of Accounts, Cost Centers for Payroll Postings G/L Accounts for Payroll But what are the Other areas of FI that are to be

  • Main vi freeze after close sub vi

    Dear all, I call a sub vi from my main vi but when i close sub vi, the main vi become freeze. The sub vi is a vi i used to edit a data from my database, its close after execute a query. Freeze also happen if i close the sub vi with [x] in the corner

  • I've imported a Garage Band project but the instruments seem to be in a different key to the vocal. Any ideas why?

    I did a project in Garage Band but want to finish and mix it in Logic Pro. The vocals are in the right key but the instruments (guitars and bass) are in another key. I did the project originally in C, then changed it to D in Garage Band and recorded