Update of /cvsroot/mrpostman/mrpostman/src/org/mrbook/mrpostman/yahoo
In directory sc8-pr-cvs1:/tmp/cvs-serv24046
Modified Files:
YahooMailSession.java
Log Message:
HTTPS support added by Kushal Khan
Index: YahooMailSession.java
===================================================================
RCS file: /cvsroot/mrpostman/mrpostman/src/org/mrbook/mrpostman/yahoo/YahooMailSession.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** YahooMailSession.java 7 Apr 2003 01:19:35 -0000 1.13
--- YahooMailSession.java 17 Apr 2003 05:08:18 -0000 1.14
***************
*** 42,45 ****
--- 42,46 ----
import java.io.PrintWriter;
+ import javax.net.ssl.HttpsURLConnection;
import java.net.HttpURLConnection;
import java.net.URL;
***************
*** 64,68 ****
"http://mrpostman.sourceforge.net/updates/yahoo", "/en/yahoo/index.html", new ModuleOption[0]);
private static Logger logger = Logger.getLogger("org.mrbook.mrpostman.yahoo.YahooMailSession");
- private static String httpLoginURL = "http://login.yahoo.com/config/login";
private static String httpsLoginURL = "https://login.yahoo.com/config/login";
private static String UserAgent = "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.4) Gecko/20010914";
--- 65,68 ----
***************
*** 89,94 ****
try {
! URL url = new URL(httpLoginURL + "?" + postRequest);
! HttpURLConnection conn = (HttpURLConnection) url.openConnection();
// conn.setRequestMethod("POST");
--- 89,94 ----
try {
! URL url = new URL(httpsLoginURL + "?" + postRequest);
! HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
// conn.setRequestMethod("POST");
***************
*** 110,117 ****
getRedirectLocation(conn);
*/
HTTPRedirectHandler hrh = new HTTPRedirectHandler(conn);
hrh.connect();
! conn = hrh.getConnection();
cj.addAll(hrh.getCookieJar());
--- 110,118 ----
getRedirectLocation(conn);
*/
+
HTTPRedirectHandler hrh = new HTTPRedirectHandler(conn);
hrh.connect();
! conn = (HttpsURLConnection) hrh.getConnection();
cj.addAll(hrh.getCookieJar());
***************
*** 159,163 ****
private String getBaseURL(URL url) {
! Pattern pat = Pattern.compile("(http:\\/\\/.*?)(\\/)");
logger.fine("url: " + url.toString());
Matcher matcher = pat.matcher(url.toString());
--- 160,164 ----
private String getBaseURL(URL url) {
! Pattern pat = Pattern.compile("(http%3a\\/\\/.*?)(\\/)");
logger.fine("url: " + url.toString());
Matcher matcher = pat.matcher(url.toString());
***************
*** 167,171 ****
logger.warning("Invalid URL\n");
}
! return matcher.group(1);
}
--- 168,173 ----
logger.warning("Invalid URL\n");
}
! String rval = matcher.group(1).replaceAll("%3a", ":");
! return rval;
}
|