Wrap a file into one class

Hello,
I want to wrap a file into one classe, how can I do that?
For example:
class fileWrapper {
one buffer for file content(what kind of buffer here?)
Thanks a lot
Grace

The following is not a buffer but I hope it could be of some use.
import java.io.*;
public class FileWrapper {
    java.io.File file;
    FileWrapper(java.io.File f) throws java.io.IOException{
       this.file =f;
    FileWrapper(java.lang.String fname) throws java.io.IOException{
      this(new java.io.File(fname));
    // .. next is an example of a method ... You can define other useful methods
    public String readLines() throws java.io.IOException{//read all lines as a String object
       java.io.BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(this.file),"UTF8"));
       StringBuffer buffer = new StringBuffer();
       String temp=null,newLine=System.getProperty("line.separator");
       while((temp=reader.readLine())!=null){
           buffer.append(temp).append(newLine);
       reader.close();
       return String.valueOf(buffer);
/*public static void main(String[] args) throws java.lang.Exception{
  FileWrapper fw = new FileWrapper("test.txt");
  String str = fw.readLines();
  System.out.println(str);
}

Similar Messages

  • How to zip multi files into one zip file in ABAP

    hi all:
    As you know, ABAP has CL_ABAP_GZIP class to support zip file function. But it only support one file zip. If I want to zip two files into one zip file, how to do it?
    thanks.

    Hi,
    <li>If you know how to zip one file,  to zip two files , you can follow the below steps.
    DATA:g_zipper     TYPE REF TO cl_abap_zip.
    "create our zipper object
    CREATE OBJECT g_zipper.
    "add 1st file to zip
    CALL METHOD g_zipper->add
       EXPORTING
         name    = file_name
         content = content_x.
      "add 2nd file to zip
    CALL METHOD g_zipper->add
       EXPORTING
         name    = file_name
         content = content_y.
    "save zip
    CALL METHOD g_zipper->save
       RECEIVING
         zip = zip.
    Thanks
    Venkat.O

  • How to package other jar files into one jar?

    How to package other jar files into one jar? How can i get the class in the inner jar file?

    Generally not a good idea. The Java runtime won't be able to load classes from those "inner" jars, you'd have to write your own classloader to do that. It's not a brilliant idea, generally, anyway, since the point of having lots of jars is to keep your application modular. Bundling them all together like that means you have to re-deploy the whole thing to fix, for instance, one small bug in one small library
    If you really want to do this, there's an Eclipse plugin called FatJar, but I urge you to consider whether you really want to do it first.

  • How do I import multiple Ai files into one Indesign File - whilst still keeping the Ai Files editable and up dateable for the one Indesign File?

    Hi All,
    Im relatively new to Ai and Indesign, and have been doing Uni work over Christmas, and have a rather urgent question thats stressing me out.
    I originally had many art boards in my ai file, but due to the number, I split these into single files to help my computer run better.
    Now I want to organise them into one document to save. From searching online Indesign can import these and save as one file, yet automatically update if the original ai file is updated. I would like to do this but just don't know how to do this correctly?
    Any help would be greatly appreciated.
    Im using CC Ai and indesign.
    Thanks in advance
    Sam

    Yes, effectively I would like to catalogue the files into one collection so i can save as one PDF and Print as one.:)
    I know I could save each AI as a pdf them then merge the pdf's together in acrobat, but I have nearly 100 files so would feel more comfortable seeing them all together before print / saving.
    My concern is that if I insert them in Ai, will the file resolution reduce? and will the ai still be editable and would it update the indesign file?
    Thanks for the quick reply

  • How can i use JWSDP1.6 from Ant tool to convert .wsdl file into Java class

    Hi All,
    i m very new in the development field.plese help me...
    i have a .wsdl file and i have to make some modification in the file and return this file with build file used in Ant tool.
    means my requirement is to conver the .wsdl file into java class,modify it and convert back to wsdl file.how can i do it using JWSDP1.6 and Ant tool.
    thanks in advance...
    Vikram Singh

    lemilanais wrote:
    hello!
    I have developpe an animation with flash. before give it to othe person in order to use it, i would like to secure it by integrated a security module inside the software.Secure it from what? Being played? Copied? Deleted? Modified?
    Because, i am a java developper, i have choose Netbeans 6.1 to secure it.That has to be the most random thing I've read in some time.
    do you know how can i do to integrate my animation .swf inside my java class?Java can't play SWF files and Flash can't handle Java classes, so what you're suggesting here doesn't make a lot of sense.

  • How do I combine several pdf files into one so I can send them as one file.

    how do I combine several pdf files into one so I can send them as one file

    Reader doesn't have that ability. You would need Acrobat.

  • How do I combine several PDF files into one?

    I have renewed Adobe subscription and would like to combie several PDF files into one. I was able to do this last year, but can no longer combine files. What am I doing wrong? Step-by-step answer, please. Thank you.
    Marilee

    As TSN has indicated we have no idea what program you are using, other than you posted in the Acrobat forum. In Acrobat you go to File > Create > Combine (varies with version of Acrobat). You can also open one and then use the pages>Insert to add the others.

  • How do I combine two PDF files into one?

    I want to merge two PDF files into one to make things easier when I take the file(s) to a professional printer.
    Can I do this in Preview?
    Thanks.

    You can't do in Preview.
    You can combine individual PDFs into one PDF using one of these freeware utilities.
    PDFMergeX @ http://www.malcom-mac.com/blog/pdfmergex/
    joinPDF @ http://www.macupdate.com/info.php/id/16604
    Combine PDFs @ http://www.monkeybreadsoftware.de/Freeware/CombinePDFs.shtml>
    PDFLab (join & split) @ http://pdflab.en.softonic.com/mac
     Cheers, Tom

  • How do i merge two pdf files into one

    How do i merge 2 pdf files into one.

    Open up the first pdf in Preview
    Then from Menu
    select from Edit Menu
    Select Insert (your choice of)
              Page from Scanner
              Page from File (select your PDF file)
              Blank Page
    You can then save as your first file or rename it

  • How to import multiple XML files into one inDesign document without copy/paste ?

    I use InDesign CS6, and I have several XML files with the same structure. Only the data are different.
    I created  an Indesign layout with some tagged placeholder frames on merge mode, for automated layout.
    Today for each XML file I have to create a new InDesign document to import the XML. Everything works fine. Then in order to have all Indesign layouts one after the other into a single Indesign layout, I have to use the copy/paste function.
    I mean for example, copy the contents of all documents to the first one. Or add pages of other documents to the first one, then delete spaces between each page.
    So my question is the following:
    How to repeat this process without copy/paste function, knowing that the
    number of XML files could be unknown.
    Thank you very much for your answer.

    Yes, effectively I would like to catalogue the files into one collection so i can save as one PDF and Print as one.:)
    I know I could save each AI as a pdf them then merge the pdf's together in acrobat, but I have nearly 100 files so would feel more comfortable seeing them all together before print / saving.
    My concern is that if I insert them in Ai, will the file resolution reduce? and will the ai still be editable and would it update the indesign file?
    Thanks for the quick reply

  • Joining multiple inDesign files into one, can you solve this?

    OK so basically I work at a magazine, the creative's all work on separate spreads so all the inDesign files consist of between 1 and 10 pages then usually they are all spat out in there sets of PDF's and sent to the printers.
    Now I want to do an online addition of the magazine with the new SWF export feature in inDesign CS4 but I'm wondering how can you easily compile all of the separate inDesign files into one so that it can spit out one single swf with all 200 pages with the page peel effect?
    Is there even a way without a mass of work of manually adding all the pages into one file, that would be absolutely humongous? Anyone with any suggestions how to make this process the simplist and with the least amount of labout would be an absoulute legend, I have little time to spend on this which sucks so looking for the best and fastest possible way that we could do it each month.
    Cheers
    J

    I migth have a kind of solution for you. I have made a solution named eDocBrowser. (I called it Magazine Browser in earlier threads here and couple of other forums). It´s a collection of files that you publish with you SWF-files you have exported from InDesign. With eDocBrowser, you can put several SWF-files together and end-user can use them almost as one single SWF. Heres little demo I made just few minutes ago.
    http://www.prepress.fi/eDocBrowser/
    There are 3 SWF-files, all of them exported from InDesign. They are originally separate indd-files. When you reach last page of Document1, small arrow appears, and text "Jump to next file" and name of the next file too. You can go there also by using next-button at the bottom right corner, one that you use normaly to go next page. Same kind of arrow appears also when you are in first page of document 2 or 3 etc... with it you can go back to earlier documents last page etc... All the documents can be seen also in a drop-down menu at top of the screen. Labels of that menu are customizable.
    Theres also a zoom. When you clic zoom+ button, your cursor changes to magnifying glass. With zoom- you can go back to normal view.
    Additional features are FullScreen-view, Printing current spread and customizing user interface, buttons and logo at the top-left corner. Text search is very exprerimental and requires indd-file indexing with script we have made too. It indexes every single word in indd-document to XML-file and put pagenumbers there too. eDocBrowser searches that XML-file and gives all the hits to small result window. Hits are also links to page where they point...Search is not in use with this demo..
    There is a small help-section in top-right corner...
    We also have a script called eDocMaker. It does everything for you. You just have to have indd-files in one folder. Script asks location of that folder when you run it. It also askes you which resolution you want to use with images, anything goes between 72-2400 (72ppi is indesign´s default resolution for SWF-export, using bigger resolution might cause bigger SWF-files, but images look better when zoomed)
    Price of the single licence of eDocBrowser will be 80euros (aprx. 100dollars). With it you may install one copy of eDocBrowser into your server and use as many SWF-files there as you want. There is no search feature in single version.
    Price of unlimited licence is 300euros (aprx.400dollars) With it you may install as many copies of eDocBrowser as you like. With it you also get all the indesign scripts including eDocMaker with resolution booster, search indexer etc. + goodies like user interface and button templates, indesign effect (3D spine graphic etc)....
    Product is about ready, we are just setting up a place to sell it. Now it seems that we are going to use a service called payloadz.com....
    Additional info: petteri.paananen[at]NOSPAMprepress.fi (replace [at] with @ and remove NOSPAM)

  • How do i merge multipule pdf files into one file?

    how do i merge multipule pdf files into one file?

    One method:
    Open Acrobat XI Pro - use this "click path":
    File :: Create :: Combine Files into a Single File
    Be well...

  • How do I merge 2 pdf files into one file?

    How do I merge 2 pdf files into one file?

    I use PrimoPDF (free download) to create pdf files. To merge two docs/pdfs/etc., print the first to a new pdf using Primo. Close it, then print the second and save it to the same new pdf. Primo gives you the option to 'append' or 'overwrite' the original file. By using 'append', you are just adding it to the back of the existing file. You can do this repeatedly to resort or combine existing pages into a new pdf.
    Also, I'm using Adobe Reader X.

  • How to merge many XML files into one?

    Hi: I got a small project to combine many XML files into one and convert the combined XML file in Excel using AppleScript. My XML files look like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <Metadataobject>
        <from>[email protected]</from>
        <jobname>B3_IM09MBDUF</jobname>
        <pages>2</pages>
        <priority>3</priority>
        <timezone>CEST</timezone>
        <year>2013</year>
        <month>7</month>
        <day>15</day>
        <hour>11</hour>
    </Metadataobject>
    and like this...
    <?xml version="1.0" encoding="UTF-8"?>
    <Metadataobject>
        <from>[email protected]</from>
        <jobname>P1_FR1330G006007_Kate_van der Vaart</jobname>
        <pages>2</pages>
        <priority>1</priority>
        <timezone>CEST</timezone>
        <year>2013</year>
        <month>7</month>
        <day>12</day>
        <hour>16</hour>
    </Metadataobject>
    I get many XML files like this. And I want them to be combined and shown like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <Metadataobject>
        <job id="1">
        <from>[email protected]</from>
        <jobname>B3_IM09MBDUF</jobname>
        <pages>2</pages>
        <priority>3</priority>
        <timezone>CEST</timezone>
        <year>2013</year>
        <month>7</month>
        <day>15</day>
        <hour>11</hour>
        </job>
        <job id="1">
        <from>[email protected]</from>
        <jobname>P1_FR1330G006007_Kate_van der Vaart</jobname>
        <pages>2</pages>
        <priority>1</priority>
        <timezone>CEST</timezone>
        <year>2013</year>
        <month>7</month>
        <day>12</day>
        <hour>16</hour>
        </job>
    </Metadataobject>
    And finally the combined XML file converts in Excel sheet with column headings "Job ID", "From", "Job Name" and so on...
    Or there is another best way to get the same result...
    Thanks

    That is just an intermediary state to get to the excel version. Actually I get many small XML files (as shown above) from client and I want them all combined in an excel sheet with common column headings... like this...
    from
    jobname
      pages
    priority
    timezone
    year
    month
    day
    hour
    id
    [email protected]
    B3_IM09MBDUF
       2
    3
    CEST
    2013
    7
    15
    11
    1
    [email protected]
    B3_IM09MBDUF
       2
    3
    CEST
    2013
    7
    15
    11
    2
    Thanks for your response.

  • "In Adobe Standard, when combining files into one pdf, how do I keep the original date"?

    I converted multiple emails into a pdf file.  After opening the pdf file, I wanted to combine the files into one pdf however once combining the files, the date modified of the files changes to the current date.  How do I preserve the original dates of the emails when combining the files?

    Hi Softball ,
    Thank You for posting on the forums. Apparently there is no such feature that would help you to achieve this.
    Thanks,
    Vikrantt Singh

Maybe you are looking for

  • JCONTROL - dies with Error while connecting to DB

    Hi....Experts DB : Oracle 10.2.0.4.0 OS ; AIX 5.3 NW : 7.0 SP22 UT  : EP Yesterday the above server got rebooted by a power failure. after that The server's DB is coming up as ora<sid> user, listener is also up But as <sid>adm user - when i am starti

  • Error During Releasing of Billing Document to Accounts Department

    Hi, Kindly help me, we have just finished the upgradation from 4.6 version to 6 version. when we are releasing the billing document to accounts department error message is coming like this. No entry has been made in the assignment table for condition

  • Put the same form layer over identical pdf's

    Hi All, At first sight I couldn't find a topic which describes what I would like to do. We are using a printed PDF as a checklist / customer service report for our projects. This PDF has always the same structure, and is automaticaly generated via ou

  • Directive.include with dynamic variable

    How would I put a variable I have called ${includeFile} into an include directive below? I tried <jsp:directive.include file="${includeFile} " /> And this did not work...

  • REUSE_ALV_GRID_LAYOUT_INFO_GET!!

    Hi, This Fm works fine in foreground and returns the relevant fieldcatalogue ( with no_out and tech updated) but when i call the same FM in background it doesn't give me all those columns which are hidden with no_out and tech field updated in i_field