Loading multiple messages from disk?

Hey there!
I'm writing a mail app (isn't everyone these days?) which saves Messages in a file called mbox. When I want to load the Messages from the mbox into the app, I'm calling 'new MimeMessage((Session)null, inputStream) which reads the message. However, there are multiple messages in that file, and a single constructor call reads ALL the messages.
How do I make it read one message into one MimeMessage() successively?
here's the code. there are around 10 messages in the file, but they are all read in during the first 'new MimeMessage()'.
public static MimeMessage[] retrieveMessagesFromDisk()
     MimeMessage[] msgs = new MimeMessage[40];
     FileInputStream is = null;
     try {
          is = new FileInputStream("c:\\greatmail\\mbox");
     } catch (IOException e) {
          System.out.println("new FileInput IOException! "+e.getMessage());
     for(int count=0; count<40; count++) {
          try {
               msgs[count] = new MimeMessage( (Session)null , is);
               System.out.println("retrieveMessagesFromDisk: read message "+count+", "+msgs[count].getSize()+" bytes.");
          } catch (MessagingException e) {
               System.out.println("Message "+count+" construct MessagingException! "+e.getMessage());
               break;
     try {
          is.close();
     } catch (IOException e) {
          System.out.println("is.close() writeTo IOException! "+e.getMessage());
     return(msgs);

nobody has any idea?

Similar Messages

  • SQL Loader to Load Multiple Tables from Multiple Files

    Hi
    I wish to create a control file to load multiple tables from multiple files
    viz.Emp.dat into emp table and Dept.dat into Dept table and so on
    How could I do it?
    Can I create a control file like this:
    OPTIONS(DIRECT=TRUE,
    SKIP_UNUSABLE_INDEXES=TRUE,
    SKIP_INDEX_MAINTENANCE=TRUE)
    UNRECOVERABLE
    LOAD DATA
    INFILE 'EMP.dat'
    INFILE 'DEPT.dat'
    INTO TABLE emp TRUNCATE
    FIELDS TERMINATED BY "|" OPTIONALLY ENCLOSED BY '"'
    (empno,
    ename,
    deptno)
    INTO TABLE dept TRUNCATE
    FIELDS TERMINATED BY "|" OPTIONALLY ENCLOSED BY '"'
    (deptno,
    dname,
    dloc)
    Appreciate a Quick Reply
    mailto:[email protected]

    Which operating system? ("Command Prompt" sounds like Windows)
    UNIX/Linux: a shell script with multiple calls to sqlldr run in the background with "&" (and possibly nohup)
    Windows: A batch file using "start" to launch multiple copies of sqlldr.
    http://www.pctools.com/forum/showthread.php?42285-background-a-process-in-batch-%28W2K%29
    http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/start.mspx?mfr=true
    Edited by: Brian Bontrager on May 31, 2013 4:04 PM

  • Load multiple images from directory?

    What is the best way to use CF to load multiple images from a
    server directory please? I have CF calling a stored procedure that
    returns an array of file names. I am using a Flex front end, and
    wonder if I should just pass the file name array to Flex and let it
    loop through and load each image into an array. Or is it possible
    from within my CFC to use the file name array to get CF to grab the
    images and then pass that image array back to Flex? If so, is there
    any advantage to either approach? TIA,
    Mic.

    You don't want to pass the binaries to Flex, you should just
    give Flex the image names and load them via HTTP.

  • Loading multiple data from a XML file?

    Hi,
    I'm having trouble loading multiple data from the same XML file. In this XML file I have a list of dishes I want to add into a menu. So, how can I load multiple data from different branches of the XML file into my text fields?
    Thanks in advance,
    Rafael Carignato

    I'm not quite sure what you are trying to do.  I have this working with a .JSON file that loads "multiple" date into "multiple" fields in Edge - Is that what you mean?
    Here's an example:
    $.getJSON('slides.json', function(data) {
              for(var i=0;  i<data.length;  i++)
                                  var s = sym.createChildSymbol("slide", "stage");
                                  s.$("photo").css({"background-image":"url('"+data[i].image+"')"});
                                  s.$("title").html(data[i].title);
                                  s.$("price").html(data[i].price);
                                  s.getSymbolElement().css({"position":"absolute",
                                                      "left": i*225+50+"px",
                                                      "top":"100px"});
    Each name above (photo, title, price) has an element on the stage (or in my case, a symbol) and my .JSON file has has a "branch" for each of these:
    "image" : "images/7783.jpg",
    "title" : "SNOCONUTS",
    "price" : "12.00"
    Hope that helps...
    James

  • My iPhone 4S won't load email messages from my local carrier. It works sometimes and then won't.  The local carrier says it is not them and to contact apple.  Been happening since got Kindle Fire. Could this be doing it?

    My iphone  4S  won't load email messages from my local carrier on a regular basis.  It says cannot get mail in use on another device.  I thought everything was to sync together?  Local carrier tells me it is Apple not them.  It's been happening since I got my Kindle Fire about a month ago.  Any ideas how to make everything work together?????  Does it when kindle is off to sometimes.  Thanks.

    Hi Maquillage,
    Thanks for using Apple Support Communities.  I would recommend troubleshooting the iPhone by following the instructions in this article:
    iOS: Not responding or does not turn on
    http://support.apple.com/kb/TS3281
    Resolution
    If a single application is not responding or stops responding when it opens, you can force it to close.
    If the device is unresponsive or if certain controls aren't working as expected, restart your device.
    If the device remains unresponsive or does not turn on (or power on), reset your device.
    If there is no video or if the screen remains black, verify that the device has enough charge to turn on:
    If you are using an iPad, ensure that it's connected to the USB Power Adapter supplied with the device.
    Let charge for at least twenty minutes, then see if it starts normally.
    If there is no image on the screen, press the Sleep/Wake button to attempt to wake the device.
    If the screen displays a red battery icon, continue charging the device until the battery is fully charged.
    If the above steps do not resolve the issue, or the if the screen remains black or shows a persistent Apple logo, try restoring with iTunes:
    Connect the device to your computer and open iTunes.
    If the device appears in iTunes, select and click Restore on the Summary pane. Learn more aboutrestoring iOS software.
    If the device doesn't appear in iTunes, try to force the device into recovery mode, and then restore it.
    If the above steps do not resolve the issue, contact Apple.
    Cheers,
    - Ari

  • TT Issue "9994 Loading data store from disk into RAM in progress"

    Getting this strange issue. Sometimes (2-3 times a day) TT just becomes unavailable and when trying to connect to it getting "9994 Loading data store from disk into RAM in progress".
    Any advise on what the root cause for this behavior might be?

    In all likelihood this is exactly what it sounds like - your datastore is being reloaded from disk into memory. Connections can't be completed until the datastore has gone through recovery and is fully in-memory. You need to look back through your ttmesg.log files and find out why the datastore was taken out of memory in the first place. Possibly there's been a crash and it has been invalidated, meaning it needs to be recovered from the checkpoint files and transaction logs. Or maybe there were no user connections and it was taken out of memory and checkpointed to disk in a normal, controlled fashion. The ttmesg.log files will tell you what happened.

  • How Can I delete multiple messages from the same address in Mac Mail

    Hope this is in the correct Community.  Hope someone can help me to delete multiple email messages from the same email address.
    At the moment I can do it by holding down the Command key and highlighting each email, but that can be difficult with many messages
    to delete.  Is there a quicker way?
    Thanks for any help on this.

    Thanks for the reply, appreciate your input.  I did find another way of doing it and that is to highlight the first e-mail, hold down the shift key and click on the last one.  That highlights them all and then they can all be deleted.  Your ideas also work of course and I thank you for that.  Cheers.

  • IPad Mail not loading all message from Yahoo mail after installing iOS5

    Yesterday I had Mail (on my iPad 1) set up for my wife and I  (to retrieve Yahoo mail)  while still under iOS 4.3.3 and it worked perfectly! ! !
    Last night the iPad installed iOS5. Now on my wife's  Mail, it shows 2 emails and asks to "Load More Messages. . ." 19 total, 4 unread".  I tap the sentences, it act like it is going to do it but nothing. No change.
    I have deleted the the Mail settings, powered OFF the iPad, relaunched it and the added the Yahoo mail account information all over again. I have done this 3 times but nothing has changed. Mail still won't retrieve all the Yahoo emails.
    Please help!
    Thanks,
    John

    I would try changing the Remove copy from server after retrieving a message: setting to After one day instead. You may think this is weird, because it can only make the problem worse, right? Well, maybe not.
    Maybe what is happening is that Mail encounters connection problems from time to time that prevent it from deleting certain messages right after being downloaded, and it doesn't try again after that. By telling Mail to remove the messages after some time, you're telling it to keep track of which messages have already been downloaded and must be removed. Mail will look for messages to be removed from the server each time it connects to it for downloading new messages. If it cannot remove them for some reason, it will try again at the next connection attempt...

  • Can't "Load More Messages" from Exchange Email

    Hi All,
    I have 2 email accounts (yahoo + exchange). In Yahoo when I get to the end of the inbox on the phone, I can click "Load More Messages". This does not show up on Exchange however. What gives?
    I am using PUSH (although if the stuck email thing starts to annoy me, I will sometimes switch to fetch)

    I'm gonna give this a bump too. I'm using iPod touch...and even though I already set my microsoft exchange mail to sync with no limit of days, I still cannot retrieve my mail that is older than 2 or 3 days. On top of that, I don't even get an option to load more messages. Can anyone help us?

  • How do I select multiple messages from one sender in mobile email to delete them all at once?

    I know how to select all of the new messages and mark as read. Now how would I do that if I wished to delete all from one sender or have the same subject, after I search the sender or subject?

    Hey Koyster,
    Great question. Utilizing iCloud.com, we may be able to purge these emails in a much faster way:
    iCloud: Delete email
    http://support.apple.com/kb/PH2651
    Delete messages
    - On your Mac, Shift-click to select multiple adjacent messages or Command-click to select multiple nonadjacent messages.
    - On your Windows computer, Shift-click to select multiple adjacent messages or Control-click to select multiple nonadjacent messages.
    Thanks,
    Matt M.

  • Installed new hard drive, loaded Snow Leopard from disk, how to get back to Lion?

    Our 2006 24" iMac, 2.16 C2D (EMC 2111) running the most up to date version of Lion had a hard drive failue. I replaced the hard drive and used the Snow Leopard disk we had to load the OS X. During installation I went through the migration assistant to load our most recent Time Machine backup. It loaded all apps and files just fine, but it did not update the OS to Lion. So, many of our most used applications (Aperture, iTunes) were versions that won't run on Snow Leopard 10.6.8. I thought I could just go to iTunes and view my purchased items and redownload Lion from there, but iTunes version installed from the backup doesn't work with anything less than 10.7. So, I erased the HD, re-installed Snow Leopard and did not use the migration assistant this time. Thinking I could run iTunes and get my Lion purchase downloaded and then resotre from Time Machine. That doesn't appear to be working. I've updated a couple of times, including iTunes, and it doesn't appear that I can find Lion. Would it be in my iTunes library  on my external? I haven't reconnected my external yet as I don't want anything to be modified during this attempt to fix things.
    How do I get Lion re-installed from this point? I paid $29.99 when it first came out. The iMac won't run Mountain Lion, which seems to be available for download.

    Yes, the retail version of Snow Leopard is a full install that can be put on a blank drive.
    Order a Snow Leopard 10.6 install disk for $29 from The Apple Store as long as you have at least 1gb of RAM. http://store.apple.com/us/product/MC573Z/A?mco=MTY3ODQ5OTY
    Put your install DVD into the optical drive and reboot. As soon as you hear the boot chime, hold down the "c" key on your keyboard (or the Option key until the Install Disk shows up). That will force your MacBook to boot from the install DVD in the optical drive.
    When it does start up, you'll see a panel asking you to choose your language. Choose your language and press the Return key on your keyboard once. It will then present you with an Installation window.
    Completely ignore this window and click on Utilities in the top menu and scroll down to Disk Utility and click it. You should see your hard drive in the left hand column along with your other drives. Click on the drive and select the Erase tab. Set the format value to Mac OS Extended (Journaled) and click the Erase button. After that has finished select the Partition tab. Type in a Name for your hard drive and select how many partitions you want from the Volume Scheme. The usual setting is one partition. Click on the Options button after you've selected a partition to make sure it's set for GUID. Then click the Apply button and after the Partitioning is done quit Disk Utility.
    You can now follow the instructions on the install screen
    To upgrade your iLife and iWork. If you only want iPhoto or other single apps from iLife '11 you can get them from the App Store after you've upgraded to 10.6.6. iPhoto, iMovie or Garage Band for $15 each and Pages, Keynote or Numbers from iWork '09 for $20 each.

  • When I load email messages from one Thunderbird program to another in the outbox, then I can send them all in one go. I have to re-open each message and send it

    I have two computer terminals. One is connected to internet. THen I have another with an internal network set-up, not connected to internet. Thunderbird installed on both. I download emails on the internet computer, export the messages on a USB stick and import them in my Thunderbird in the other computer. Answer the emails, then export from the outbox and them import to the outbox on my internet computer in Thunderbird. This has worked fine up to now, but since some days I can't send the emails after having imported them in my outbox. I have to reopen each email and send it, and then it goes. But I can't just click send and it sends all one after one. what happens is it processes the email for about a minute and then gives an error message. On each email. What to do?

    The copying is for security reasons, I want to be able to keep email comm on an internal server that can't be accessed through internet.
    The error message I get is: "Sending of message failed.
    The message could not be sent because the connection to SMTP server timed out. Try again or contact your network administrator."
    It worked some days ago so I don't understand what's different now.

  • Loading multiple files from multiple users.

    Our system is moving from a standalone app to a web system. The users will have export files generated by our app which they will need to import up to the web. In the web system, the users are connecting via SSO, so apps server is using a single JDBC connection and we are querying the CLIENT_IDENTIFIER at the database end to see who is doing what.
    The export file is essentially a zip with the first file being a list of which filenames in the zip translate to what tables in the database they are from.
    The new system will require a little work on each file to update certain things prior to actually inserting the data to its final destination.
    My confusion is how to best do this. What we essentially need to do is move the data from the text file into a table along with some flag for identifying the user that put it there. Then update the data as needed and finally insert it to the final table destination. The first thought was to use external tables. However if you have two users importing at the same time, how do you differentiate the data? The other idea was to use sqlldr. The trouble was there is no way (that I'm aware of) to be able to add the flag for who's data this is on the way over with sqlldr, it will only bulk copy the data from the file over to the table you specify.
    So the basic question is how do I get data for a single table into the system when I have multiple users (SSO signed on using the same DB connection via apps) uploading their own copies of data ultimately headed for the same database table but the data needs a little modification on the way? What's the best way to do this?
    Thanks.

    Our system is moving from a standalone app to a web system. The users will have export files generated by our app which they will need to import up to the web. In the web system, the users are connecting via SSO, so apps server is using a single JDBC connection and we are querying the CLIENT_IDENTIFIER at the database end to see who is doing what.
    The export file is essentially a zip with the first file being a list of which filenames in the zip translate to what tables in the database they are from.
    The new system will require a little work on each file to update certain things prior to actually inserting the data to its final destination.
    My confusion is how to best do this. What we essentially need to do is move the data from the text file into a table along with some flag for identifying the user that put it there. Then update the data as needed and finally insert it to the final table destination. The first thought was to use external tables. However if you have two users importing at the same time, how do you differentiate the data? The other idea was to use sqlldr. The trouble was there is no way (that I'm aware of) to be able to add the flag for who's data this is on the way over with sqlldr, it will only bulk copy the data from the file over to the table you specify.
    So the basic question is how do I get data for a single table into the system when I have multiple users (SSO signed on using the same DB connection via apps) uploading their own copies of data ultimately headed for the same database table but the data needs a little modification on the way? What's the best way to do this?
    Thanks.

  • Message from Disk Utility:  iBook HD "Volume needs repair"

    I just ran the "Verify Disk" routine and got this error message: "First Aid Failed" because "the underlying task reported failure on exit".
    In verifying my "iBook HD" volume, the following errors were reported:
    (1) "incorrect number of thread records" in the Catalog file.
    (2) "Volume Bit Map needs minor repair"
    (3) "Invalid volume free block count (should be 7719070 instead of 7719077)"
    (4) The volume iBook HD needs to be repaired.
    I would have run the "Repair Disk" routine, but its button wasn't highlighted, so I couldn't do this.
    What to do now?
    (by the way, the Disk Permissions are all OK)

    If I were buying one, I think I'd hit Amazon (solely because of price):
    http://www.amazon.com/gp/offer-listing/B0028Z1J32/ref=dpolpnew?ie=UTF8&condition=new
    Some info on NewerTech NuPower batteries:
    http://www.newertech.com/products/ibookg414_batt.php
    http://www.newertech.com/tech_support/newerbatteryconditioning.php
    Apple's recommendations for battery usage for optimal battery life and lifespan:
    http://www.apple.com/batteries/notebooks.html

  • Loading multiple tables from one xml-file

    I've got one xml-file containing information which should be loaded into multiple database tables. How can I do that?

    Please use XSLT to tranform to XML file with XSU recognized format and separated for different table input.
    You may refer to Example in book "Building Oracle XML Applications".
    null

Maybe you are looking for

  • Non-English Closed Captioning

    Hi there, I need to create closed captions for a video that aren't in English (Bengali and Hindi). Is there a way to add CC that aren't in English in Premiere Pro? In the captioning window the Bengali shows up correctly but on the program monitor the

  • Solaris 10 system freezes with ZFS + NFS

    I've been playing around with Solaris 10 and attempting to create a file server using ZFS + NFS. While writing to the NFS share over my network the solaris system will completely freeze requiring me to hit the power button. It is a total freeze, the

  • Security Realm class for agentRealm in Sun App server 8.1

    hi All, Can someone tell me what the name of the agentRealm class is for configuring agentRealm in Sun app server 8.1. The Policy agent Guide for App server 7 has it as the following <auth-realm name="agentRealm" classname="com.sun.amagent.as.realm.A

  • Sql query- Count

    I gave here sample query and o/p. WITH numbered_table2 AS   (SELECT id,     city,     row_number() OVER (PARTITION BY id ORDER BY ID) AS R_NUM   FROM table2   numbered_table3 AS   (SELECT id,     dept,     row_number() OVER (PARTITION BY id ORDER BY

  • Premiere Pro has encountered an error  [URGENT]

    I can´t open my recent project. I receive the following error Message: "Premiere Pro has encountered an error. [..\..\Src\Clip\MasterClip.cpp-2802]" Even if i want to open the auto-saved projects i get this error message. I tried to import the projec