Best method to handle the content of several files into only one ?

Hi all,
I am currently looking for the best solution to handle several file contents into a unique file, like a sort of archive. The goal is to develop a desktop application based on an API providing file encryption/decryption into a "box". I need to have a single file because I want to make it easy to travel on network, removable medias, etc. I found some solutions but lets say I'm starting from scratch, I don't want to influence your answers.
So, for you, what is the best solution ?
Look forward to getting your help

BalusC wrote:
Indeed, check the java.util.zip API. http://www.google.com/search?q=java.util.zip+api+javase+site:sun.com
Also see http://java.sun.com/developer/technicalArticles/Programming/compression/
Lots of sample code.

Similar Messages

  • Get the content of a file into a array

    Hy to all!I have txt file with the following content : 0 1 1 0
    1 1 1 0
    0 0 0 0. I want to extract the values to a bi-dimension array,like this: a[0][0] = 0,a[0][1] = 1,a[0][2] = 1....and so on.
    Anybody could give a little help.THX

    The first thing I can help you with is that this doesn't have anything to do with java serialization.
    Secondly, if you are new to java, the best forum is "New To Java" forum.
    Thirdly, make sure you have done a google search first for an answer because it is likely that many people have asked the same question before.
    The follow search gets over 2 million hits. [http://www.google.co.uk/search?q=java+read+content+of+a+file+into+a+array]

  • How to Display the content of Excel file into Webdynpro Table

    Hi Experts
    I am following the Blog to upload a file in to the webdynpro context,but my problem is after uploading a excel file i need to extract the content from that Excel file and that content should be displayed in the webdynpro table.Can any body please guide me how to read the content from excel and to Display in the Table.
    Thanks and Regards
    Kalyan

    HI,
    Take for example, if Excel file contains 4 fields,
    Add jxl.jar to JavaBuild path and Use this snippet
    File f=new File("sample.xls");
    Workbook w=Workbook.getWorkbook(f);
    Sheet sh=w.getSheet(0);
    int cols=sh.getColumns();
    int rows=sh.getRows();
    Cell c=null;
    String s1=null;
    String s2=null;
    String s3=null;
    String s4=null;
    ArrayList al=new ArrayList();
    int j=0;
    for(int i=1;i<rows;i++)
    ITableElement table=wdContext.createTableElementz
         s1=sh.getCell(0,i).getContents();
         s2=sh.getCell(1,i).getContents();
         s3=sh.getCell(2,i).getContents();
         s4=sh.getCell(3,i).getContents();
                             table.setName(s1);
         table.setAddress(s2);
         table.setDesignation(s3);
         table.setDummy(s4);
         al.add(j,table);
         j++;                    
    wdContext.nodeTable().bind(al);
    Regards
    LakshmiNarayana

  • Move the contents of old file into another  before writing in applcn srvr

    Hi Friends,
    As per the requirement I need to move the contents of the previous file into an archieve folder which is being created by the previous run of the program in the application server.
    After the old file has been moved I need to craete the new file in the directory.
    So at any time only one file should be present in the application server.
    All the previous files will be in the Archieve folder.
    Please suggest how can I move the contents of the privious file in the archieve directory.
    Thanks and regards,
    Smriti Singh
    Please do not duplicate post
    Edited by: Rob Burbank on Feb 24, 2009 11:16 AM

    Hi Smriti,
    check this
    1) use the function module  'EPS_GET_DIRECTORY_LISTING' --- to gett the details of files n application dir
    eq.
    call function 'EPS_GET_DIRECTORY_LISTING'
        exporting
          dir_name               = p_file
        tables
          dir_list               = it_dir_list
        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.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    2) then use this code to archive
    open dataset w_file1 for output in text mode encoding default. "Open Backup File
      if sy-subrc <> 0.
        write: /1 ' error creating file with status - ', sy-subrc.
        exit.
      endif.
      open dataset w_dirname for input in text mode encoding default."Open Real File
      if sy-subrc <> 0.
        error_flag = 'X'.
        write: /1 ' error opening input file with status - ', sy-subrc.
        exit.
      endif.
    *" To read the input file into a internal table
      do.
        read dataset w_dirname into inrec_lpcfab.
        if sy-subrc <> 0.
          exit.
        else.
          if not inrec_lpcfab is initial.
            append inrec_lpcfab.
            transfer inrec_lpcfab to w_file1 length 180.
          endif.
        endif.
      enddo.
      close dataset w_dirname.

  • Loading the Contents of a file into a JTable

    I am trying to load the content of a delimited (tab, comma, etc), into a JTable. The code is very simple and works for the most part. Here is some of it:
                   List tableRows = new ArrayList();
                   String lineItem = "";
                   InputStream in = new FileInputStream(fName);
                   InputStreamReader isr = new InputStreamReader(in);               
              BufferedReader br = new BufferedReader(isr);
         while((lineItem = br.readLine()) != null)
                        if(x == MAX)
                             break;
                        java.util.List rowData = new ArrayList();
                        StringTokenizer st = new StringTokenizer(lineItem, "\t");
                        while(st.hasMoreElements())
                             rowData.add(st.nextToken());
                        tableRows.add(rowData);     
                        x++;
    Basically, tableRows, ends up to be a List of Lists which I later use to populate the Object[][] for the JTable rows. This works perfect!
    My problem has to do with the tokenizer. In some situations, values in a line that is read contains "". For example an line read (quotes are showed only to distinquish values in the line):
    "item1", "item2", " ", "item4", " ", "item6", "item7"
    The tokenizer does not capture the " ". So instead of 7 tokens, it only sees 5.
    My question is, can someone tell me a better approach for tokenizing the string so that it captures everything?
    Thanks in advance,
    Augustine

    I am trying to load the content of a delimited (tab, comma, etc), into a JTable. The code is very simple and works for the most part. Here is some of it:
                   List tableRows = new ArrayList();
                   String lineItem = "";
                   InputStream in = new FileInputStream(fName);
                   InputStreamReader isr = new InputStreamReader(in);               
              BufferedReader br = new BufferedReader(isr);
         while((lineItem = br.readLine()) != null)
                        if(x == MAX)
                             break;
                        java.util.List rowData = new ArrayList();
                        StringTokenizer st = new StringTokenizer(lineItem, "\t");
                        while(st.hasMoreElements())
                             rowData.add(st.nextToken());
                        tableRows.add(rowData);     
                        x++;
    Basically, tableRows, ends up to be a List of Lists which I later use to populate the Object[][] for the JTable rows. This works perfect!
    My problem has to do with the tokenizer. In some situations, values in a line that is read contains "". For example an line read (quotes are showed only to distinquish values in the line):
    "item1", "item2", " ", "item4", " ", "item6", "item7"
    The tokenizer does not capture the " ". So instead of 7 tokens, it only sees 5.
    My question is, can someone tell me a better approach for tokenizing the string so that it captures everything?
    Thanks in advance,
    Augustine

  • How to store the content of a file in oracle table.

    Hello,
    I have a .xml file in unix , how can i upload the content of that file into a column of a table in oracle?

    Did you look at the link posted in response to the OP? At a quick look, it seems fairly reasonable to me.
    John

  • Error in Raising exceptions in a method and handling the same in the WF

    Hi All
    I tried to implement Raising exceptions in a method and handling the same in the workflow
    in the same way given in SAPtechnical site .
    1.by adding a error msg in exception parameter .
    2. if the select query fails, to fetch the agent then :exit_return 9001 'ztable name' space space space.
    3.in the Background activity in which this method is called there automatically one outcome appears ,and I hav acitvated that outcome and in that done what need to be done for that error handling - just send a mail to concern person .
    4. in the normal outcome of the activity , the step to be executed are there .
    but its not working , if exception come then the WF stuck there only . it do not follow the exception outcome .
    Kindly help me , How can I do the exception handly in WF.
    thanks & Regards
    Kakoli

    > That is usually the case - you catch an error in the underlying program and pass that back so the workflow can go into error.
    > You're doing it correctly.
    I don't think that's quite right.
    If you define an error/exception in a method, it is automatically mapped to an outcome of the step/task.
    If you activate that outcome, then you can handle the exception in a branch of the workflow.
    For example: 'Remote connection is down, please contact Basis'
    The step should only go into error if an outcome occurs that you have NOT activated.
    So the original question is valid. Please give some more information on what the error message is..
    chrs
    Paul

  • What is the Best Method to move the Applcations to a New Server Setup

    Hi All...
    Happy Christmas...
    Advanced Happy New YEAR 2009...
    We are using oracle Apex 3.1 on Database base oracle 10g Rel2 across Server 2000 platform,
    Made a New Installationof Oracle Apex 3.1 on HP-Unix PA-RISC and database is oracle 10g Rel2(New Server),
    Sucessfully...
    my Question is
    what is the Best Method to move the Applcations to a New Server ?
    1) Using Export/Import option .can I move the Applications/ Reports to New Server?
    2) Is it possible By Taking Application level Export and Import to the new Server?
    3)Do I need to create the Workspace as similar to old Server then Move the ApplicationS?
    or taking the Application EXPORT/IMPORT also imports the Workspace?
    (OR)
    Do I need to import the Database tables taking table level Dumps as well?
    THANKS ALOT in Advance
    MKZ
    Edited by: Z on Dec 31, 2008 12:10 PM
    Edited by: Z on Dec 31, 2008 12:57 PM

    Hello:
    You pretty much have it right. Here's what I do to move applications between APEX installations.
    1) Export/Import Workspaces
    2) Export/Import Applications for each workspace. (I retain the source application id in the target)
    3) Export/Import Workspace Images/Files etc
    4) Use Oracle exp/imp , Oracle DataPump or plain old sqlplus scripts to move database objects from source to target.
    Varad

  • How to handle the contents of a carousel

    Hi,all
    Now I have a trouble in how to handle the contents of a carousel.
    I use codes below:
              locator=(PMTElementaryStream es).getDvbLocator();
              serviceDomain.attach(locator);
              dsmccObject=new DSMCCObject(serviceDomain.getMountPoint().toString());
              file=new File(serviceDomain.getMountPoint().toString());
              content= file.list();
    to get some file or directories, such as *.png, *.class, *.mpg, xml, MHPdataloader, sport, and so on.
    How can I do for next procedure.
    Thank you.

    What do you want to do next? You can create a DSMCCObject that refers to one of the files in your carousel, and use this to control the loading and caching of that file. To actually read a file, however, you will need to create a FileInputStream or RandomAccessFile that refers to that file. You can then use this like any other file access.
    This may help you:
    // create a new ServiceDomain object to represent
    // the carousel we will use
    ServiceDomain carousel = new ServiceDomain();
    // now create a Locator that refers to the service
    // that contains our carousel
    org.davic.net.Locator locator;
    locator = new org.davic.net.Locator
      ("dvb://123.456.789");
    // finally, attach the carousel to the ServiceDomain
    // object (i.e. mount it) so that we can actually
    // access the carousel.  In this case, we don't specify
    // the stream containing the carousel in the locator, so
    // we pass in the carousel ID as part of the attach
    // request
    carousel.attach(locator, 1);
    // we have to create our DSMCCObject with an absolute
    // path name, which means we need to get the mount point
    // for the service domain
    DSMCCObject dsmccObj;
    dsmccObj = new DSMCCObject(carousel.getMountPoint(),
      "graphics/image1.jpg");
    // now we create a FileInputStream instance to access
    // our DSM-CC object.  Alternatively, we could create
    // a RandomAccessFile instance if we wanted random
    // instead of sequential access to the file.
    FileInputStream inputStream;
    inputStream = new FileInputStream(dsmccObj);
    // we can now use the FileInputStream just like any
    // other FileInputStream

  • Which is best method to improve the performance

    Hi,
    I have one scnerio, to meet this requirement i have two methods
    My requirement is to get the data from multiple tables, so i am developing a query based on joins and this query may give approx 80000 rows.
    To meet this requirement i have two methods.
    I have confusion which is the best method to improve the performance.
    Method #1
    for i in <query>
    loop
    end loop;
    Here we are retriving row by row(80000 rows) from data base and applying our logic
    Method #2
    By using the BULKCOLLECT at a time we are getting all the rows(80000 rows) into plsql table.
    then loop is based on plsql table
    for i in 1..plsqltable.count
    loop
    end loop;
    Here we are retriving row by row(80000 rows) from plsql table instead of going to data base.
    Can any body please suggest which is the best to improve the performance

    Using BULK COLLECT will give you better performance with a large data set because there will be reduced IO with this method versus the traditional CURSOR FOR LOOP. Database Admin's (DBAs) typically don't like BULK COLLECT because developers tend to forget to limit the number of rows returned by the BULK COLLECT operation so it could use up too much memory. Take a look at DEVELOPER: PL/SQL Practices On BULK COLLECT By Steven Feuerstein for some great tips on using BULK COLLECT. Another good Feuerstein article is: Bulk Processing with BULK COLLECT and FORALL.
    As others have mentioned, you should have posted your question in the PL/SQL forum. ;)
    Hope this helps,
    Craig...

  • The best method to manage, or organize my iPhoto files

    the best method to manage, or organize my iPhoto files
    Mine are always a mess.

    This has nothing to do with iPhoto. You can not organize photo files if you use iPhoto. To organize files you need to choose a different program
    IPhoto is a database that manages photos and you never see or use thebfiles. You always use iPhoto the do any organization or changes
    In iPhoto you organize using albums and folders. The iPhoto tutorials are a great place to start learning hopes to ipuse it
    LN

  • How To Fetch the Content of a File from Client's PC?

    In my JSP I have this:
         <input type="file" name="filename">for visitors of the web page to browse their PCs' directories to select a file to upload (when the Submit button is clicked).
    What appears in the text field will be a file name. How do I get both the file name and the content of that file to be saved in the database?

    From http://www.htmlhelp.com/reference/html40/forms/input.html:
    A form that includes a file INPUT must specify METHOD=post and ENCTYPE="multipart/form-data" in the <FORM> tag. CGI libraries such as CGI.pm allow simple handling of such forms.
    Form-based file upload is unsupported by many currently deployed browsers. Authors should provide alternative methods of input where possible.
    The following example allows the user to upload an HTML document for validation:
    <FORM METHOD=post ACTION="/cgi-bin/validate.cgi" ENCTYPE="multipart/form-data">
    <P>Select an HTML document to upload and validate. If your browser does not support form-based file upload, use one of our alternate methods of validation.</P>
    <P><INPUT TYPE=file NAME="html_file" ACCEPT="text/html"></P>
    <P><INPUT TYPE=submit VALUE="Validate it!"></P>
    </FORM>
    Your servlet would then have to process whatever data is put into that parameter. You can look at O'Reilly's servlet utilities, or one of the other other links here:
    http://www.google.com/search?q=java+servlet+file+upload&sourceid=opera&num=0&ie=utf-8&oe=utf-8

  • How to read the contents of XML file from my java code

    All,
    I created an rtf report for one of my EBS reports. Now I want to email this report to several people. Using Tim's blog I implemented the email part. I am sending emails to myself based on the USERID logic.
    However I want to email to different people other then me. My email addresses are in the XML file.
    From the java program which sends the email, how can I read the fields from XML file. If any one has done this, Please point me to the right examples.
    Please let me know if there are any exmaples/BLOG's which explain how to do this(basically read the contents of XML file in the Java program).
    Thank You,
    Padma

    Ike,
    Do you have a sample. I am searched so much in this forum for samples. I looked on SAX Parser. I did not find any samples.
    Please help me.
    Thank you for your posting.
    Padma.

  • How to display the content from a file  stored in database

    when i am trying to display the content from a file which stored in database on oracle report 10g
    data are displaying as following. please help me to display the data in readable format
    <HTML LANG="en-US" DIR="LTR">
    <!-- Generated: 1/11/2006, postxslt.pl [1012] v1
    Source: amsug304286.xml
    File: amsug304286.htm
    Context: nil
    Tiers: ALWAYS
    Pretrans: YES
    Label: Release 12 -->
    <HEAD>
    <!-- $Header: amsug304286.htm 120.4 2006/11/01 20:57:29 appldev noship $ -->
    <!--BOLOC ug1_OMPO1010302_TTL--><TITLE>Product Overview (ORACLE MARKETING)</TITLE><!--EOLOC ug1_OMPO1010302_TTL-->
    <LINK REL="stylesheet" HREF="../fnd/iHelp.css">
    </HEAD>
    <BODY BGCOLOR="#F8F8F8">
    <A NAME="T304286"></A><A NAME="ProdOve"></A>
    <CENTER><H2><!--BOLOC ug1_OMPO1010302--><B>Product Overview</B><!--EOLOC ug1_OMPO1010302--></H2></CENTER>
    <p><!--BOLOC ug1_OMPO1010304-->Oracle Marketing drives profit, not just responses, by intelligently marketing to the total customer/prospect base. By leveraging a single repository of customer information, you can better target and personalize your campaigns, and refine them in real time with powerful analytical tools.<!--EOLOC ug1_OMPO1010304--></p>
    <p><!--BOLOC ug1_OMPO1006611-->With tools necessary to automate the planning, budgeting, execution, and tracking of your marketing initiatives, Oracle Marketing provides you with:<!--EOLOC ug1_OMPO1006611--></p>
    <ul>
    <li>
    <p><!--BOLOC ug1_OMPO1006612--><B>Customer Insight</B> - With sophisticated customer management and list generation, Oracle Marketing enables you to quickly generate target lists and segments using an intuitive user interface. The easy to use Natural Query Language Builder (NLQB) lets you query for customers or prospects using a natural language while hiding data complexity; fatigue management ensures that you do not over-contact the same customers with marketing messages; and predictive analytics helps you predict customer behavior that you can leverage to produce significant increases in marketing return on investments (ROI).<!--EOLOC ug1_OMPO1006612--></p>
    </li>
    <li>
    ls.<!--EOLOC ug1_OMPO1010304--></p>
    <p><!--BOLOC ug1_OMPO1006611-->With tools necessary to automate the planning, budgeting, execution, and tracking of your marketing initiatives, Oracle Marketing provides you with:<!--EOLOC ug1_OMPO1006611--></p>
    <ul>
    <li>
    <p><!--BOLOC ug1_OMPO1006612--><B>Customer Insight</B> - With sophisticated customer management and list generation, Oracle Marketing enables you to quickly generate target lists and segments using an intuitive user interface. The easy to use Natural Query Language Builder (NLQB) lets you query for customers or prospects using a natural language while hiding data complexity; fatigue management ensures that you do not over-contact the same customers with marketing messages; and predictive analytics helps you predict customer behavior that you can leverage to produce significant increases in marketing return on investments (ROI).<!--EOLOC ug1_OMPO1006612--></p>
    </li>
    <li>
    <p><!--BOLOC ug1_OMPO1006613--><B>Sales Alignment</B> - Oracle Marketing's leads management helps you compile and distribute viable leads so that sales professionals can follow up valuable opportunities and not just contact interactions. Additionally, support for distributing proposals and marketing material drive speedy and consistent setups and collaboration of best practices.<!--EOLOC ug1_OMPO1006613--></p>
    </li>
    <li>
    <p><!--BOLOC ug1_OMPO1006614--><B>Marketing Insight</B> - While Oracle Marketing Home page reports and Daily Business Intelligence (DBI) for Marketing and Sales provide aggregated management level information in almost real time, operational metrics help in tracking the effectiveness of individual marketing activities.<!--EOLOC ug1_OMPO1006614--></p>
    </li></ul>
    </BODY>
    </HTML>
    <!-- Q6z5Ntkiuhw&JhsLdhtX.cg&Zp4q0b3A9f.&RQwJ4twK3pA (signum appsdocopis 1162406236 2673 Wed Nov 1 10:37:16 2006) -->

    Hi,
    you can try to use the:
    <b>ConsumerTreeListPreview</b>
    layout for KM navigation ivew (or customize to your own).
    This layout shows a folder tree on the left, a document list on the right. When you click on a document from the list it shows the contents of the file on the bottom of the iview.
    Hope this helps,
    Romano

  • How to find the contents of a file that is suddenly empty

    I created a folder 2 months ago on the left hand side of the email under TRASH and then Under 2013. I have been loading it with emails (maybe 20-30 at last count) and all of a sudden the contents of the folder is gone. Once, when I clicked on it, it came back and I thought it was here to stay, but then everything in it disappeared again and I have not been able to find the contents for several days now. It is not in TRASH or 2013 - can't locate the emails anywhere. Just before this happened, it was no longer accepting emails from my inbox when I tried to transfer them over. I figured it had run out of space, and was ready to open a new file, but there is nothing there either. Any ideas?

    If you logon to webmail account via a browser, can you see the missing folders and emails?

Maybe you are looking for

  • Downloaded 11.1.3 and itunes wont open

    Just downloaded itunes 11.1.3 and now it won't open.  What to do?

  • [Solved] Very strange problem with kernel-modules & NTFS write speed

    I was getting very low copying speed when copying files to NTFS partitions, around 8-10 MB. But, when I commented the modules section in /etc/rc.conf file, the speed dramatically improved upto 5-6x. Now, it also created some problems for me. Like vbo

  • Call form in EBS with form personalization

    Hi all guru, i try to call a form (function in EBS) with the form personalization and pass it one parameter (P_PO_HEADER_ID) in new SPECIAL41 menu: 1) create new sequenze with condition "TRIGGER: special41" 2) create action Built-in, type "Launch a f

  • Macbook pro screen color vs. macbook's

    I have a macbook and yesterday i bought macbook pro and i realized colors on mbp screen is different with mb i prefer macbook screen colors how can i have it on my mbp please

  • RDP conn fails thru AnyConnect

    I have an issue that I believe IS NOT ASA or AnyConnect related, but I need to ask the support comm. just the same. ASA5510 8.2(5) OS; AnyConn Windows 2.5.2017 RDP PC client - Win7 Pro 64-bit I can make the VPN conn to the ASA I can ping any pingable