IMAPMessage is read-only Exception while changing setting the Flag

Hi,
I am getting " IMAPMessage is read-only" Exception while setting the Flag to SEEN/DELETED but the chages are effecting in mail(gmail).
below is my code, please help me in this.
Session session = Session.getDefaultInstance(props, null);
           Store store = session.getStore("imaps");
           store.connect("imap.gmail.com", username, password);
           Folder inbox= store.getFolder("Inbox");
           inbox.open(Folder.READ_WRITE);
              Message[] msgsArr = inbox.getMessages();
              for (int i = msgsArr .length - 1; i >= 0; i--) {
                try {
               IMAPMessage msg = (IMAPMessage) msgsArr ;
msg.setFlag(Flags.Flag.DELETED, true);
msg.saveChanges();
catch (Exception e) {
e.printStackTrace();
Thanks,
Reddy

You don't need the call to saveChanges after setting the flags.
Also, you don't need to cast to IMAPMessage.

Similar Messages

  • Everytime I sync my iPhone 4 it pops up a notice saying that my iphone cannot be written to or read from. wont apply changes at the end of the sync cycle.

    everytime I sync my iPhone 4 it pops up a notice saying that my iphone cannot be written to or read from. wont apply changes at the end of the sync cycle. it synced once and now nothing! help?

    Did a health check on my Drive D:  Issues were found and repaired. Disabled Kaspersky and tried a sync with iTunes (Success). Re-enable Kaspersky and iTunes is still working.  Interesting in that I thought my iTunes only involved Drive C:  What led me to problems with Drive D: were indications that there was a problem with Adobe cache for Adobe Bridge.  I also purged that cache. In looking at my nightly backup there was also an indication there had been some intermittent issues of not being able to read the disk.
    Bottom line...  all is working again and need to continue to monitor the health of my second hard drive.

  • Firefox 4 is stuck in classic mode. I went to the Add-on's and tried to change it, its the same no matter what I do, the only thing that changes is the tabs. Help.

    I downloaded Firefox 4 because it looked great at school, it doesn't look the same I believe its stuck in classic mode. I went to the Add-on's and tried to change it, its the same no matter what I do, the only thing that changes is the tabs. Help.

    To get the new interface you need to hide the menu bar. To do that in the View menu select Toolbars, then click on the "Menu Bar" entry. If you had applied customizations to the menu bar whilst using Firefox 3.6, the new version would by default use the old interface.
    If you need access to the menus you can press either Alt or F10 to temporarily display them.

  • Singleton class for logging in the application, and setting the flag

    Hi Friends,
    I have a singleton class for logging in the application, and setting the flag once logged. can some one help me in doing this.
    with regards,

    rtfm, for example here - http://www.javacamp.org/designPattern/

  • Read Only/ Plan Mode Changes for a layout with two different queries

    Hi,
    I have a situvation where a layout opens in a read only mode and when
    the users click on button plan, it changes to plan mode. The catch here however is the queries
    for read mode and plan mode are slightly different, in the read only mode the query has subtotals
    and other calculations that are not a part of the plan mode ( where they input forecasts).
    I know if the read and plan query are the same, we can achieve this through the command
    SET_DATA_ENTRY_MODE. In case they are different, as above, how can i achieve this.
    Thanks
    Rashmi.

    Say you are using two different queries as DP1 & DP2 for Display and Plan mode respectively. You also have one Analysis grid item in Web template which initially points to DP1.
    On PLAN button call command SET_ITEM_PARAMETER to set the data provider of analysis item to DP2.
    OR
    You have only one dataprovider in your web template as DP1 initially pointing to Query 1 which you want to show in Display mode. Then on PLAN button call a command SET_DATA_PROVIDER_PARAMETERS to point the DP1 to 2nd query instead of 1st query.  You can find this command under Commands for data Provider --> Basic data provider commands.
    Edited by: Deepti Maru on Nov 27, 2009 9:52 PM

  • Read Only Access while assigning Analysis Types and Reports in User/Group

    Hi Team,
    While Assigning Analysis Type,Reports and Workbooks to User "Read" option is not enabled. It is not working and as soon as we select analysis type ,Only one option is editable "Create/Update/Delete". The other two Option is always there as display "Read" and "Execute" . Execute might work with "Scripts template" but "READ" should work for analysis types and Reports.
    We are already struggling with "Read Only" Access in security filter as its not working now.
    Thanks
    Edited by: user7918731 on Mar 2, 2011 11:22 AM

    The behavior for Analysis type, workbook and script as follow:-
    The Analysis type create/update/delete option will be enabled, read and execute option will be disabled by default.
    The report workbook read option will be enabled, and other two options will be disabled.
    The script execute option will be enabled, and other two option’s will be disabled.
    For providing “Read Only” access in security filter, Switch to the administration tab, Click on Security Filters, Click on Add button, Open Create Security Filter window, Select the access level to Read Only and select user in assigned user , Click on ok.
    It should work.

  • I only create Read Only folders can't set permissions for any file but mine

    My issue is I have 25 users and an X-Serve and it seems like all the users
    do not have the same permissions. More specifically if a user creates a
    folder on the server only that user can access it. This is the same if the
    user creates the folder on there desktop and then copies the files to the
    server. But if they copy a "read only" folder or file (this happens more
    with files) to there desktop and then they open the file save it and place
    it back on the server there is no problem.
    I also, have a user that whenever she creates a folder it automatically
    set's itself to read only. No matter whether she copies from her desktop to
    the server or visa versa. Every folder she creates is protected this way
    here settings are all the same as everyone else. So I'm not sure if she is
    unique or if the settings for my users are incorrect.
    I did not set up the server or the user's so I'm really trying to catch up
    quick. We are really suffering in that it totally slow's things down almost
    to a crawl in some cases. I really hope you can help me out with this I've
    attached some screen shot's and the X-Serve system profiler for background.
    --

    I suggest posting to the Xerve forum http://discussions.apple.com/forum.jspa?forumID=854

  • MDT 2010 - Validation Error: The deployment share is read-only, so no changes can be made

    I keep getting the above listed error when trying to update the rules on one of my deployment shares.  I've even gone so far as to remove the read-only flag on everything in the share, it doesn't help.
    As a workaround, I've been editing the CustomSettings.ini directly, but I'd really like this to work.  Any ideas?
    As an aside, the 'Alert me when someone responds to this post' never seems to work here.  And yes, I've checked my spam folder as well...

    Ok, it seems to be related to the MDT WizardEditor, but I'm not sure how.  I logged on to the server and was able to update the deployment share several times.  I closed the MMC, opened the WizardEditor, opened the Deploy.xml thing inside the WizardEditor, closed WizardEditor, reopened MMC - READ ONLY.
    Very weird.

  • I want to use ZFS filesystem compression on a history database with read-only tablespaces.  What is the best way to get the datafiles compressed?

    I have 5 history databases that total about 2.2 Terabytes. They use about 15 filesystems, but I can start with 2 that are isolated to only one database.  I have asked for ZFS compression to be set on the filesystems, but since these are read-only tablespaces, I do not think any compression will happen.  Can I simply offline, copy and rename the files from one filesystem to the other to make the compression happen?

    just rsync the files to a compressed Zpool. do this using shadow migration, and you only loose access to the data for a few seconds.
    1) make new dataset with compression
    2) enable shadow migration between the new and old
    3) change the database to use the new location
    4) watch as data is automatically copied and compressed :-)
    the the down side, you need extra space to pull the off.

  • I am not able to use Firefox with Sharepoint - I can only open a file in read-only mode and cannot checkout the document and edit.

    I would like to use Firefox with Sharepoint.
    However, I am only able to open a file in "read only" mode whch means I cannot edit the document and save it. I am also not able to "check-out" a document in Sharepoint and edit it at the same time.

    This may not work for everyone, but I solved this problem by clicking on the file name in sharepoint, not the document icon to the left of the name. This then brought up the various options, including checking out, editing, version history etc. It seems obvious but I have only just realised this!

  • How to change/set the browser title from web forms (XP platform with SP2)

    I am running Form9i, I have set the browser windows title from Web Forms dynamically by using following method. However, when my PC has changed to XP, the function seems not work. Does anybody have same problem and how to solve it? Any suggestions would be appreciated.
    Add the Javascript code to your baseHTML file. For example,
    if you are using the basejini.htm:
    <HEAD><TITLE>%pageTitle%</TITLE>
    <script language="javascript1.2" type="text/javascript1.2">
    function Change(a) {    document.title=a;    } </script>
    </HEAD>
    In web Forms , call the javascript function with WEB.SHOW_DOCUMENT built.
    For Example the following code set the browser title with username . web.show_document('javascript:Change('||'"'|| get_application_property(USERNAME)||'"'||')','_self');
    Best Regards,
    Bowie

    Dear Frank,
    Thanks for your reply. Can you tell me in detail which built-in function in Webutil can set value in browser title ?
    Btw, is it possible for me to set parameter "separateFrame=True" in formsweb.cfg and set the form window title by using SET_WINDOW_PROPERTY(FORMS_MDI_WINDOW,TITLE,v_msg_string)?
    Best Regards,
    Bowie

  • How to set the flag of the mail when I read it for POP3

    HI,
    All
    I know that POP3 does not support the flags. As per my knowledge the only flag POP3 supports is the DELETED. if i am not wrong.
    Now what i have to do is when i fetch the mails programmatically and once i read that I want to mark that mail as read in the yahoo also. means when i reterieve the mails through my client from the yahoo mail and next time when I Open the yahoo account the mail that i have retrieve must be seen as read rather than unread.
    Yahoo uses the POP3 Server for the incoming mails the same thing also happens with outlook you can find that outlook also uses POP3 as the incoming mail server and when we reterieve the mails from the yahoo using the outlook by some way Outlook marks the mails on the yahoo server as read the same thing I have to do for my client Program using the POP3 server.
    If Outlook does it dispite of the POP3 server there must be some way to do the same thing for the POP3 server using the Java Mail Api.I dont know how to do that thing and mark the mails as read once I fetch them.
    Any Help is appriciated,
    Rahul.

    I have tried to access the content of the message using the my program to fetch the mail but still Yahoo does not mark it as the read in its web interface.
    so I want to know how to do that. and also want to know that when you are doing same thing for the outlook then it mark it as a read on the Yahoo web mail interface so I want to know how do they do it means how Outlook mark it as a read mail on the yahoo server despite of the POP3 server.
    If anybody knows how outlook does that than we can do same using the Java mail Api.
    Regards,
    Rahul

  • So after updating my ipod touch 3rd gen to 4.3.1 i noticed a lag everytime i turn it back on. it stays on the lock screen for minutes sometimes hours. the screen is usually unresponsive the only things usually changing are the time and battery percentage.

    so aafter upsating my touch to 4.3.1 i have noticed everytime i restart the ipod there is a huge lag at the lock screen. the screen only updates itself every three to five minutes only updating the time and battery status. i cannot do anything, usually it will stay like this for minutes sometimes hours. i have tried restoring it and thought updating will fix the problem but it hasn't yet. i currently have ios 4.3.3. recently i had a friend look into the ipod and he told me on a folder called damaged files he found this, 37c3ad com.apple.autowake.plist. how can i fix this?

    Try a manual install following directions in link below.
    Basic troubleshooting steps. 
    17" 2.2GHz i7 Quad-Core MacBook Pro  8G RAM  750G HD  120G Vertex 3 SSD Boot HD  

  • OAF: *PG.xml is read-only. Unable to extend the LOVRN to add lovmappings

    Hello All,
    I am trying to extend the PG.xml to add additional lovmappings using JDev. But the PG.xml is readonly. Unable to create new items on lovmappings!
    I have imported all the server.xml for the VO extension. That worked fine. ( I tried to add the new lovmappings using Personalization but with NO LUCK! ).
    So, now I am trying to add the lovmappings using JDev and am unable to create new lovmappings! The whole PG.xml is readonly (except the Privacy and others on the footer! ).
    So I opened only the PG.xml and the concerned LovRN.xml from myprojects/oracle/apps directory! along with all the myclasses/oracle/apps xml files.
    So Do I need to bring in anything else into my project to make the lovmapping to create new items ???
    Please help...
    Thanks,
    Francis

    Ramkumar,
    This is what I am trying to do!
    I extended the LovVO and deployed it successfully to application. I could see and use the newly added fields in the LOV region. That works fine.
    The requirement is:
    I want to populate the newly added field values from Lov region to the base page. This is what I did.
    1. Added the 2 new "Message Styled Text" items (from the extended VO) in the LOV region ( But not rendedred! )
    2. Added 2 new "Message Styled Text" items on the base page to populate the values from the LOV region.
    3. On the base page, personalizing the LOV (lovMappings) to inherit the values from the LOV region.
    >> Created 2 new lovmappings to inherit the 2 new values from the LOV region extended VO. ( Here the "LOV Region Item" {the itemID from the LOV region that I want to bring back and populate} and "Return Item" {the itemID on the base page that I want the value to get populated} are the only fields I entered other than the ID column! )
    5. Bounced the apache.
    -- After doing this, logged back in and tried the LOV, it doesn't populate the inherited values to the newly created items on the base page.
    Thanks for all the help.
    FR

  • Read mail using java, and set the mail

    How can I read mail and set message "SEEN" with java? (javax.mail)
    IMAP supports flags; so there are no problems, just using
    msg.setFlag(Flags.Flag.SEEN, true);
    but,
    POP3 does not support flags; how can I solve this in POP3? I have searched for this problem, found that I can just check for the header "Status", but this header does not exsist. Then I tried to add this header, but again, then I got IllegalWriteException cause pop3-msg is writeprotected (yes: I opened the folder READ_WRITE); so; does anyone know how I can solve this problem?

    Hi !
    Could u plz send me the code u r having for reading mails using IMAP...actually v r trying to read mails from outlook but due to some security reasons our team has decided not to use pop3 ...
    Thanks in Advance
    sha

Maybe you are looking for

  • Hiding or untag element (ID CS3 JS)

    Hi<br /><br />In Xml file  <br /><br />.... percent.<xref type="fn" rid="fn1"><sup>1</sup></xref>.....<br /><br />I want to insert footnote through script. The footnote is inserted but the numbers are occuring twice (one is the number in <xref> and o

  • Bug in entering alarm time

    When you first set up an alarm, the default "15 minutes before" appears. The problem is that the program assumes you are too stupid to remember to put in some number for the alert time. So, it does not allow you to erase both of the displayed digits,

  • Hi, Is it possible to do a 3 conferencing using a CUCM ? i.e after calling

    Hi, Is it possible to do a 3 conferencing (adhoc) using a CUCM6 ? i.e after calling one person, I call another person using the conference adhoc and both will be in conference with me. thks.

  • Cannot import a photo into Lightroom 5.2

    See the Lamp and Chopper video at http://www.smugmug.com/gallery/21425173_dGgs24

  • MS SQL RecordQuery

    Hi, I've noticed that with current recordset query in DW CS4 when you query an MS SQL DB you have to use the query in a particular order (I read that this is to do with the cursor used), how can you change the curosr from 'forward only' to a  static,