Session getFolder Example
Session class getFolder example. This example shows you how to use getFolder method.
Session class getFolder example. public Folder getFolder(URLName url) throws MessagingException Get a closed Folder object for the given URLName. If the requested Folder object cannot be obtained, null is returned.
Here is the code
/*
* @ # GetFolder.java
* A class repersenting use to GetFolder method
* of Session class in javax.mail package
* version 05 July 2008
* author Rose India
*/
package session;
import java.util.*;
import javax.mail.*;
public class GetFolder {
public static void main(String args[]) throws Exception {
Properties properties = System.getProperties();
Session session = Session.getDefaultInstance(properties, null);
URLName url = new URLName("pop3", "192.168.10.205", 110,
"Inbox", "test", "test");
System.out.println("Folder :"+session.getFolder(url));
}
} |
|