dcsimg
Flag indeterminable??
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   nitin_bhatti
Posted On:   Thursday, December 20, 2001 08:46 AM

In my first part of application, i operate on a message and set its SEEN flag to false and predictably the output of the program prints out "flag set to Unseen" Message message = folder.getMessage(5); message.setFlag(Flags.Flag.SEEN, false); if(message.isSet(Flags.Flag.SEEN)) { System.out.println("Flag set to seen"); } else { System.out.println("Flag set to unseen"); } In the second part, I try to get the message flag for the same message and the output is "Flag unknown". Should'nt the output be " Flag set to unseen" ??? Am i doing something wrong?? Message message = folde   More>>

In my first part of application, i operate on a message and set its SEEN flag to false and predictably the output of the program prints out "flag set to Unseen"

Message message = folder.getMessage(5);

message.setFlag(Flags.Flag.SEEN, false);

if(message.isSet(Flags.Flag.SEEN))

{

System.out.println("Flag set to seen");

}

else

{

System.out.println("Flag set to unseen");

}

In the second part, I try to get the message flag for the same message and the output is "Flag unknown". Should'nt the output be " Flag set to unseen" ??? Am i doing something wrong??

Message message = folder.getMessage(5);

Flags flag = message.getFlags();

if(flag.contains(Flags.Flag.RECENT))

{

System.out.println("Flag set to RECENT");

}

else if(flag.contains(Flags.Flag.ANSWERED))

{

System.out.println("Flag set to ANSWERED");

}

else if(flag.contains(Flags.Flag.DELETED))

{

System.out.println("Flag set to DELETED");

}

else if(flag.contains(Flags.Flag.DRAFT))

{

System.out.println("Flag set to DRAFT");

}

else if(flag.contains(Flags.Flag.FLAGGED))

{

System.out.println("Flag set to FLAGGED");

}

else if(flag.contains(Flags.Flag.USER))

{

System.out.println("Flag set to USER");

}

else if(flag.contains(Flags.Flag.SEEN))

{

if(!message.isSet(Flags.Flag.SEEN))

{

System.out.println("Flag set to UNSEEN");

}

else

{

System.out.println("Flag set to SEEN");

}

}

else

{

System.out.println("Unknown Flag");

}



The second part of the question is can a message have flag set to "SEEN" true and flag "DELETED" set to false, i.e can a message have multiple set of Flags??

If anyone has come across any of the above 2 problems, pls share ur thoughts..
thanks
Nitin

   <<Less

Re: Flag indeterminable??

Posted By:   John_Zukowski  
Posted On:   Thursday, December 20, 2001 08:21 PM

Certain protocols, like POP, don't support these flags.
About | Sitemap | Contact