How do I add data to an existing file, without having to create a new one?

Hi,
I made a servlet which is supposed to write the word "new" in a file everytime the server creates an instance:
File chatInfos = new File("LOCATION_OF_THE_FILE/infos.dat");
   if(chatInfos.exists()) {
    try {
    FileOutputStream fos = new FileOutputStream(chatInfos);
    ObjectOutputStream os = new ObjectOutputStream(fos);
    os.writeObject("new");
    os.close();
    fos.close();
    } catch(IOException e){};
   }But it doesnt work. It seems like that every time the old file is destroyed and a new one is created. But I dont want that. I simply want to add a new object to the file.
thanx

http://java.sun.com/j2se/1.4.1/docs/api/java/io/FileOutputStream.html#FileOutputStream(java.io.File, boolean)
Kind regards,
Levi

Similar Messages

  • How can I remove one device without having to create a new sync key?

    I had to hand in a laptop at work but forgot to de-register the device. Is there anyway I can remove this one device from my sync account without having to create a new sync key and add all of my machines back?

    That changes the password but it keeps the same sync'd machines active. That laptop probably has not been turned on in weeks but it still shows up on Firefox Home even though I changed the password on the machines that I still have (the old laptop still has the old password but it still shows up as do the machines that I have not changed the password on yet.) I'm not trying to prevent that machine that I no longer have to sync with my data - I erased it - I just want it to be removed from Firefox Home on my iPhone.

  • How do I download all my songs from iCloud without having to click on each one?

    I have two computers and I would like to have my iTunes library on both. How do I download all my songs from iCloud without having to click on each one?

    Create a smart playlist with the criteria being location - not on this computer. Then select all, right click and download.

  • HT1414 My iPod has the IOS 5.1.1 OS and I can't download some apps because the operating system is too old. How can I upgrade my iPod without having to buy a new one?

    I have an iPod Touch that has the IOS 5.1.1 and I want to update my OS without having to buy a new device. How can I do this? I have logged into ITunes, backed up my device and it says my device is up to date, but now I can't reload my Facebook App because it says I need IOS 6.0 or higher. Does anyone have any suggestions?

    To more easily find compatible apps:
    iOSSearch - search the iTunes store for compatible apps.
    Apple Club - filter apps by iOS version.
    App Store: Downloading Older Versions of Apps on iOS - Apple Club

  • When a new hard drive was installed in my imac, photobooth asked me to choose my existing photo booth library or create a new one. My existing one is there, but I can't select it.

    My hard drive recently had to be replaced, and I just got my computer back with successful data recovery. When I opened Photo Booth, I was prompted with the following: 'Photo Booth could not locate your photo library. Please choose an existing library, or create a new one in order to continue using Photo Booth. This photo library will be used the next time you open Photo Booth.'
    I navigated to my regular photo booth library in my hard drive, but it wouldn't allow me to select it. I then tried opening and updating iPhoto including upgrading my library. I imported my old Photo Booth Library as well. Everything works! I should be allowed to use the same folder as before, instead of creating a "Photo Booth Library #2" or something. Any Ideas?

    Repair permissions ...
    Launch Disk Utility located in your Applications / Utilities folder
    Select the startup disk on the left then select the First Aid tab.
    Click:  Repair Disk Permissions
    This can take a few minutes so don't be alarmed. 
    Restart your Mac when it's finished then try PhotoBooth.

  • How do you deactivate or turn off an @me email address and create a new one

    My @me email address is slammed with spam.  I get so much everyday it crowds out important emails. How do you shut off an icloud email address and create a new one? Do I need to create a new apple ID?

    You can create a new @icloud.com email address to use that will deliver email to your current inbox, as explained here: http://help.apple.com/icloud/#/mm6b1a490a.  Then you can set up an email rule at icloud.com to send email sent to your @me address to the trash, where it will be deleted after 30 days, or to your spam folder, as explained here: http://help.apple.com/icloud/#/mm6b1a3f8a.

  • How to add Digital signature in existing file without using save as option?

    Hi,
    I am using Adobe acrobat x pro for editing pdf documents from sharepoint, it's working fine but when i am trying add digital signature it shows me save as diloug box which i don't need because I want to edit that file directly on server location.
    plz help me to resolve this problem!!
    thanks
    Amjad

    When a signature is applied in Acrobat/Reader, it forces a Save As. Otherwise it can't work.

  • Using Yahoo, how to send an e-mail to multiple receivers without having to click on each one individually

    When I try to send/forward e-mail to multiple receivers, I choose the category, use ctrl, select the names and click "send e-mail to these contacts." When I return to the e-mail, the contacts are not listed.
    What am I doing wrong?
    Betty Spraker

    Hi,
    Creat the following internal table
    DATA: i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE.
    Pass the values to this internal table as follows
    i_reclist-receiver = '<give ur mail id>'.  "SAPoffice: Name of the recipient of a document (also ext.)
    i_reclist-rec_type = 'U'.                              "Specification of recipient type
    *U = INTERNET ADDRESS,
    *B = SAP USER,
    *P = PRIVATE DISTRIBUTION LIST,
    *O = SAPOFFICE USER,
    *R = SAP user in another SAP System
    *X = X400 ADDRESS
    *C = SHARED DISTRIBUTION LIST
    APPEND i_reclist.
    Pass the internal table to the Tables parameter of 'receivers'
    receivers = i_reclist
    Regards,
    Chandu

  • I downloaded the Office program for my Mac, and my computer had to be reset, and now the program is gone. How can I get it again without having to buy a new one?

    Please help. The program is so expensive, and I do not have the money to buy it all over again.

    If you have Office for Mac 2011, you can re-download it here:
    https://www20.downloadoffice2010.microsoft.com/macdl/registerkey.aspx?ref=macdl& culture=en-US
    You'll just need your original product key which would have been provided to you when you originally purchased it.
    If you don't have the original product key, you might be able to track down your purchase info here:
    https://buy.officeformac.com/store/msmacus/DisplayCustomerServiceOrderSearchPage ?resid=UaygTQoBAlkAAG1-bHUAAAAA&rests=1370267725336

  • How do i add data from database to JTable ! Urgent

    How do i add data from database to the columns of JTable?.

    hi,
    Thanks for ur link. but this is just a part of my application which i am developing user interface in swing package for which i want to know how to show data to user in the table format where by table input data will be from the database. say something like todays activity is shown to the user in table format... So u have any idea of how to do this...

  • How do i add information to an existing document

    how do i add information to an existing document

    Not sure what you mean.  What application are you trying to use?

  • I am unable to add Data element into existing Data Type

    Hi Experts,
    I am unable to add Data element into existing Data Type, It shows disable mode, suggest me this..
    Thanks

    Yep got it...
    Edited by: Manoj on Aug 20, 2008 1:09 AM

  • How do I add time capsule to existing network?

    How do I add time capsule to existing network?

    Ok.. I am still confused as an Express only has one ethernet for LAN not 4. So you perhaps have an extreme..
    If you have an airport extreme.. plug the TC into the extreme with ethernet.. and set it up as bridge in router.
    You can also create a wireless network that works alongside the extreme.. this is the best way.
    It is also possible to setup the TC to extend the wireless of the extreme.. but this will make backups much slower.. at least half the speed if not worse.

  • How do I add dates from a web page into iCal?

    Hello. I would love to find a way to input dates from a web page, into iCal as an event. Right now, if there is a conference or whatever that is on such and such a date, I have to keep the web page open that has the dates and time, and then open iCal, and create a new event on that date, etc. Is there a way to highlight said dates on a web page, run some automation, and voila, it is a new event in iCal?

    Don't double tap. Just try pressing on the text. That should highlight it.

  • How do you read data from a text file into a JTextArea?

    I'm working on a blogging program and I need to add data from a text file named messages.txt into a JTextArea named messages. How do I go about doing this?

    Student_Coder wrote:
    1) Read the file messages.txt into a String
    2) Initialize messages with the String as the textSwing text components are designed to use Unix-style linefeeds (\n) as line separators. If the text file happens to use a different style, like DOS's carriage-return+linefeed (\r\n), it needs to be converted. The read() method does that, and it saves the info about the line separator style in the Document so the write() method can re-convert it.
    lethalwire wrote:
    They have 2 different ways of importing documents in this link:
    http://java.sun.com/docs/books/tutorial/uiswing/components/editorpane.html
    Neither of those methods applies to JTextAreas.

Maybe you are looking for

  • Cant put songs on ipod

    *+i have an ipod mini and cant find the original set up cd that came with it if a cd came with it. our computer has recently been updated and when we got our computer back i lost my ipod file. my mum loaded a a newer version of itunes on our computer

  • IPod will not mount!!

    I'm having huge difficulties with my iPod 4g 20 gb. I own one emac (running tiger) and an imac (running jaguar). I hardly ever use my iPod with the imac but i decided to try it out and listen to the iPod straight through the imac speakers while worki

  • Send a mail if no file in Sender File Adapter

    Hello guys, I have one doubt. I have a sender File adapter with FTP transfer protocol. I want to pull the file every 24 hours. If the file does not exist, there is any way to have an error and send a mail to the client? Is a requierement to do one in

  • How to identify reports that are using a specific universe object?

    Any idea how to use BO Auditor or Metadata Manager to identify webi reports that are using a specific universe object or universe prompt in the report SQL?

  • Migrating from older Flash Pro versions causes Auto Formatting to malfunction

    I have recently upgraded my Flash CS4 to Flash CS5 on my MAC, and Flash CS5 to Flash CS5.5 on my PC, these upgrades are causing the Flash Auto Formatting feature to malfunction, it somehow becomes a tool that breaks my code and causes errors while ex