You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
(99) |
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|
From: Tiago N. <ea...@us...> - 2005-04-11 21:23:38
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/imap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4842/net/sf/mailsomething/mail/imap Modified Files: ImapSelectResponse.java Log Message: fixed uidvalidity field (can be a big figure, changed from int to long). Index: ImapSelectResponse.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/imap/ImapSelectResponse.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ImapSelectResponse.java 29 Mar 2005 12:18:54 -0000 1.3 --- ImapSelectResponse.java 11 Apr 2005 21:23:25 -0000 1.4 *************** *** 22,26 **** ! private int exists, recent, unseen, uidvalidity, uidnext; private int flags = 0; --- 22,28 ---- ! private int exists, recent, unseen, uidnext; ! ! private long uidvalidity; private int flags = 0; *************** *** 46,58 **** if (replyLines[i].indexOf("EXISTS") != -1) { ! exists = extractValue(replyLines[i]); } else if (replyLines[i].indexOf("RECENT") != -1) { ! recent = extractValue(replyLines[i]); } else if (replyLines[i].indexOf("UNSEEN") != -1) { ! unseen = extractValue(replyLines[i]); } else if (replyLines[i].indexOf("UIDVALIDITY") != -1) { --- 48,60 ---- if (replyLines[i].indexOf("EXISTS") != -1) { ! exists = (int) extractValue(replyLines[i]); } else if (replyLines[i].indexOf("RECENT") != -1) { ! recent = (int) extractValue(replyLines[i]); } else if (replyLines[i].indexOf("UNSEEN") != -1) { ! unseen = (int) extractValue(replyLines[i]); } else if (replyLines[i].indexOf("UIDVALIDITY") != -1) { *************** *** 62,66 **** } else if (replyLines[i].indexOf("UIDNEXT") != -1) { ! uidnext = extractValue(replyLines[i]); } else if (replyLines[i].indexOf("FLAGS") != -1) { --- 64,68 ---- } else if (replyLines[i].indexOf("UIDNEXT") != -1) { ! uidnext = (int) extractValue(replyLines[i]); } else if (replyLines[i].indexOf("FLAGS") != -1) { *************** *** 140,143 **** --- 142,146 ---- return exists; } + /** * @return Returns the recent. *************** *** 146,149 **** --- 149,153 ---- return recent; } + /** * @return Returns the uidnext. *************** *** 152,161 **** return uidnext; } /** * @return Returns the uidvalidity. */ ! public int getUidvalidity() { return uidvalidity; } /** * @return Returns the unseen. --- 156,167 ---- return uidnext; } + /** * @return Returns the uidvalidity. */ ! public long getUidvalidity() { return uidvalidity; } + /** * @return Returns the unseen. *************** *** 164,167 **** --- 170,175 ---- return unseen; } + + /** Extracts integer values from server's responses * *************** *** 169,178 **** * @return -1 if no value found, value if found */ ! private int extractValue (String replyLine) { int beginning = 0; int end = 0; ! int value = -1; for (int i = 0; i < replyLine.length(); i++) { --- 177,186 ---- * @return -1 if no value found, value if found */ ! private long extractValue (String replyLine) { int beginning = 0; int end = 0; ! long value = -1; for (int i = 0; i < replyLine.length(); i++) { |
From: Tiago N. <ea...@us...> - 2005-04-11 21:22:30
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/imap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4007/net/sf/mailsomething/mail/imap Modified Files: ImapListResponse.java Log Message: fixed the name extraction (can have spaces); fixed base64 decoding. Index: ImapListResponse.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/imap/ImapListResponse.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ImapListResponse.java 29 Mar 2005 12:18:54 -0000 1.3 --- ImapListResponse.java 11 Apr 2005 21:22:15 -0000 1.4 *************** *** 2,6 **** import java.util.Vector; ! import com.permabit.util.mime.Base64; /** --- 2,6 ---- import java.util.Vector; ! import net.sf.mailsomething.mail.util.Base64; /** *************** *** 50,53 **** --- 50,57 ---- public ImapListResponseEntry getEntry(String responseLine) { + int indexOfQM, indexOfH, start; + + String tempName; + ImapListResponseEntry entry = new ImapListResponseEntry(); *************** *** 79,96 **** } - entry.name = responseLine.substring(responseLine.lastIndexOf(' ') + 1); ! if ((entry.name.indexOf('?') != -1) || (entry.name.indexOf('-') != -1)) { ! ! byte[] temp = entry.name.getBytes(); ! ! temp = Base64.encode(temp); ! entry.name = new String(); ! for (int i = 0; i < temp.length; i++) ! entry.name.concat(Byte.toString(temp[i])); } //TASK name attribute //should be checked for ?- instances and decoded if --- 83,115 ---- } ! // parses the name, taking into account the possible presence of spaces in it ! if (responseLine.charAt(responseLine.length() -1) == '"') { ! int index = responseLine.lastIndexOf('"', responseLine.length() - 2) + 1; ! tempName = responseLine.substring(index, responseLine.length() - 1); ! } else { ! tempName = responseLine.substring(responseLine.lastIndexOf(' ') + 1); ! } ! ! ! // searches for base64 encoded substrings in the name ! start = 0; ! indexOfQM = tempName.indexOf('?'); ! indexOfH = tempName.indexOf('-', indexOfQM); ! ! while ((indexOfQM != -1) && (indexOfH != -1)) ! { ! entry.name += tempName.substring(start, indexOfQM); ! entry.name += Base64.decode(tempName.substring(indexOfQM + 1, indexOfH)); ! start = indexOfH + 1; ! indexOfQM = tempName.indexOf('?', start); ! indexOfH = tempName.indexOf('-', indexOfQM); } + entry.name += tempName.substring(start); + + //TASK name attribute //should be checked for ?- instances and decoded if |
From: Tiago N. <ea...@us...> - 2005-03-29 12:19:04
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/imap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10116/net/sf/mailsomething/mail/imap Modified Files: ImapSelectResponse.java ImapListResponse.java Log Message: improved ImapListResponse and ImapSelectResponse Index: ImapSelectResponse.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/imap/ImapSelectResponse.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ImapSelectResponse.java 20 Mar 2005 20:40:23 -0000 1.2 --- ImapSelectResponse.java 29 Mar 2005 12:18:54 -0000 1.3 *************** *** 9,16 **** public class ImapSelectResponse extends ImapResponse { private int exists, recent, unseen, uidvalidity, uidnext; ! private int flags; public ImapSelectResponse() { --- 9,30 ---- public class ImapSelectResponse extends ImapResponse { + public static final int SEEN = 1; + + public static final int ANSWERED = 2; + + public static final int FLAGGED = 4; + + public static final int DELETED = 8; + + public static final int DRAFT = 16; + + public static final int RECENT = 32; + + private int exists, recent, unseen, uidvalidity, uidnext; ! private int flags = 0; + public ImapSelectResponse() { *************** *** 28,31 **** --- 42,89 ---- super.buildResponse(replyLines); + for (int i = 0; i < replyLines.length; i++) { + + if (replyLines[i].indexOf("EXISTS") != -1) { + + exists = extractValue(replyLines[i]); + + } else if (replyLines[i].indexOf("RECENT") != -1) { + + recent = extractValue(replyLines[i]); + + } else if (replyLines[i].indexOf("UNSEEN") != -1) { + + unseen = extractValue(replyLines[i]); + + } else if (replyLines[i].indexOf("UIDVALIDITY") != -1) { + + uidvalidity = extractValue(replyLines[i]); + + } else if (replyLines[i].indexOf("UIDNEXT") != -1) { + + uidnext = extractValue(replyLines[i]); + + } else if (replyLines[i].indexOf("FLAGS") != -1) { + + if (replyLines[i].indexOf("\\Seen") != -1) + setFlag(SEEN); + + if (replyLines[i].indexOf("\\Answered") != -1) + setFlag(ANSWERED); + + if (replyLines[i].indexOf("\\Flagged") != -1) + setFlag(FLAGGED); + + if (replyLines[i].indexOf("\\Deleted") != -1) + setFlag(DELETED); + + if (replyLines[i].indexOf("\\Draft") != -1) + setFlag(DRAFT); + + if (replyLines[i].indexOf("\\Recent") != -1) + setFlag(RECENT); + } + + /* example C: A142 SELECT INBOX *************** *** 44,51 **** --- 102,206 ---- + } + } + + /** + * Sets a given flag + * @param flag one of SEEN, ANSWERED, FLAGGED, DELETED, DRAFT or RECENT + */ + private void setFlag(int flag) { + + flags |= flag; + + return; + } + + + /** + * Checks whether a flag is set or not + * @param flag flag to check + * @return true if set, false if not + */ + private boolean isSet (int flag) { + + if ( (flags & flag) == flag ) + return true; + + return false; + } + + /** + * @return Returns the exists. + */ + public int getExists() { + return exists; + } + /** + * @return Returns the recent. + */ + public int getRecent() { + return recent; + } + /** + * @return Returns the uidnext. + */ + public int getUidnext() { + return uidnext; + } + /** + * @return Returns the uidvalidity. + */ + public int getUidvalidity() { + return uidvalidity; + } + /** + * @return Returns the unseen. + */ + public int getUnseen() { + return unseen; + } + /** Extracts integer values from server's responses + * + * @param replyLine + * @return -1 if no value found, value if found + */ + private int extractValue (String replyLine) { + + int beginning = 0; + int end = 0; + + int value = -1; + + for (int i = 0; i < replyLine.length(); i++) { + + if ( Character.isDigit(replyLine.charAt(i)) ) { + + beginning = i; + + break; + } + } + + for (int i = beginning + 1; i < replyLine.length(); i++) { + + if ( !(Character.isDigit(replyLine.charAt(i))) ) { + + end = i; + + break; + } + } + + if (beginning != end) + value = Integer.parseInt( replyLine.substring(beginning, end) ); + + + return value; + } + } Index: ImapListResponse.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/imap/ImapListResponse.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ImapListResponse.java 20 Mar 2005 20:40:23 -0000 1.2 --- ImapListResponse.java 29 Mar 2005 12:18:54 -0000 1.3 *************** *** 2,6 **** import java.util.Vector; ! /** --- 2,6 ---- import java.util.Vector; ! import com.permabit.util.mime.Base64; /** *************** *** 79,82 **** --- 79,95 ---- } + entry.name = responseLine.substring(responseLine.lastIndexOf(' ') + 1); + + if ((entry.name.indexOf('?') != -1) || (entry.name.indexOf('-') != -1)) { + + byte[] temp = entry.name.getBytes(); + + temp = Base64.encode(temp); + + entry.name = new String(); + + for (int i = 0; i < temp.length; i++) + entry.name.concat(Byte.toString(temp[i])); + } //TASK name attribute |
From: Stig T. <jw...@us...> - 2005-03-24 14:02:22
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28483/net/sf/mailsomething/gui/mail Modified Files: MailboxTable.java Log Message: Index: MailboxTable.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/mail/MailboxTable.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MailboxTable.java 24 Mar 2005 14:00:11 -0000 1.5 --- MailboxTable.java 24 Mar 2005 14:02:12 -0000 1.6 *************** *** 26,35 **** import net.sf.classifier4J.IClassifier; import net.sf.classifier4J.bayesian.BayesianClassifier; - import net.sf.classifier4J.bayesian.IWordsDataSource; - import net.sf.classifier4J.bayesian.SimpleWordsDataSource; import net.sf.mailsomething.mail.*; import net.sf.mailsomething.mail.db.CachedJDBCWordDataSource; import net.sf.mailsomething.mail.db.HSQLConnectionManager; - import net.sf.mailsomething.mail.db.JDBCWordsDataSource; import net.sf.mailsomething.util.event.LListenerAdapter; import net.sf.mailsomething.util.event.ListenerProxy; --- 26,32 ---- |
From: Stig T. <jw...@us...> - 2005-03-24 14:01:31
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28043/net/sf/mailsomething/mail/db Added Files: HSQLConnectionManager.java CachedJDBCWordDataSource.java Log Message: temporarely placed here, maybe they should be in another package --- NEW FILE: CachedJDBCWordDataSource.java --- package net.sf.mailsomething.mail.db; /* * ==================================================================== * * The Apache Software License, Version 1.1 * * Copyright (c) 2003 Nick Lothian. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, if * any, must include the following acknowlegement: * "This product includes software developed by the * developers of Classifier4J (http://classifier4j.sf.net/)." * Alternately, this acknowlegement may appear in the software itself, * if and wherever such third-party acknowlegements normally appear. * * 4. The name "Classifier4J" must not be used to endorse or promote * products derived from this software without prior written * permission. For written permission, please contact * http://sourceforge.net/users/nicklothian/. * * 5. Products derived from this software may not be called * "Classifier4J", nor may "Classifier4J" appear in their names * without prior written permission. For written permission, please * contact http://sourceforge.net/users/nicklothian/. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== */ import java.io.Serializable; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.Collection; import java.util.HashMap; import java.util.Map; import java.util.Vector; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import net.sf.classifier4J.ICategorisedClassifier; import net.sf.classifier4J.bayesian.IJDBCConnectionManager; import net.sf.classifier4J.bayesian.IWordsDataSource; import net.sf.classifier4J.bayesian.WordProbability; import net.sf.classifier4J.bayesian.WordsDataSourceException; /** * * @author Nick Lothian * @author Peter Leschev * */ public class CachedJDBCWordDataSource implements IWordsDataSource, Serializable { private Map words = new HashMap(); IJDBCConnectionManager connectionManager; private Log log = LogFactory.getLog(this.getClass()); public CachedJDBCWordDataSource(IJDBCConnectionManager connectionManager) { this.connectionManager = connectionManager; try { WordProbability[] props = loadWordProbabilities(); for(int i = 0; i < props.length; i++) setWordProbability(props[i]); } catch (Exception f) { f.printStackTrace(); } } public void setWordProbability(WordProbability wp) { words.put(wp.getWord(), wp); } /** * @see net.sf.classifier4J.bayesian.IWordsDataSource#getWordProbability(java.lang.String) */ public WordProbability getWordProbability(String word) { if (words.containsKey(word)) { return (WordProbability) words.get(word); } else { return null; } } public Collection getAll() { return words.values(); } /** * @see net.sf.classifier4J.bayesian.IWordsDataSource#addMatch(java.lang.String) */ public void addMatch(String word) { WordProbability wp = (WordProbability) words.get(word); if (wp == null) { wp = new WordProbability(word, 1, 0); } else { wp.setMatchingCount(wp.getMatchingCount() + 1); } setWordProbability(wp); updateWordProbability(ICategorisedClassifier.DEFAULT_CATEGORY, word, true); } /** * @see net.sf.classifier4J.bayesian.IWordsDataSource#addNonMatch(java.lang.String) */ public void addNonMatch(String word) { WordProbability wp = (WordProbability) words.get(word); if (wp == null) { wp = new WordProbability(word, 0, 1); } else { wp.setNonMatchingCount(wp.getNonMatchingCount() + 1); } setWordProbability(wp); updateWordProbability(ICategorisedClassifier.DEFAULT_CATEGORY, word, false); } private void updateWordProbability(String category, String word, boolean isMatch) { String fieldname = "nonmatch_count"; if (isMatch) { fieldname = "match_count"; } // truncate word at 255 characters if (word.length() > 255) { word = word.substring(0, 254); } Connection conn = null; try { conn = connectionManager.getConnection(); PreparedStatement insertStatement = conn.prepareStatement("INSERT INTO word_probability (word, category) VALUES (?, ?)"); PreparedStatement selectStatement = conn.prepareStatement("SELECT 1 FROM word_probability WHERE word = ? AND category = ?"); PreparedStatement updateStatement = conn.prepareStatement("UPDATE word_probability SET " + fieldname + " = " + fieldname + " + 1 WHERE word = ? AND category = ?"); selectStatement.setString(1, word); selectStatement.setString(2, category); ResultSet rs = selectStatement.executeQuery(); if (!rs.next()) { // word is not in table // insert the word insertStatement.setString(1, word); insertStatement.setString(2, category); insertStatement.execute(); } // update the word count updateStatement.setString(1, word); updateStatement.setString(2, category); updateStatement.execute(); } catch (SQLException e) { //throw new WordsDataSourceException("Problem updating WordProbability", e); } finally { if (conn != null) { try { connectionManager.returnConnection(conn); } catch (SQLException e1) { // ignore } } } } public void addMatch(String category, String word) throws WordsDataSourceException { if (category == null) { throw new IllegalArgumentException("category cannot be null"); } updateWordProbability(category, word, true); } public void addNonMatch(String category, String word) throws WordsDataSourceException { if (category == null) { throw new IllegalArgumentException("category cannot be null"); } updateWordProbability(category, word, false); } public WordProbability[] loadWordProbabilities() throws WordsDataSourceException { Vector props = new Vector(); String method = "getWordProbability()"; int matchingCount = 0; int nonMatchingCount = 0; Connection conn = null; try { conn = connectionManager.getConnection(); PreparedStatement ps = conn.prepareStatement("SELECT * FROM word_probability"); ResultSet rs = ps.executeQuery(); while (rs.next()) { matchingCount = rs.getInt("match_count"); nonMatchingCount = rs.getInt("nonmatch_count"); WordProbability wp = new WordProbability(rs.getString("word"), matchingCount, nonMatchingCount); props.add(wp); } } catch (SQLException e) { throw new WordsDataSourceException("Problem obtaining WordProbability from database", e); } finally { if (conn != null) { try { connectionManager.returnConnection(conn); } catch (SQLException e1) { // ignore } } } if (log.isDebugEnabled()) { log.debug(method + " WordProbability loaded [" + "]"); } return (WordProbability[])props.toArray(new WordProbability[]{}); } } --- NEW FILE: HSQLConnectionManager.java --- package net.sf.mailsomething.mail.db; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; import net.sf.classifier4J.bayesian.IJDBCConnectionManager; /** * To be used with JDBCWordsDataSource Maybe I will change that class so it * doesnt need such an implementation like this. * * @author Stig tanggaard * @since 2005-03-24 * */ public class HSQLConnectionManager implements IJDBCConnectionManager { Connection connection; boolean tableCreated = false; /* * (non-Javadoc) * * @see net.sf.classifier4J.bayesian.IJDBCConnectionManager#getConnection() */ public Connection getConnection() throws SQLException { if (connection == null || connection.isClosed()) try { Class.forName("org.hsqldb.jdbcDriver"); connection = DriverManager.getConnection("jdbc:hsqldb:" + "imagecrawler_", "sa", ""); if(!tableCreated) createTable(); } catch (Exception f) { f.printStackTrace(); } return connection; } protected void createTable() { try { // by declaring the id column IDENTITY, the db will automatically // generate unique values for new rows- useful for row keys update("CREATE TABLE word_probability " + "( word VARCHAR(255)," + " category VARCHAR(255)," + " match_count INTEGER," + " nonmatch_count INTEGER))"); } catch (SQLException ex2) { //ignore ex2.printStackTrace(); // second time we run program // should throw execption since table // already there // // this will have no effect on the db } tableCreated = true; } public synchronized void update(String expression) throws SQLException { Statement st = null; st= connection.createStatement(); // statements int i = st.executeUpdate(expression); // run the query if (i == -1) { System.out.println("db error : " + expression); } st.close(); } /* * (non-Javadoc) * * @see net.sf.classifier4J.bayesian.IJDBCConnectionManager#returnConnection(java.sql.Connection) */ public void returnConnection(Connection arg0) throws SQLException { //arg0.close(); } } |
From: Stig T. <jw...@us...> - 2005-03-24 14:00:46
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27412/net/sf/mailsomething/mail Modified Files: MailboxFilter.java Mailbox.java Message.java MailAccount.java Log Message: Index: Mailbox.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/Mailbox.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Mailbox.java 21 Mar 2005 17:17:12 -0000 1.6 --- Mailbox.java 24 Mar 2005 14:00:35 -0000 1.7 *************** *** 356,359 **** --- 356,372 ---- */ public MailboxHolder getParentMailbox() { + + if(parentMailbox == null) { + + MailAccount a = (MailAccount)handler; + + parentMailbox = a.getMailbox(getParent()); + + + } + + if(parentMailbox == null) + parentMailbox = (MailboxHolder)handler; + return parentMailbox; } Index: MailAccount.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/MailAccount.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MailAccount.java 20 Mar 2005 20:38:46 -0000 1.4 --- MailAccount.java 24 Mar 2005 14:00:36 -0000 1.5 *************** *** 8,11 **** --- 8,12 ---- import java.util.EventListener; + import net.sf.classifier4J.IClassifier; import net.sf.mailsomething.util.event.*; *************** *** 118,121 **** --- 119,124 ---- protected boolean runthread = true; + transient IClassifier classifier; + /** * Constructor for serializing purposes. Should not be called directly, *************** *** 362,365 **** --- 365,370 ---- */ public Mailbox getMailbox(String name) { + + if(name.indexOf(getDelimiter()) != -1) { *************** *** 1286,1289 **** --- 1291,1306 ---- + /** + * @return Returns the classifier. + */ + public IClassifier getClassifier() { + return classifier; + } + /** + * @param classifier The classifier to set. + */ + public void setClassifier(IClassifier classifier) { + this.classifier = classifier; + } } Index: Message.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/Message.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Message.java 21 Mar 2005 17:17:13 -0000 1.6 --- Message.java 24 Mar 2005 14:00:35 -0000 1.7 *************** *** 705,708 **** --- 705,713 ---- + public String[] getHeader() { + + return headerLines; + } + Index: MailboxFilter.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/MailboxFilter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MailboxFilter.java 3 Apr 2004 07:56:48 -0000 1.1 --- MailboxFilter.java 24 Mar 2005 14:00:35 -0000 1.2 *************** *** 19,26 **** private Mailbox source; ! private int matchType = MATCHANY; ! public static int MATCHALL = 0; ! public static int MATCHANY = 1; private String name = ""; --- 19,26 ---- private Mailbox source; ! private int matchType = MATCH_ANY; ! public static int MATCH_ALL = 0; ! public static int MATCH_ANY = 1; private String name = ""; *************** *** 75,84 **** if(criterion.checkCriteria(message)) { satisfies = true; ! if (this.matchType == MATCHANY) break; } else { satisfies = false; ! if (this.matchType == MATCHALL) break; --- 75,84 ---- if(criterion.checkCriteria(message)) { satisfies = true; ! if (this.matchType == MATCH_ANY) break; } else { satisfies = false; ! if (this.matchType == MATCH_ALL) break; |
From: Stig T. <jw...@us...> - 2005-03-24 14:00:22
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27170/net/sf/mailsomething/gui/mail Modified Files: MailboxTreeCellRenderer.java MailboxTableModel.java FilterConfig.java MailboxTable.java Log Message: Index: MailboxTreeCellRenderer.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/mail/MailboxTreeCellRenderer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MailboxTreeCellRenderer.java 3 Apr 2004 07:56:49 -0000 1.1 --- MailboxTreeCellRenderer.java 24 Mar 2005 14:00:11 -0000 1.2 *************** *** 17,20 **** --- 17,21 ---- import net.sf.mailsomething.gui.GuiUser; import net.sf.mailsomething.mail.Hierachy; + import net.sf.mailsomething.mail.Mailbox; import net.sf.mailsomething.mail.MessageHolder; *************** *** 137,144 **** --- 138,149 ---- MessageHolder mholder = null; + + Mailbox m = null; try { mholder = (MessageHolder) node.getMailbox(); + + m = (Mailbox)node.getMailbox(); } catch (ClassCastException f) { *************** *** 152,159 **** --- 157,169 ---- name += " (" + mholder.getMessageCount() + ") "; + } else if (messageCountStyle == MESSAGECOUNT_TOTALSTYLE) { name += " (" + mholder.getMessageCount() + ") "; + + if(m != null) + name += " " + m.getExists(); + } else if (messageCountStyle == MESSAGECOUNT_INCOMINGCOUNT) { Index: MailboxTable.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/mail/MailboxTable.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MailboxTable.java 21 Mar 2005 17:16:40 -0000 1.4 --- MailboxTable.java 24 Mar 2005 14:00:11 -0000 1.5 *************** *** 24,28 **** --- 24,35 ---- import java.io.*; + import net.sf.classifier4J.IClassifier; + import net.sf.classifier4J.bayesian.BayesianClassifier; + import net.sf.classifier4J.bayesian.IWordsDataSource; + import net.sf.classifier4J.bayesian.SimpleWordsDataSource; import net.sf.mailsomething.mail.*; + import net.sf.mailsomething.mail.db.CachedJDBCWordDataSource; + import net.sf.mailsomething.mail.db.HSQLConnectionManager; + import net.sf.mailsomething.mail.db.JDBCWordsDataSource; import net.sf.mailsomething.util.event.LListenerAdapter; import net.sf.mailsomething.util.event.ListenerProxy; *************** *** 206,209 **** --- 213,222 ---- //new MarkMessage(); + new MarkSpam(); + + new MarkNotSpam(); + + new ClassifyAll(); + popupMenu = new TransparentMenu(getActionMap()); *************** *** 263,277 **** } - /*public void setSelectionRow(int row) { - - //System.out.println("setselectionrow"); - - } - public void setRowSelectionInterval(int row, int row2) { - - //System.out.println("setselectionrow"); - - }*/ public void init(MessageHolder mailbox) { --- 276,280 ---- *************** *** 426,434 **** return; } ! ! //if(e.getMailbox() != mailbox) return; ! ! ////System.out.println("messageselectionchanged - table"); ! int n = e.getIndex(); --- 429,433 ---- return; } ! int n = e.getIndex(); *************** *** 437,447 **** } /** ! * Description of the Method ! * ! *@param e Description of Parameter */ - //public void mailboxSelectionChanged(MailboxSelectionEvent e) { - public void valueChanged(TreeSelectionEvent e) { --- 436,447 ---- } + /** ! * ! * Recieves treeselectionevents, from selections in ! * a mailboxtree. If the mailboxtable is dynamic we ! * change the mailbox to show. ! * */ public void valueChanged(TreeSelectionEvent e) { *************** *** 1840,1843 **** --- 1840,2082 ---- } + + + class MarkSpam extends GuiAction { + + public MarkSpam() { + super( + MailboxTable.this, + "Mark spam", + KeyStroke.getKeyStroke(KeyEvent.VK_M, KeyEvent.CTRL_DOWN_MASK), + "ctrl + m"); + + } + + public void actionPerformed(ActionEvent e) { + + MailboxHolder parent = (MailboxHolder)mailbox; + + while(parent.getParentMailbox() != null) { + + parent = parent.getParentMailbox(); + + } + + try { + + MailAccount a = (MailAccount)parent; + + if(a.getClassifier() == null) { + + CachedJDBCWordDataSource wds = + new CachedJDBCWordDataSource(new HSQLConnectionManager()); + + //IWordsDataSource wds = new SimpleWordsDataSource(); + IClassifier classifier = new BayesianClassifier(wds); + + a.setClassifier(classifier); + } + + if(a.getClassifier() != null) { + int[] selectedRows = getSelectedRows(); + + + for (int i = 0; i < selectedRows.length; i++) { + + Message message = mailbox.getMessage(selectedRows[i]); + + /*String header = ""; + + Object[] fields = message.getFieldNames(); + + for(int j = 0; j < fields.length; j++) { + + header += message.getField(fields[j].toString()) + " "; + + } + + System.out.println(header);*/ + + //message. + + ((BayesianClassifier)a.getClassifier()).teachMatch(message.getSubject()); + ((BayesianClassifier)a.getClassifier()).teachMatch(message.getFrom().getEmail()); + + + } + + } + + } catch (Exception f) { + + f.printStackTrace(); + } + + } + + + + } + + + + + class MarkNotSpam extends GuiAction { + + public MarkNotSpam() { + super( + MailboxTable.this, + "Mark not spam", + KeyStroke.getKeyStroke(KeyEvent.VK_M, KeyEvent.CTRL_DOWN_MASK), + "ctrl + u"); + + } + + public void actionPerformed(ActionEvent e) { + + MailboxHolder parent = (MailboxHolder)mailbox; + + while(parent.getParentMailbox() != null) { + + parent = parent.getParentMailbox(); + + } + + try { + + MailAccount a = (MailAccount)parent; + + if(a.getClassifier() == null) { + + CachedJDBCWordDataSource wds = + new CachedJDBCWordDataSource(new HSQLConnectionManager()); + + //IWordsDataSource wds = new SimpleWordsDataSource(); + IClassifier classifier = new BayesianClassifier(wds); + + a.setClassifier(classifier); + } + + if(a.getClassifier() != null) { + int[] selectedRows = getSelectedRows(); + + + for (int i = 0; i < selectedRows.length; i++) { + + Message message = mailbox.getMessage(selectedRows[i]); + + /*String header = ""; + + Object[] fields = message.getFieldNames(); + + for(int j = 0; j < fields.length; j++) { + + header += message.getField(fields[j].toString()) + " "; + + } + + System.out.println(header);*/ + + //message. + + ((BayesianClassifier)a.getClassifier()).teachNonMatch(message.getSubject()); + //((BayesianClassifier)a.getClassifier()).teachMatch(message.getFrom().getEmail()); + + + } + + } + + } catch (Exception f) { + + f.printStackTrace(); + } + + } + + + + } + + + class ClassifyAll extends GuiAction { + + public ClassifyAll() { + super( + MailboxTable.this, + "Classify all", + KeyStroke.getKeyStroke(KeyEvent.VK_Y, KeyEvent.CTRL_DOWN_MASK), + "ctrl + y"); + + } + + public void actionPerformed(ActionEvent e) { + + MailboxHolder parent = (MailboxHolder)mailbox; + + while(parent.getParentMailbox() != null) { + + parent = parent.getParentMailbox(); + + } + + try { + + MailAccount a = (MailAccount)parent; + + if(a.getClassifier() == null) { + + CachedJDBCWordDataSource wds = + new CachedJDBCWordDataSource(new HSQLConnectionManager()); + + + //IWordsDataSource wds = new SimpleWordsDataSource(); + IClassifier classifier = new BayesianClassifier(wds); + + a.setClassifier(classifier); + } + + if(a.getClassifier() != null) { + + + Message[] messages = mailbox.getMessages(); + + + for (int i = 0; i < messages.length; i++) { + + + /*String header = ""; + + Object[] fields = messages[i].getFieldNames(); + + for(int j = 0; j < fields.length; j++) { + + header += messages[i].getField(fields[j].toString()) + " "; + + } + ((BayesianClassifier)a.getClassifier()).teachMatch(); + ((BayesianClassifier)a.getClassifier()).teachMatch(message.getFrom().getEmail()); + */ + + + double dd = a.getClassifier().classify(messages[i].getSubject()); + + messages[i].setField("X-spamvalue", "" + dd); + + + } + + } + + } catch (Exception f) { + + f.printStackTrace(); + } + + } + + + + } class Cut extends GuiAction implements ClipboardOwner { *************** *** 2113,2116 **** --- 2352,2357 ---- actions[4] = new ShowCollumnAction("Attachments"); + + actions[4] = new ShowCollumnAction("X-spam"); return actions; Index: FilterConfig.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/mail/FilterConfig.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FilterConfig.java 21 Mar 2005 17:16:39 -0000 1.2 --- FilterConfig.java 24 Mar 2005 14:00:11 -0000 1.3 *************** *** 91,95 **** matchAny.addActionListener(listener); matchAll.addActionListener(listener); ! if(filter.getMatchType() == MailboxFilter.MATCHALL) matchAll.setSelected(true); else matchAny.setSelected(true); --- 91,95 ---- matchAny.addActionListener(listener); matchAll.addActionListener(listener); ! if(filter.getMatchType() == MailboxFilter.MATCH_ALL) matchAll.setSelected(true); else matchAny.setSelected(true); *************** *** 221,227 **** } else if (e.getActionCommand().equals(PropertyManager.getString("filter.radio.all"))) { ! filter.setMatchType(MailboxFilter.MATCHALL); } else if (e.getActionCommand().equals(PropertyManager.getString("filter.radio.any"))) { ! filter.setMatchType(MailboxFilter.MATCHANY); } else if (e.getActionCommand().equals(PropertyManager.getString("filter.radio.copy"))) { filter.setActionType(MailboxFilter.COPY); --- 221,227 ---- } else if (e.getActionCommand().equals(PropertyManager.getString("filter.radio.all"))) { ! filter.setMatchType(MailboxFilter.MATCH_ALL); } else if (e.getActionCommand().equals(PropertyManager.getString("filter.radio.any"))) { ! filter.setMatchType(MailboxFilter.MATCH_ANY); } else if (e.getActionCommand().equals(PropertyManager.getString("filter.radio.copy"))) { filter.setActionType(MailboxFilter.COPY); Index: MailboxTableModel.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/mail/MailboxTableModel.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MailboxTableModel.java 21 Mar 2005 17:16:39 -0000 1.3 --- MailboxTableModel.java 24 Mar 2005 14:00:11 -0000 1.4 *************** *** 121,124 **** --- 121,128 ---- return new Boolean(m.hasAttachments()); + } else if (header[column].equalsIgnoreCase("X-spam")) { + + return m.getField("X-spamvalue"); + } *************** *** 175,178 **** --- 179,186 ---- return "Att"; + } else if (header[column].equalsIgnoreCase("X-spam")) { + + return ("Spam score"); + } |
From: Stig T. <jw...@us...> - 2005-03-24 13:57:00
|
Update of /cvsroot/mailsomething/mailsomething/lib/jaf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25655/jaf Removed Files: activation.jar Log Message: --- activation.jar DELETED --- |
From: Stig T. <jw...@us...> - 2005-03-24 13:56:00
|
Update of /cvsroot/mailsomething/mailsomething/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24967 Added Files: commons-logging.jar Classifier4J-0.6.jar commons-logging-api.jar hsqldb.jar Log Message: --- NEW FILE: commons-logging.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: commons-logging-api.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: hsqldb.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Classifier4J-0.6.jar --- (This appears to be a binary file; contents omitted.) |
From: Stig T. <jw...@us...> - 2005-03-24 13:55:19
|
Update of /cvsroot/mailsomething/mailsomething/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24781 Removed Files: jazzy-core.jar Log Message: --- jazzy-core.jar DELETED --- |
From: Stig T. <jw...@us...> - 2005-03-24 13:55:11
|
Update of /cvsroot/mailsomething/mailsomething/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24596 Removed Files: cfactory.jar Log Message: --- cfactory.jar DELETED --- |
From: Stig T. <jw...@us...> - 2005-03-21 17:18:55
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1298/net/sf/mailsomething/util Modified Files: MimeTypeObjectSupport.java Log Message: Index: MimeTypeObjectSupport.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/util/MimeTypeObjectSupport.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MimeTypeObjectSupport.java 20 Mar 2005 20:47:19 -0000 1.3 --- MimeTypeObjectSupport.java 21 Mar 2005 17:18:43 -0000 1.4 *************** *** 23,27 **** import net.sf.mailsomething.mail.*; ! import net.sf.mailsomething.mail.MessageConstants; --- 23,27 ---- import net.sf.mailsomething.mail.*; ! import net.sf.mailsomething.mail.RFC822; *************** *** 114,118 **** if (fname == null) ! fname = object.getField(MessageConstants.CONTENT_ID); File file = new File(object.getFile().getParent(), fname); --- 114,118 ---- if (fname == null) ! fname = object.getField(RFC822.CONTENT_ID); File file = new File(object.getFile().getParent(), fname); *************** *** 541,545 **** if (fname == null) ! fname = object.getField(MessageConstants.CONTENT_ID); File file = new File(object.getFile().getParent(), fname); --- 541,545 ---- if (fname == null) ! fname = object.getField(RFC822.CONTENT_ID); File file = new File(object.getFile().getParent(), fname); *************** *** 821,825 **** //Console.println(object.getField(MessageConstants.CONTENT_ID) + object.getFilename()); ! if ((contentid = object.getField(MessageConstants.CONTENT_ID)) != null) { --- 821,825 ---- //Console.println(object.getField(MessageConstants.CONTENT_ID) + object.getFilename()); ! if ((contentid = object.getField(RFC822.CONTENT_ID)) != null) { *************** *** 890,894 **** if (fname == null) ! fname = object.getField(MessageConstants.CONTENT_ID); File file = new File(object.getFile().getParent(), fname); --- 890,894 ---- if (fname == null) ! fname = object.getField(RFC822.CONTENT_ID); File file = new File(object.getFile().getParent(), fname); |
From: Stig T. <jw...@us...> - 2005-03-21 17:18:38
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/parsers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1103/net/sf/mailsomething/mail/parsers Modified Files: MailEncoder.java MailDecoder.java NntpController.java ImapController.java Log Message: Index: ImapController.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/parsers/ImapController.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ImapController.java 20 Mar 2005 20:41:13 -0000 1.5 --- ImapController.java 21 Mar 2005 17:18:22 -0000 1.6 *************** *** 1853,1857 **** ! String command = "HEADER " + MessageConstants.MESSAGE_ID + " " + id; String[] serverreply = session.search(command); --- 1853,1857 ---- ! String command = "HEADER " + RFC822.MESSAGE_ID + " " + id; String[] serverreply = session.search(command); Index: MailEncoder.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/parsers/MailEncoder.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MailEncoder.java 20 Mar 2005 20:41:13 -0000 1.5 --- MailEncoder.java 21 Mar 2005 17:18:20 -0000 1.6 *************** *** 43,47 **** throws IOException { ! message.setField(MessageConstants.X.MAILER, "Mailsomething"); encodeBody(message, stream, true); --- 43,47 ---- throws IOException { ! message.setField(RFC822.X.MAILER, "Mailsomething"); encodeBody(message, stream, true); *************** *** 252,257 **** if (!top ! && fieldNames[i].equals(MessageConstants.MESSAGE_ID) ! || fieldNames[i].equals(MessageConstants.CONTENT_TYPE)) continue; --- 252,257 ---- if (!top ! && fieldNames[i].equals(RFC822.MESSAGE_ID) ! || fieldNames[i].equals(RFC822.CONTENT_TYPE)) continue; *************** *** 336,340 **** } else { ! if (message.getField(MessageConstants.CONTENT_TYPE) != null) { headerField = null; --- 336,340 ---- } else { ! if (message.getField(RFC822.CONTENT_TYPE) != null) { headerField = null; *************** *** 342,348 **** try { headerField = ! MessageConstants.CONTENT_TYPE + ": " ! + message.getField(MessageConstants.CONTENT_TYPE); } catch (ClassCastException f) { --- 342,348 ---- try { headerField = ! RFC822.CONTENT_TYPE + ": " ! + message.getField(RFC822.CONTENT_TYPE); } catch (ClassCastException f) { *************** *** 372,376 **** //out.write(CRLF, 0, CRLF.length); ! String contentType = message.getField(MessageConstants.CONTENT_TYPE); if (contentType == null) { --- 372,376 ---- //out.write(CRLF, 0, CRLF.length); ! String contentType = message.getField(RFC822.CONTENT_TYPE); if (contentType == null) { *************** *** 573,577 **** throws IOException { ! String contentType = message.getField(MessageConstants.CONTENT_TYPE); boolean isHtml = false; --- 573,577 ---- throws IOException { ! String contentType = message.getField(RFC822.CONTENT_TYPE); boolean isHtml = false; *************** *** 595,603 **** stream.read(body, 0, streamLength); ! if (message.getField(MessageConstants.CONTENT_TRANSFER_ENCODING) != null) { if (message ! .getField(MessageConstants.CONTENT_TRANSFER_ENCODING) .equalsIgnoreCase(MailDecoder.QP)) { --- 595,603 ---- stream.read(body, 0, streamLength); ! if (message.getField(RFC822.CONTENT_TRANSFER_ENCODING) != null) { if (message ! .getField(RFC822.CONTENT_TRANSFER_ENCODING) .equalsIgnoreCase(MailDecoder.QP)) { *************** *** 608,612 **** } else if ( message.getField( ! MessageConstants .CONTENT_TRANSFER_ENCODING) .equalsIgnoreCase( --- 608,612 ---- } else if ( message.getField( ! RFC822 .CONTENT_TRANSFER_ENCODING) .equalsIgnoreCase( *************** *** 738,746 **** stream.read(body, 0, streamLength); ! if (message.getField(MessageConstants.CONTENT_TRANSFER_ENCODING) != null) { if (message ! .getField(MessageConstants.CONTENT_TRANSFER_ENCODING) .equalsIgnoreCase(MailDecoder.QP)) { --- 738,746 ---- stream.read(body, 0, streamLength); ! if (message.getField(RFC822.CONTENT_TRANSFER_ENCODING) != null) { if (message ! .getField(RFC822.CONTENT_TRANSFER_ENCODING) .equalsIgnoreCase(MailDecoder.QP)) { *************** *** 751,755 **** } else if ( message.getField( ! MessageConstants .CONTENT_TRANSFER_ENCODING) .equalsIgnoreCase( --- 751,755 ---- } else if ( message.getField( ! RFC822 .CONTENT_TRANSFER_ENCODING) .equalsIgnoreCase( *************** *** 1324,1328 **** int lineswritten = 0; ! String contentType = message.getField(MessageConstants.CONTENT_TYPE); if (contentType == null) { --- 1324,1328 ---- int lineswritten = 0; ! String contentType = message.getField(RFC822.CONTENT_TYPE); if (contentType == null) { *************** *** 1391,1395 **** throws IOException { ! String contentType = message.getField(MessageConstants.CONTENT_TYPE); boolean isHtml = false; --- 1391,1395 ---- throws IOException { ! String contentType = message.getField(RFC822.CONTENT_TYPE); boolean isHtml = false; *************** *** 1415,1423 **** int lineswritten = 0; ! if (message.getField(MessageConstants.CONTENT_TRANSFER_ENCODING) != null) { if (message ! .getField(MessageConstants.CONTENT_TRANSFER_ENCODING) .equalsIgnoreCase(MailDecoder.QP)) { --- 1415,1423 ---- int lineswritten = 0; ! if (message.getField(RFC822.CONTENT_TRANSFER_ENCODING) != null) { if (message ! .getField(RFC822.CONTENT_TRANSFER_ENCODING) .equalsIgnoreCase(MailDecoder.QP)) { *************** *** 1429,1433 **** } else if ( message.getField( ! MessageConstants .CONTENT_TRANSFER_ENCODING) .equalsIgnoreCase( --- 1429,1433 ---- } else if ( message.getField( ! RFC822 .CONTENT_TRANSFER_ENCODING) .equalsIgnoreCase( *************** *** 1605,1613 **** int lineswritten = 0; ! if (message.getField(MessageConstants.CONTENT_TRANSFER_ENCODING) != null) { if (message ! .getField(MessageConstants.CONTENT_TRANSFER_ENCODING) .equalsIgnoreCase(MailDecoder.QP)) { --- 1605,1613 ---- int lineswritten = 0; ! if (message.getField(RFC822.CONTENT_TRANSFER_ENCODING) != null) { if (message ! .getField(RFC822.CONTENT_TRANSFER_ENCODING) .equalsIgnoreCase(MailDecoder.QP)) { *************** *** 1618,1622 **** } else if ( message.getField( ! MessageConstants .CONTENT_TRANSFER_ENCODING) .equalsIgnoreCase( --- 1618,1622 ---- } else if ( message.getField( ! RFC822 .CONTENT_TRANSFER_ENCODING) .equalsIgnoreCase( Index: NntpController.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/parsers/NntpController.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NntpController.java 20 Mar 2005 20:41:13 -0000 1.2 --- NntpController.java 21 Mar 2005 17:18:21 -0000 1.3 *************** *** 11,15 **** import net.sf.mailsomething.mail.MailService; import net.sf.mailsomething.mail.Message; ! import net.sf.mailsomething.mail.MessageConstants; import net.sf.mailsomething.mail.MessageHolder; import net.sf.mailsomething.mail.NntpAccount; --- 11,15 ---- import net.sf.mailsomething.mail.MailService; import net.sf.mailsomething.mail.Message; ! import net.sf.mailsomething.mail.RFC822; import net.sf.mailsomething.mail.MessageHolder; import net.sf.mailsomething.mail.NntpAccount; *************** *** 388,396 **** for (int i = 0; i < messages.length; i++) if (messages[i] ! .getField(MessageConstants.SUBJECT) .toLowerCase() .startsWith("re: ")) { ! if (messages[i].getField(MessageConstants.REFERENCES) != null) { --- 388,396 ---- for (int i = 0; i < messages.length; i++) if (messages[i] ! .getField(RFC822.SUBJECT) .toLowerCase() .startsWith("re: ")) { ! if (messages[i].getField(RFC822.REFERENCES) != null) { *************** *** 398,402 **** MailDecoder.getReferences( messages[i].getField( ! MessageConstants.REFERENCES)); for (int j = 0; j < refs.length; j++) { --- 398,402 ---- MailDecoder.getReferences( messages[i].getField( ! RFC822.REFERENCES)); for (int j = 0; j < refs.length; j++) { Index: MailDecoder.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/parsers/MailDecoder.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MailDecoder.java 20 Mar 2005 20:41:13 -0000 1.6 --- MailDecoder.java 21 Mar 2005 17:18:20 -0000 1.7 *************** *** 50,54 **** *@created October 7, 2001 */ ! public class MailDecoder extends Object implements MessageConstants { //a logger instance --- 50,54 ---- *@created October 7, 2001 */ ! public class MailDecoder extends Object implements RFC822 { //a logger instance *************** *** 514,518 **** case 0 : decodeFrom(value, header); ! header.setField(MessageConstants.FROM, value); break; case 1 : --- 514,518 ---- case 0 : decodeFrom(value, header); ! header.setField(RFC822.FROM, value); break; case 1 : *************** *** 521,525 **** case 2 : decodeTo(value, header); ! header.setField(MessageConstants.TO, value); break; case 3 : --- 521,525 ---- case 2 : decodeTo(value, header); ! header.setField(RFC822.TO, value); break; case 3 : *************** *** 856,860 **** } ! object.setField(MessageConstants.CONTENT_TYPE, contentType); try { --- 856,860 ---- } ! object.setField(RFC822.CONTENT_TYPE, contentType); try { *************** *** 977,981 **** if (object.getMimeType() != null ! && object.getField(MessageConstants.MESSAGE_ID) != null) { if (object.getMimeType().getSubType().equals("html")) { --- 977,981 ---- if (object.getMimeType() != null ! && object.getField(RFC822.MESSAGE_ID) != null) { if (object.getMimeType().getSubType().equals("html")) { *************** *** 1061,1065 **** string = removeMetaInfo(string); ! if (o.getField(MessageConstants.MESSAGE_ID).indexOf("hotmail") != -1) string = validateHotmail(string); --- 1061,1065 ---- string = removeMetaInfo(string); ! if (o.getField(RFC822.MESSAGE_ID).indexOf("hotmail") != -1) string = validateHotmail(string); *************** *** 1219,1223 **** */ private static void validateHeader(MimeTypeObject m) { ! if (m.getField(MessageConstants.MESSAGE_ID) == null) { String id = "mailsomething_"; --- 1219,1223 ---- */ private static void validateHeader(MimeTypeObject m) { ! if (m.getField(RFC822.MESSAGE_ID) == null) { String id = "mailsomething_"; *************** *** 1227,1231 **** id += d.getTime(); ! m.setField(MessageConstants.MESSAGE_ID, id); } --- 1227,1231 ---- id += d.getTime(); ! m.setField(RFC822.MESSAGE_ID, id); } *************** *** 1237,1259 **** * */ ! if (m.getField(MessageConstants.REPLY_TO) == null) { ! if (m.getField(MessageConstants.LIST_POST) != null ! || m.getField(MessageConstants.LIST_POST.toLowerCase()) != null) { ! if (m.getField(MessageConstants.LIST_POST) != null) { m.setField( ! MessageConstants.REPLY_TO, MailDecoder.decodeListPost( ! m.getField(MessageConstants.LIST_POST))); } else { m.setField( ! MessageConstants.REPLY_TO, MailDecoder.decodeListPost( m.getField( ! MessageConstants.LIST_POST.toLowerCase()))); } --- 1237,1259 ---- * */ ! if (m.getField(RFC822.REPLY_TO) == null) { ! if (m.getField(RFC822.LIST_POST) != null ! || m.getField(RFC822.LIST_POST.toLowerCase()) != null) { ! if (m.getField(RFC822.LIST_POST) != null) { m.setField( ! RFC822.REPLY_TO, MailDecoder.decodeListPost( ! m.getField(RFC822.LIST_POST))); } else { m.setField( ! RFC822.REPLY_TO, MailDecoder.decodeListPost( m.getField( ! RFC822.LIST_POST.toLowerCase()))); } *************** *** 1829,1837 **** //logger.finest("body filename=" + parent.getBody(i).getFile().getName()); ! if (parent.getBody(i).getField(MessageConstants.CONTENT_ID) != null) { if (parent .getBody(i) ! .getField(MessageConstants.CONTENT_ID) .equalsIgnoreCase(cid)) return parent.getBody(i).getFile().getName(); --- 1829,1837 ---- //logger.finest("body filename=" + parent.getBody(i).getFile().getName()); ! if (parent.getBody(i).getField(RFC822.CONTENT_ID) != null) { if (parent .getBody(i) ! .getField(RFC822.CONTENT_ID) .equalsIgnoreCase(cid)) return parent.getBody(i).getFile().getName(); *************** *** 2047,2051 **** String temp = header[i].toLowerCase(); ! if (header[i].indexOf(MessageConstants.CONTENT_TYPE) != -1) { String type = header[i].substring(header[i].indexOf(" ")); --- 2047,2051 ---- String temp = header[i].toLowerCase(); ! if (header[i].indexOf(RFC822.CONTENT_TYPE) != -1) { String type = header[i].substring(header[i].indexOf(" ")); *************** *** 2058,2062 **** } else if ( ! temp.indexOf(MessageConstants.CONTENT_CLASS.toLowerCase()) != -1) { --- 2058,2062 ---- } else if ( ! temp.indexOf(RFC822.CONTENT_CLASS.toLowerCase()) != -1) { |
From: Stig T. <jw...@us...> - 2005-03-21 17:18:09
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv906/net/sf/mailsomething/mail/actions Modified Files: GetMessagesAction.java CreateMailboxAction.java Log Message: Index: CreateMailboxAction.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/actions/CreateMailboxAction.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CreateMailboxAction.java 20 Mar 2005 20:39:38 -0000 1.2 --- CreateMailboxAction.java 21 Mar 2005 17:17:56 -0000 1.3 *************** *** 6,10 **** import net.sf.mailsomething.mail.MailAccount; import net.sf.mailsomething.mail.MailAction; - import net.sf.mailsomething.mail.PopAccount; import net.sf.mailsomething.mail.parsers.ImapController; import net.sf.mailsomething.util.ProgressListener; --- 6,9 ---- Index: GetMessagesAction.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/actions/GetMessagesAction.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GetMessagesAction.java 20 Mar 2005 20:39:38 -0000 1.3 --- GetMessagesAction.java 21 Mar 2005 17:17:56 -0000 1.4 *************** *** 15,19 **** import net.sf.mailsomething.mail.Mailbox; import net.sf.mailsomething.mail.Message; ! import net.sf.mailsomething.mail.MessageConstants; import net.sf.mailsomething.mail.MessageHolder; import net.sf.mailsomething.mail.ObjectHandler; --- 15,19 ---- import net.sf.mailsomething.mail.Mailbox; import net.sf.mailsomething.mail.Message; ! import net.sf.mailsomething.mail.RFC822; import net.sf.mailsomething.mail.MessageHolder; import net.sf.mailsomething.mail.ObjectHandler; *************** *** 48,52 **** //for using the default mechanisme (first time: date search, and after: unseen). ! public static final int DEFAULT = 7; --- 48,52 ---- //for using the default mechanisme (first time: date search, and after: unseen). ! public static final int DEFAULT = 1; *************** *** 165,171 **** m.setUID(uids[i].getUID()); ! m.setField(MessageConstants.SUBJECT, "unknown"); ! m.setField(MessageConstants.FROM, "unknown"); String message = --- 165,171 ---- m.setUID(uids[i].getUID()); ! m.setField(RFC822.SUBJECT, "unknown"); ! m.setField(RFC822.FROM, "unknown"); String message = *************** *** 256,263 **** case UNSEEN : seqenceNumbers = imapControll.searchUnseen(path); - /*checkedMailboxes.put( - path, - new Integer(controller.getExists()));*/ break; --- 256,266 ---- case UNSEEN : seqenceNumbers = imapControll.searchUnseen(path); + + if(mailbox instanceof Mailbox) { + + ((Mailbox)mailbox).setExists(imapControll.getExists()); + + } break; *************** *** 266,272 **** seqenceNumbers = imapControll.searchRecent(path); ! /*checkedMailboxes.put( ! path, ! new Integer(controller.getExists()));*/ break; --- 269,277 ---- seqenceNumbers = imapControll.searchRecent(path); ! if(mailbox instanceof Mailbox) { ! ! ((Mailbox)mailbox).setExists(imapControll.getExists()); ! ! } break; *************** *** 284,290 **** seqenceNumbers = getSequencesByDate(mailbox, path); ! /*checkedMailboxes.put( ! path, ! new Integer(controller.getExists()));*/ break; --- 289,297 ---- seqenceNumbers = getSequencesByDate(mailbox, path); ! if(mailbox instanceof Mailbox) { ! ! ((Mailbox)mailbox).setExists(imapControll.getExists()); ! ! } break; *************** *** 793,799 **** } ! if (message.getField(MessageConstants.MESSAGE_ID) == null) message.setField( ! MessageConstants.MESSAGE_ID, MailUtils.getUniqeID()); --- 800,806 ---- } ! if (message.getField(RFC822.MESSAGE_ID) == null) message.setField( ! RFC822.MESSAGE_ID, MailUtils.getUniqeID()); |
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv564/net/sf/mailsomething/mail Modified Files: SmtpAccount.java MessageBody.java ImapAccount.java TransparentMailbox.java FilterCriteria.java Mailbox.java MailboxListMessage.java MailUtils.java Message.java Draft.java Added Files: RFC822.java Removed Files: MessageConstants.java MailFilterRule.java MailFilter.java MailFilterAction.java Log Message: Index: ImapAccount.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/ImapAccount.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ImapAccount.java 20 Mar 2005 15:07:40 -0000 1.4 --- ImapAccount.java 21 Mar 2005 17:17:11 -0000 1.5 *************** *** 74,78 **** //if account is inited, after deserializing ! transient boolean isInited = false; //only headers is fetched, its up to the calling class to make sure --- 74,78 ---- //if account is inited, after deserializing ! //transient boolean isInited = false; //only headers is fetched, its up to the calling class to make sure *************** *** 278,286 **** */ public void init() { ! ! super.init(); ! if (isInited) return; //temporarely --- 278,286 ---- */ public void init() { ! if (isInited) return; + + super.init(); //temporarely Index: SmtpAccount.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/SmtpAccount.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SmtpAccount.java 20 Mar 2005 20:38:46 -0000 1.2 --- SmtpAccount.java 21 Mar 2005 17:17:11 -0000 1.3 *************** *** 164,168 **** } ! message.setField(MessageConstants.FROM, address.toString()); //if(jprops == null) createProperties(); --- 164,168 ---- } ! message.setField(RFC822.FROM, address.toString()); //if(jprops == null) createProperties(); --- MailFilterRule.java DELETED --- --- NEW FILE: RFC822.java --- package net.sf.mailsomething.mail; /** * * The fields arent meant to be exactly the same as an rfc822 header-fields. * They are meant for use for the mail-api. In most cases they are the same * though. Since I havent found any exact standard in the fieldnames for * rfc822 it would anyways be wrong to give the impression theese fields * despicts a non-standard. * * Theese fields are the fieldnames ones any client-class would expect to * find in a message, through getField(). eg. not getField(myownsubjectname) * but getField(MessageConstants.SUBJECT); * * To be absolute clear: this class isnt sufficient for maildecoding (locating) * rfc822 fields. */ public interface RFC822 { static final String FROM = "From"; //same as rfc822, a mailaddress static final String SUBJECT = "Subject"; //same as rfc822 static final String DATE = "Date"; // ................. static final String DELIVERY_DATE = "Delivery-date"; static final String TO = "To"; // ................ //a convinience field, with only the mailaddres eg rec...@ho... static final String TO_ADDRESS = "To-Address"; static final String ENVELOPE_TO = "Envelope-to"; static final String CONTENT_ID = "Content-Id"; //same as rfc822 static final String MIME_VERSION = "Mime-Version"; //same as rfc822 static final String MESSAGE_ID = "Message-Id"; //same as rfc822 static final String RECIEVED = "Recieved"; //same as rfc822 static final String CONTENT_TYPE = "Content-Type"; //same as rfc822 static final String CONTENT_DISPOSITION = "Content-Disposition"; //same as rfc822 static final String CONTENT_TRANSFER_ENCODING = "Content-Transfer-Encoding"; static final String CONTENT_CLASS = "Content-class"; static final String SENDER = "Sender"; //same as rfc822 static final String RETURN_PATH = "Return-Path"; //same as rfc822 static final String REPLY_TO = "Reply-To"; //same as rfc822 static final String IN_REPLY_TO = "In-Reply-To"; //same as rfc822 static final String CC = "Cc"; //same as rfc822 static final String BCC = "Bcc"; //same as rfc822 static final String DISPOSITION_NOTIFICATION_TO = "Disposition-Notification-To"; static final String THREAD_TOPIC = "Thread-Topic"; static final String THREAD_INDEX = "Thread-Index"; //being used to reference other messages (by messageid) for example in //nntp. static final String REFERENCES = "References"; static final String LIST_ID = "List-Id"; static final String LIST_POST = "List-Post"; public interface X { static final String MAILER = "X-Mailer"; static final String TEXT_CLASSIFICATION = "X-Text-Classification"; } } Index: TransparentMailbox.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/TransparentMailbox.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TransparentMailbox.java 20 Mar 2005 20:38:47 -0000 1.4 --- TransparentMailbox.java 21 Mar 2005 17:17:12 -0000 1.5 *************** *** 160,164 **** for (int i = 0; i < messages.size(); i++) { Message m = (Message) messages.elementAt(i); ! if (messageid.equals(m.getField(MessageConstants.MESSAGE_ID))) { return m; } --- 160,164 ---- for (int i = 0; i < messages.size(); i++) { Message m = (Message) messages.elementAt(i); ! if (messageid.equals(m.getField(RFC822.MESSAGE_ID))) { return m; } *************** *** 309,313 **** public synchronized void addMessage(Message message) { ! String messageid = message.getField(MessageConstants.MESSAGE_ID); if (messageid == null) { --- 309,313 ---- public synchronized void addMessage(Message message) { ! String messageid = message.getField(RFC822.MESSAGE_ID); if (messageid == null) { *************** *** 315,319 **** messageid = MailUtils.getUniqeID(); ! message.setField(MessageConstants.MESSAGE_ID, messageid); } else { --- 315,319 ---- messageid = MailUtils.getUniqeID(); ! message.setField(RFC822.MESSAGE_ID, messageid); } else { *************** *** 374,379 **** for (int i = 0; i < messages.size(); i++) { Message m = (Message) messages.elementAt(i); ! if (m.getField(MessageConstants.MESSAGE_ID) != null ! && messageid.equals(m.getField(MessageConstants.MESSAGE_ID))) { return true; } --- 374,379 ---- for (int i = 0; i < messages.size(); i++) { Message m = (Message) messages.elementAt(i); ! if (m.getField(RFC822.MESSAGE_ID) != null ! && messageid.equals(m.getField(RFC822.MESSAGE_ID))) { return true; } *************** *** 427,431 **** public void removeMessage(Message message) { ! if (!exists(message.getField(MessageConstants.MESSAGE_ID))) return; --- 427,431 ---- public void removeMessage(Message message) { ! if (!exists(message.getField(RFC822.MESSAGE_ID))) return; *************** *** 466,470 **** new MessageEvent( this, ! message.getField(MessageConstants.MESSAGE_ID), getMessageCount()); --- 466,470 ---- new MessageEvent( this, ! message.getField(RFC822.MESSAGE_ID), getMessageCount()); *************** *** 695,699 **** this, getMessage(getMessageCount() - 1).getField( ! MessageConstants.MESSAGE_ID), getMessageCount() - 1); --- 695,699 ---- this, getMessage(getMessageCount() - 1).getField( ! RFC822.MESSAGE_ID), getMessageCount() - 1); --- MailFilterAction.java DELETED --- Index: FilterCriteria.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/FilterCriteria.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FilterCriteria.java 3 Apr 2004 07:56:48 -0000 1.1 --- FilterCriteria.java 21 Mar 2005 17:17:12 -0000 1.2 *************** *** 26,30 **** boolean conditionFound = false; ! if (field.equals(MessageConstants.FROM)) { MailAddress address = message.getFrom(); String fromEmail = address.getEmail(); --- 26,30 ---- boolean conditionFound = false; ! if (field.equals(RFC822.FROM)) { MailAddress address = message.getFrom(); String fromEmail = address.getEmail(); *************** *** 34,38 **** ! } else if(field.equals(MessageConstants.TO)) { AddressList addressList = message.getTo(); MailAddress[] addresses = addressList.getAddresses(); --- 34,38 ---- ! } else if(field.equals(RFC822.TO)) { AddressList addressList = message.getTo(); MailAddress[] addresses = addressList.getAddresses(); *************** *** 45,49 **** } } ! } else if (field.equals(MessageConstants.CC)) { /* AddressList addressList = message.getCC(); --- 45,49 ---- } } ! } else if (field.equals(RFC822.CC)) { /* AddressList addressList = message.getCC(); *************** *** 59,63 **** */ ! } else if (field.equals(MessageConstants.SUBJECT)) { String subject = message.getSubject(); --- 59,63 ---- */ ! } else if (field.equals(RFC822.SUBJECT)) { String subject = message.getSubject(); Index: MailUtils.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/MailUtils.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MailUtils.java 20 Mar 2005 20:38:47 -0000 1.3 --- MailUtils.java 21 Mar 2005 17:17:13 -0000 1.4 *************** *** 298,307 **** } else if ( message.getBody(i).getField( ! MessageConstants.CONTENT_TYPE) != null) { String contentType = message.getBody(i).getField( ! MessageConstants.CONTENT_TYPE); if (contentType.equals(ContentTypes.TEXT_PLAIN)) { --- 298,307 ---- } else if ( message.getBody(i).getField( ! RFC822.CONTENT_TYPE) != null) { String contentType = message.getBody(i).getField( ! RFC822.CONTENT_TYPE); if (contentType.equals(ContentTypes.TEXT_PLAIN)) { --- MailFilter.java DELETED --- Index: MailboxListMessage.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/MailboxListMessage.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MailboxListMessage.java 3 Apr 2004 07:56:48 -0000 1.1 --- MailboxListMessage.java 21 Mar 2005 17:17:13 -0000 1.2 *************** *** 33,43 **** //theres no direct need to set this, but I plan to use it to //check if a remote message is equevalent to the local copy ! setField(MessageConstants.MESSAGE_ID, MailUtils.getUniqeID()); //set the contenttype to plain text. ! setField(MessageConstants.CONTENT_TYPE, "text/plain"); //set the subject ! setField(MessageConstants.SUBJECT, ".mailboxlist"); --- 33,43 ---- //theres no direct need to set this, but I plan to use it to //check if a remote message is equevalent to the local copy ! setField(RFC822.MESSAGE_ID, MailUtils.getUniqeID()); //set the contenttype to plain text. ! setField(RFC822.CONTENT_TYPE, "text/plain"); //set the subject ! setField(RFC822.SUBJECT, ".mailboxlist"); Index: Draft.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/Draft.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Draft.java 20 Mar 2005 20:38:47 -0000 1.3 --- Draft.java 21 Mar 2005 17:17:13 -0000 1.4 *************** *** 25,29 **** super(); ! setField(MessageConstants.MESSAGE_ID, MailUtils.getUniqeID()); } --- 25,29 ---- super(); ! setField(RFC822.MESSAGE_ID, MailUtils.getUniqeID()); } *************** *** 46,50 **** if (getBody(0) ! .getField(MessageConstants.CONTENT_TYPE) .indexOf(contentType) != -1) { --- 46,50 ---- if (getBody(0) ! .getField(RFC822.CONTENT_TYPE) .indexOf(contentType) != -1) { *************** *** 59,64 **** } else if ( getBodyCount() == 0 ! && getField(MessageConstants.CONTENT_TYPE) != null ! && getField(MessageConstants.CONTENT_TYPE).indexOf(contentType) != -1) { --- 59,64 ---- } else if ( getBodyCount() == 0 ! && getField(RFC822.CONTENT_TYPE) != null ! && getField(RFC822.CONTENT_TYPE).indexOf(contentType) != -1) { *************** *** 70,74 **** if (getBody(i) ! .getField(MessageConstants.CONTENT_TYPE) .indexOf(contentType) != -1) { --- 70,74 ---- if (getBody(i) ! .getField(RFC822.CONTENT_TYPE) .indexOf(contentType) != -1) { *************** *** 104,111 **** MessageBody body = (MessageBody) getBody(0); ! body.setField(MessageConstants.CONTENT_TYPE, "text/plain"); super.setField( ! MessageConstants.CONTENT_TYPE, "text/plain; charset=\"iso-8859-1\""); --- 104,111 ---- MessageBody body = (MessageBody) getBody(0); ! body.setField(RFC822.CONTENT_TYPE, "text/plain"); super.setField( ! RFC822.CONTENT_TYPE, "text/plain; charset=\"iso-8859-1\""); *************** *** 128,132 **** body.setObject(text); ! body.setField(MessageConstants.CONTENT_TYPE, "text/plain"); addBody(body); --- 128,132 ---- body.setObject(text); ! body.setField(RFC822.CONTENT_TYPE, "text/plain"); addBody(body); *************** *** 135,139 **** //of creating this draft can change it if necessary. super.setField( ! MessageConstants.CONTENT_TYPE, "multipart/alternative"); --- 135,139 ---- //of creating this draft can change it if necessary. super.setField( ! RFC822.CONTENT_TYPE, "multipart/alternative"); *************** *** 161,170 **** body.setObject(bytes); ! if (getField(MessageConstants.CONTENT_TYPE) != null) { //set the contenttype as the same as the draft. body.setField( ! MessageConstants.CONTENT_TYPE, ! getField(MessageConstants.CONTENT_TYPE)); } --- 161,170 ---- body.setObject(bytes); ! if (getField(RFC822.CONTENT_TYPE) != null) { //set the contenttype as the same as the draft. body.setField( ! RFC822.CONTENT_TYPE, ! getField(RFC822.CONTENT_TYPE)); } *************** *** 229,237 **** body.setField( ! MessageConstants.CONTENT_TYPE, ContentTypes.TEXT_HTML); super.setField( ! MessageConstants.CONTENT_TYPE, ContentTypes.TEXT_HTML); --- 229,237 ---- body.setField( ! RFC822.CONTENT_TYPE, ContentTypes.TEXT_HTML); super.setField( ! RFC822.CONTENT_TYPE, ContentTypes.TEXT_HTML); *************** *** 260,264 **** body.setField( ! MessageConstants.CONTENT_TYPE, ContentTypes.TEXT_HTML); --- 260,264 ---- body.setField( ! RFC822.CONTENT_TYPE, ContentTypes.TEXT_HTML); *************** *** 268,272 **** //of creating this draft can change it if necessary. super.setField( ! MessageConstants.CONTENT_TYPE, "multipart/alternative"); --- 268,272 ---- //of creating this draft can change it if necessary. super.setField( ! RFC822.CONTENT_TYPE, "multipart/alternative"); *************** *** 320,324 **** //we allready have 1 body, set the mimetype to mixed ! super.setField(MessageConstants.CONTENT_TYPE, "multipart/mixed"); try { --- 320,324 ---- //we allready have 1 body, set the mimetype to mixed ! super.setField(RFC822.CONTENT_TYPE, "multipart/mixed"); try { *************** *** 338,342 **** //contenttype ! if (getField(MessageConstants.CONTENT_TYPE) .equals("multipart/alternative")) { --- 338,342 ---- //contenttype ! if (getField(RFC822.CONTENT_TYPE) .equals("multipart/alternative")) { *************** *** 367,392 **** } else if (getBodyCount() == 0) { ! if (o.getField(MessageConstants.CONTENT_TYPE) != null) { setField( ! MessageConstants.CONTENT_TYPE, ! o.getField(MessageConstants.CONTENT_TYPE)); } ! if (o.getField(MessageConstants.CONTENT_TRANSFER_ENCODING) != null) { setField( ! MessageConstants.CONTENT_TRANSFER_ENCODING, ! o.getField(MessageConstants.CONTENT_TRANSFER_ENCODING)); } ! if (o.getField(MessageConstants.CONTENT_DISPOSITION) != null) { setField( ! MessageConstants.CONTENT_DISPOSITION, ! o.getField(MessageConstants.CONTENT_DISPOSITION)); } --- 367,392 ---- } else if (getBodyCount() == 0) { ! if (o.getField(RFC822.CONTENT_TYPE) != null) { setField( ! RFC822.CONTENT_TYPE, ! o.getField(RFC822.CONTENT_TYPE)); } ! if (o.getField(RFC822.CONTENT_TRANSFER_ENCODING) != null) { setField( ! RFC822.CONTENT_TRANSFER_ENCODING, ! o.getField(RFC822.CONTENT_TRANSFER_ENCODING)); } ! if (o.getField(RFC822.CONTENT_DISPOSITION) != null) { setField( ! RFC822.CONTENT_DISPOSITION, ! o.getField(RFC822.CONTENT_DISPOSITION)); } *************** *** 411,423 **** b.setField( ! MessageConstants.CONTENT_TYPE, "application/octet-stream; name=\"" + file.getName() + "\""); //could use contentid here b.setField( ! MessageConstants.CONTENT_DISPOSITION, "attachment; filename=\"" + file.getName() + "\""); ! b.setField(MessageConstants.CONTENT_TRANSFER_ENCODING, "base64"); addAttachment(b); --- 411,423 ---- b.setField( ! RFC822.CONTENT_TYPE, "application/octet-stream; name=\"" + file.getName() + "\""); //could use contentid here b.setField( ! RFC822.CONTENT_DISPOSITION, "attachment; filename=\"" + file.getName() + "\""); ! b.setField(RFC822.CONTENT_TRANSFER_ENCODING, "base64"); addAttachment(b); *************** *** 441,445 **** } ! super.setField(MessageConstants.TO, address.toString()); } --- 441,445 ---- } ! super.setField(RFC822.TO, address.toString()); } *************** *** 449,453 **** //super.setField(name, value); ! if (name.equals(MessageConstants.TO)) { //System.out.println("setto" + value); --- 449,453 ---- //super.setField(name, value); ! if (name.equals(RFC822.TO)) { //System.out.println("setto" + value); *************** *** 477,483 **** setTo(tolist); ! super.setField(MessageConstants.TO, tolist.toString()); ! } else if (name.equals(MessageConstants.CONTENT_TYPE)) { if (getBodyCount() == 1) { --- 477,483 ---- setTo(tolist); ! super.setField(RFC822.TO, tolist.toString()); ! } else if (name.equals(RFC822.CONTENT_TYPE)) { if (getBodyCount() == 1) { *************** *** 503,507 **** public void setSubject(String subject) { ! setField(MessageConstants.SUBJECT, subject); --- 503,507 ---- public void setSubject(String subject) { ! setField(RFC822.SUBJECT, subject); Index: MessageBody.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/MessageBody.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MessageBody.java 20 Mar 2005 20:38:46 -0000 1.3 --- MessageBody.java 21 Mar 2005 17:17:11 -0000 1.4 *************** *** 205,213 **** if(mimetype != null) return mimetype; ! else if(getField(MessageConstants.CONTENT_TYPE) != null) { try { ! mimetype = new MimeType(getField(MessageConstants.CONTENT_TYPE)); } catch (MimeTypeParseException f) { --- 205,213 ---- if(mimetype != null) return mimetype; ! else if(getField(RFC822.CONTENT_TYPE) != null) { try { ! mimetype = new MimeType(getField(RFC822.CONTENT_TYPE)); } catch (MimeTypeParseException f) { Index: Mailbox.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/Mailbox.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Mailbox.java 20 Mar 2005 20:38:47 -0000 1.5 --- Mailbox.java 21 Mar 2005 17:17:12 -0000 1.6 *************** *** 269,273 **** for (int i = 0; i < messages.size(); i++) { Message m = (Message) messages.elementAt(i); ! if (messageid.equals(m.getField(MessageConstants.MESSAGE_ID))) { return m; } --- 269,273 ---- for (int i = 0; i < messages.size(); i++) { Message m = (Message) messages.elementAt(i); ! if (messageid.equals(m.getField(RFC822.MESSAGE_ID))) { return m; } *************** *** 512,516 **** public synchronized void addMessage(Message message) { ! String messageid = message.getField(MessageConstants.MESSAGE_ID); if (messageid == null) { --- 512,516 ---- public synchronized void addMessage(Message message) { ! String messageid = message.getField(RFC822.MESSAGE_ID); if (messageid == null) { *************** *** 518,522 **** messageid = MailUtils.getUniqeID(); ! message.setField(MessageConstants.MESSAGE_ID, messageid); } else { --- 518,522 ---- messageid = MailUtils.getUniqeID(); ! message.setField(RFC822.MESSAGE_ID, messageid); } else { *************** *** 685,690 **** for (int i = 0; i < messages.size(); i++) { Message m = (Message) messages.elementAt(i); ! if (m.getField(MessageConstants.MESSAGE_ID) != null ! && messageid.equals(m.getField(MessageConstants.MESSAGE_ID))) { return true; } --- 685,690 ---- for (int i = 0; i < messages.size(); i++) { Message m = (Message) messages.elementAt(i); ! if (m.getField(RFC822.MESSAGE_ID) != null ! && messageid.equals(m.getField(RFC822.MESSAGE_ID))) { return true; } *************** *** 844,848 **** public void removeMessage(Message message) { ! if (!exists(message.getField(MessageConstants.MESSAGE_ID))) return; --- 844,848 ---- public void removeMessage(Message message) { ! if (!exists(message.getField(RFC822.MESSAGE_ID))) return; *************** *** 882,886 **** new MessageEvent( this, ! message.getField(MessageConstants.MESSAGE_ID), getMessageCount()); --- 882,886 ---- new MessageEvent( this, ! message.getField(RFC822.MESSAGE_ID), getMessageCount()); *************** *** 1475,1479 **** this, getMessage(getMessageCount() - 1).getField( ! MessageConstants.MESSAGE_ID), getMessageCount() - 1); --- 1475,1479 ---- this, getMessage(getMessageCount() - 1).getField( ! RFC822.MESSAGE_ID), getMessageCount() - 1); --- MessageConstants.java DELETED --- Index: Message.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/Message.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Message.java 14 Mar 2005 20:27:52 -0000 1.5 --- Message.java 21 Mar 2005 17:17:13 -0000 1.6 *************** *** 319,326 **** public String[] getReferrences() { ! if(getField(MessageConstants.REFERENCES) == null) return null; ! return MailDecoder.getReferences(getField(MessageConstants.REFERENCES)); --- 319,326 ---- public String[] getReferrences() { ! if(getField(RFC822.REFERENCES) == null) return null; ! return MailDecoder.getReferences(getField(RFC822.REFERENCES)); *************** *** 337,341 **** Message m = (Message)super.clone(); ! m.setField(MessageConstants.MESSAGE_ID, MailUtils.getUniqeID()); return m; --- 337,341 ---- Message m = (Message)super.clone(); ! m.setField(RFC822.MESSAGE_ID, MailUtils.getUniqeID()); return m; *************** *** 364,368 **** String stringdate = buffer.toString(); ! setField(MessageConstants.DATE, stringdate); } --- 364,368 ---- String stringdate = buffer.toString(); ! setField(RFC822.DATE, stringdate); } *************** *** 375,379 **** public String getSubject() { ! String s = (String) getField(MessageConstants.SUBJECT); if (s == null) --- 375,379 ---- public String getSubject() { ! String s = (String) getField(RFC822.SUBJECT); if (s == null) *************** *** 404,413 **** */ String datestring = ! getField(MessageConstants.DELIVERY_DATE); //just double checking if(datestring == null) { ! datestring = getField(MessageConstants.DATE); if(datestring == null) { --- 404,413 ---- */ String datestring = ! getField(RFC822.DELIVERY_DATE); //just double checking if(datestring == null) { ! datestring = getField(RFC822.DATE); if(datestring == null) { *************** *** 415,419 **** doDate(); ! datestring = getField(MessageConstants.DATE); } --- 415,419 ---- doDate(); ! datestring = getField(RFC822.DATE); } |
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv303/net/sf/mailsomething/gui/mail Modified Files: TreeStyleMailboxTableModel.java MessageViewer.java MailEditor.java MailboxTableModel.java FilterConfig.java MailboxTable.java Log Message: Index: MessageViewer.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/mail/MessageViewer.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MessageViewer.java 20 Mar 2005 20:36:45 -0000 1.5 --- MessageViewer.java 21 Mar 2005 17:16:38 -0000 1.6 *************** *** 18,22 **** import net.sf.mailsomething.mail.*; import net.sf.mailsomething.mail.Message; ! import net.sf.mailsomething.mail.MessageConstants; import net.sf.mailsomething.mail.actions.GetMessageBodyAction; --- 18,22 ---- import net.sf.mailsomething.mail.*; import net.sf.mailsomething.mail.Message; ! import net.sf.mailsomething.mail.RFC822; import net.sf.mailsomething.mail.actions.GetMessageBodyAction; *************** *** 146,150 **** displayMessage(message); ! String name = message.getField(MessageConstants.SUBJECT); if (name.equals("") == false) { --- 146,150 ---- displayMessage(message); ! String name = message.getField(RFC822.SUBJECT); if (name.equals("") == false) { *************** *** 154,158 **** } else { ! name = message.getField(MessageConstants.FROM); if (name.equals("") == false) { --- 154,158 ---- } else { ! name = message.getField(RFC822.FROM); if (name.equals("") == false) { *************** *** 660,664 **** if (header.isDraft()) headerPanel.setFrom( ! "To: " + header.getField(MessageConstants.TO)); else if (header.getFrom() != null) headerPanel.setFrom("From: " + header.getFrom().getAlias()); --- 660,664 ---- if (header.isDraft()) headerPanel.setFrom( ! "To: " + header.getField(RFC822.TO)); else if (header.getFrom() != null) headerPanel.setFrom("From: " + header.getFrom().getAlias()); *************** *** 666,670 **** headerPanel.setFrom("From: "); ! headerPanel.setSubject(header.getField(MessageConstants.SUBJECT)); //} --- 666,670 ---- headerPanel.setFrom("From: "); ! headerPanel.setSubject(header.getField(RFC822.SUBJECT)); //} *************** *** 831,835 **** String contentDisposition = ! o.getField(MessageConstants.CONTENT_DISPOSITION); if (contentDisposition != null --- 831,835 ---- String contentDisposition = ! o.getField(RFC822.CONTENT_DISPOSITION); if (contentDisposition != null *************** *** 861,865 **** String name = "Message: " ! + o.getField(MessageConstants.SUBJECT); attachNames.add(name); attachFilenames.add(o.getFilename()); --- 861,865 ---- String name = "Message: " ! + o.getField(RFC822.SUBJECT); attachNames.add(name); attachFilenames.add(o.getFilename()); *************** *** 925,929 **** //JLabel dateLabel = new JLabel("<html>Date: " + "<font color=blue>" + b.getField(MessageConstants.DATE) + "</font>"); ! JLabel date1Label = new JLabel(b.getField(MessageConstants.DATE)); datepanel.add(dateLabel); --- 925,929 ---- //JLabel dateLabel = new JLabel("<html>Date: " + "<font color=blue>" + b.getField(MessageConstants.DATE) + "</font>"); ! JLabel date1Label = new JLabel(b.getField(RFC822.DATE)); datepanel.add(dateLabel); *************** *** 946,950 **** if (b.isDraft()) fromLabel = ! new JLabel("To: " + b.getField(MessageConstants.TO)); else if (b.getFrom() != null) fromLabel = new JLabel("From: " + b.getFrom().getAlias()); --- 946,950 ---- if (b.isDraft()) fromLabel = ! new JLabel("To: " + b.getField(RFC822.TO)); else if (b.getFrom() != null) fromLabel = new JLabel("From: " + b.getFrom().getAlias()); *************** *** 960,964 **** subjectLabel = ! new JLabel("Subject: " + b.getField(MessageConstants.SUBJECT)); subjectLabel.setForeground(new Color(40, 50, 100)); --- 960,964 ---- subjectLabel = ! new JLabel("Subject: " + b.getField(RFC822.SUBJECT)); subjectLabel.setForeground(new Color(40, 50, 100)); Index: MailEditor.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/mail/MailEditor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MailEditor.java 20 Mar 2005 20:36:45 -0000 1.4 --- MailEditor.java 21 Mar 2005 17:16:38 -0000 1.5 *************** *** 477,481 **** if (header.toField.getText().indexOf("@") != -1) { ! draft.setField(MessageConstants.TO, header.toField.getText()); } else if (header.keys != null) { --- 477,481 ---- if (header.toField.getText().indexOf("@") != -1) { ! draft.setField(RFC822.TO, header.toField.getText()); } else if (header.keys != null) { *************** *** 503,507 **** emails.append(";" + addresses[++i].getEmail()); } ! draft.setField(MessageConstants.TO, emails.toString()); } } else { --- 503,507 ---- emails.append(";" + addresses[++i].getEmail()); } ! draft.setField(RFC822.TO, emails.toString()); } } else { *************** *** 518,522 **** //m.setTo() draft.setField( ! MessageConstants.TO, addresses[0].getEmail()); --- 518,522 ---- //m.setTo() draft.setField( ! RFC822.TO, addresses[0].getEmail()); *************** *** 588,592 **** } ! draft.setField(MessageConstants.TO, add.getEmail()); --- 588,592 ---- } ! draft.setField(RFC822.TO, add.getEmail()); *************** *** 690,694 **** toField = new AddressTextfield( ! message.getField(MessageConstants.TO)); } else { --- 690,694 ---- toField = new AddressTextfield( ! message.getField(RFC822.TO)); } else { *************** *** 696,701 **** String temp = ""; ! if (message.getField(MessageConstants.REPLY_TO) != null) ! temp = message.getField(MessageConstants.REPLY_TO); else temp = message.getFrom().toString(); --- 696,701 ---- String temp = ""; ! if (message.getField(RFC822.REPLY_TO) != null) ! temp = message.getField(RFC822.REPLY_TO); else temp = message.getFrom().toString(); *************** *** 773,777 **** subjectField = new JTextField( ! message.getField(MessageConstants.SUBJECT)); } else { --- 773,777 ---- subjectField = new JTextField( ! message.getField(RFC822.SUBJECT)); } else { *************** *** 1097,1101 **** .exists( message.getField( ! MessageConstants.MESSAGE_ID))) drafts.addMessage(message); --- 1097,1101 ---- .exists( message.getField( ! RFC822.MESSAGE_ID))) drafts.addMessage(message); *************** *** 1137,1141 **** if (!drafts ! .exists(message.getField(MessageConstants.MESSAGE_ID))) drafts.addMessage(message); --- 1137,1141 ---- if (!drafts ! .exists(message.getField(RFC822.MESSAGE_ID))) drafts.addMessage(message); *************** *** 1148,1152 **** if (!drafts .exists( ! message.getField(MessageConstants.MESSAGE_ID))) { drafts.addMessage(message); --- 1148,1152 ---- if (!drafts .exists( ! message.getField(RFC822.MESSAGE_ID))) { drafts.addMessage(message); *************** *** 2057,2073 **** stamp += '\n'; ! stamp += "From: " + message.getField(MessageConstants.FROM); stamp += '\n'; ! stamp += "To: " + message.getField(MessageConstants.TO); stamp += '\n'; ! stamp += "Sent: " + message.getField(MessageConstants.DATE); stamp += '\n'; ! stamp += "Subject: " + message.getField(MessageConstants.SUBJECT); stamp += '\n'; --- 2057,2073 ---- stamp += '\n'; ! stamp += "From: " + message.getField(RFC822.FROM); stamp += '\n'; ! stamp += "To: " + message.getField(RFC822.TO); stamp += '\n'; ! stamp += "Sent: " + message.getField(RFC822.DATE); stamp += '\n'; ! stamp += "Subject: " + message.getField(RFC822.SUBJECT); stamp += '\n'; *************** *** 2095,2101 **** return; ! if (message.getField(MessageConstants.REPLY_TO) != null) { ! header.toField.setText(message.getField(MessageConstants.REPLY_TO)); } else if (message.getFrom() != null) { --- 2095,2101 ---- return; ! if (message.getField(RFC822.REPLY_TO) != null) { ! header.toField.setText(message.getField(RFC822.REPLY_TO)); } else if (message.getFrom() != null) { *************** *** 2103,2109 **** header.toField.setText(message.getFrom().toString()); ! } else if (message.getField(MessageConstants.FROM) != null) { ! header.toField.setText(message.getField(MessageConstants.FROM)); } --- 2103,2109 ---- header.toField.setText(message.getFrom().toString()); ! } else if (message.getField(RFC822.FROM) != null) { ! header.toField.setText(message.getField(RFC822.FROM)); } Index: MailboxTableModel.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/mail/MailboxTableModel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MailboxTableModel.java 20 Mar 2005 20:36:45 -0000 1.2 --- MailboxTableModel.java 21 Mar 2005 17:16:39 -0000 1.3 *************** *** 6,10 **** import net.sf.mailsomething.mail.Message; ! import net.sf.mailsomething.mail.MessageConstants; import net.sf.mailsomething.mail.MessageEvent; import net.sf.mailsomething.mail.MessageHolder; --- 6,10 ---- import net.sf.mailsomething.mail.Message; ! import net.sf.mailsomething.mail.RFC822; import net.sf.mailsomething.mail.MessageEvent; import net.sf.mailsomething.mail.MessageHolder; *************** *** 87,95 **** return "error"; ! if (header[column].equals(MessageConstants.SUBJECT)) { ! return " " + m.getField(MessageConstants.SUBJECT); ! } else if (header[column].equals(MessageConstants.FROM)) { if (m.isDraft()) { --- 87,95 ---- return "error"; ! if (header[column].equals(RFC822.SUBJECT)) { ! return " " + m.getField(RFC822.SUBJECT); ! } else if (header[column].equals(RFC822.FROM)) { if (m.isDraft()) { *************** *** 97,101 **** //isDraft = true; ! return m.getField(MessageConstants.TO); } else { --- 97,101 ---- //isDraft = true; ! return m.getField(RFC822.TO); } else { *************** *** 109,113 **** } ! } else if (header[column].equals(MessageConstants.DATE)) { return m.getDate(); --- 109,113 ---- } ! } else if (header[column].equals(RFC822.DATE)) { return m.getDate(); *************** *** 151,159 **** public String getColumnName(int column) { ! if (header[column].equals(MessageConstants.SUBJECT)) { return "Subject"; ! } else if (header[column].equals(MessageConstants.FROM)) { if (isDraft) --- 151,159 ---- public String getColumnName(int column) { ! if (header[column].equals(RFC822.SUBJECT)) { return "Subject"; ! } else if (header[column].equals(RFC822.FROM)) { if (isDraft) *************** *** 163,167 **** return "Sender"; ! } else if (header[column].equals(MessageConstants.DATE)) { return "Date"; --- 163,167 ---- return "Sender"; ! } else if (header[column].equals(RFC822.DATE)) { return "Date"; *************** *** 241,245 **** public Class getColumnClass(int column) { ! if (header[column].equals(MessageConstants.DATE)) return Date.class; --- 241,245 ---- public Class getColumnClass(int column) { ! if (header[column].equals(RFC822.DATE)) return Date.class; Index: FilterConfig.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/mail/FilterConfig.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FilterConfig.java 3 Apr 2004 07:56:48 -0000 1.1 --- FilterConfig.java 21 Mar 2005 17:16:39 -0000 1.2 *************** *** 40,44 **** //Get values from current Filter Criteria[] filtercriteria = currentFilter.getCriteria(); ! String[] criteriaTypes = {MessageConstants.FROM, MessageConstants.SUBJECT, MessageConstants.TO, MessageConstants.CC}; /* If adding a new filter, then currentFilter is null, else you are editing --- 40,44 ---- //Get values from current Filter Criteria[] filtercriteria = currentFilter.getCriteria(); ! String[] criteriaTypes = {RFC822.FROM, RFC822.SUBJECT, RFC822.TO, RFC822.CC}; /* If adding a new filter, then currentFilter is null, else you are editing Index: MailboxTable.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/mail/MailboxTable.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MailboxTable.java 20 Mar 2005 20:36:46 -0000 1.3 --- MailboxTable.java 21 Mar 2005 17:16:40 -0000 1.4 *************** *** 142,148 **** private String[] headerTypes = new String[] { ! MessageConstants.SUBJECT, ! MessageConstants.FROM, ! MessageConstants.DATE }; /** --- 142,148 ---- private String[] headerTypes = new String[] { ! RFC822.SUBJECT, ! RFC822.FROM, ! RFC822.DATE }; /** Index: TreeStyleMailboxTableModel.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/mail/TreeStyleMailboxTableModel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TreeStyleMailboxTableModel.java 3 Apr 2004 07:56:49 -0000 1.1 --- TreeStyleMailboxTableModel.java 21 Mar 2005 17:16:38 -0000 1.2 *************** *** 432,440 **** return "error"; ! if (header[column].equals(MessageConstants.SUBJECT)) { ! return " " + m.getField(MessageConstants.SUBJECT); ! } else if (header[column].equals(MessageConstants.FROM)) { if (m.isDraft()) { --- 432,440 ---- return "error"; ! if (header[column].equals(RFC822.SUBJECT)) { ! return " " + m.getField(RFC822.SUBJECT); ! } else if (header[column].equals(RFC822.FROM)) { if (m.isDraft()) { *************** *** 442,446 **** //isDraft = true; ! return m.getField(MessageConstants.TO); } else { --- 442,446 ---- //isDraft = true; ! return m.getField(RFC822.TO); } else { *************** *** 454,458 **** } ! } else if (header[column].equals(MessageConstants.DATE)) { return m.getDate(); --- 454,458 ---- } ! } else if (header[column].equals(RFC822.DATE)) { return m.getDate(); |
From: Stig T. <jw...@us...> - 2005-03-21 17:16:21
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/contact In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32600/net/sf/mailsomething/contact Modified Files: ContactMessage.java Log Message: Index: ContactMessage.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/contact/ContactMessage.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ContactMessage.java 11 Mar 2005 11:58:24 -0000 1.2 --- ContactMessage.java 21 Mar 2005 17:16:10 -0000 1.3 *************** *** 16,20 **** import net.sf.mailsomething.mail.MailUtils; import net.sf.mailsomething.mail.Message; ! import net.sf.mailsomething.mail.MessageConstants; import net.sf.mailsomething.mail.MimeType; import net.sf.mailsomething.mail.MimeTypeParseException; --- 16,20 ---- import net.sf.mailsomething.mail.MailUtils; import net.sf.mailsomething.mail.Message; ! import net.sf.mailsomething.mail.RFC822; import net.sf.mailsomething.mail.MimeType; import net.sf.mailsomething.mail.MimeTypeParseException; *************** *** 53,59 **** super(); ! setField(MessageConstants.MESSAGE_ID, MailUtils.getUniqeID()); ! setField(MessageConstants.CONTENT_TYPE, "text/directory"); //setRevisionDate(getDate()); --- 53,59 ---- super(); ! setField(RFC822.MESSAGE_ID, MailUtils.getUniqeID()); ! setField(RFC822.CONTENT_TYPE, "text/directory"); //setRevisionDate(getDate()); *************** *** 88,94 **** contentId = contact.getContactId(); ! setField(MessageConstants.CONTENT_ID, contentId); ! setField(MessageConstants.SUBJECT, getSubject()); /** --- 88,94 ---- contentId = contact.getContactId(); ! setField(RFC822.CONTENT_ID, contentId); ! setField(RFC822.SUBJECT, getSubject()); /** |
From: Stig T. <jw...@us...> - 2005-03-20 20:48:41
|
Update of /cvsroot/mailsomething/mailsomething/src/com/limegroup/gnutella/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14495/com/limegroup/gnutella/util Modified Files: Test.java Log Message: Index: Test.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/com/limegroup/gnutella/util/Test.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Test.java 3 Apr 2004 07:56:53 -0000 1.1 --- Test.java 20 Mar 2005 20:48:12 -0000 1.2 *************** *** 22,26 **** } catch (IOException f) { ! System.out.println(f.getMessage()); } --- 22,26 ---- } catch (IOException f) { ! //System.out.println(f.getMessage()); } |
From: Stig T. <jw...@us...> - 2005-03-20 20:48:41
|
Update of /cvsroot/mailsomething/mailsomething/src/com/Ostermiller/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14495/com/Ostermiller/util Modified Files: BrowserCommandLexer.java Browser.java Log Message: Index: Browser.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/com/Ostermiller/util/Browser.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Browser.java 3 Apr 2004 07:56:54 -0000 1.1 --- Browser.java 20 Mar 2005 20:48:20 -0000 1.2 *************** *** 585,589 **** } } catch (IOException e){ ! System.out.println(e.getMessage()); } System.exit(0); --- 585,589 ---- } } catch (IOException e){ ! //System.out.println(e.getMessage()); } System.exit(0); Index: BrowserCommandLexer.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/com/Ostermiller/util/BrowserCommandLexer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BrowserCommandLexer.java 3 Apr 2004 07:56:54 -0000 1.1 --- BrowserCommandLexer.java 20 Mar 2005 20:48:20 -0000 1.2 *************** *** 185,192 **** String t; while ((t = shredder.getNextToken()) != null) { ! System.out.println(t); } } catch (IOException e){ ! System.out.println(e.getMessage()); } } --- 185,192 ---- String t; while ((t = shredder.getNextToken()) != null) { ! //System.out.println(t); } } catch (IOException e){ ! //System.out.println(e.getMessage()); } } |
From: Stig T. <jw...@us...> - 2005-03-20 20:48:41
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14495/net/sf/mailsomething Modified Files: Mailsomething.java Log Message: Index: Mailsomething.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/Mailsomething.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Mailsomething.java 3 Apr 2004 07:56:56 -0000 1.1 --- Mailsomething.java 20 Mar 2005 20:48:20 -0000 1.2 *************** *** 338,342 **** param += " " + params[i]; ! System.out.println(param); instance.executeParams(param); --- 338,342 ---- param += " " + params[i]; ! //System.out.println(param); instance.executeParams(param); *************** *** 586,590 **** /*for (int i = 0; i < args.length; i++) { ! System.out.println(args[i]); }*/ --- 586,590 ---- /*for (int i = 0; i < args.length; i++) { ! //System.out.println(args[i]); }*/ |
From: Stig T. <jw...@us...> - 2005-03-20 20:47:29
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14001/net/sf/mailsomething/util Modified Files: MimeTypeObjectSupport.java AppInstance.java PlatformManager.java TimedSocket.java BeanProxy.java TimeInterval.java ParameterServer.java Appointment.java ParameterProtocol.java GeneralSupport.java CalendarBook.java AppSettings.java Log Message: Index: ParameterProtocol.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/util/ParameterProtocol.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ParameterProtocol.java 3 Apr 2004 07:56:45 -0000 1.1 --- ParameterProtocol.java 20 Mar 2005 20:47:19 -0000 1.2 *************** *** 63,67 **** String command = new String(bytes); ! System.out.println("protocol " + new String(bytes)); StringTokenizer tokenizer = new StringTokenizer(command, " "); --- 63,67 ---- String command = new String(bytes); ! //System.out.println("protocol " + new String(bytes)); StringTokenizer tokenizer = new StringTokenizer(command, " "); Index: MimeTypeObjectSupport.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/util/MimeTypeObjectSupport.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MimeTypeObjectSupport.java 11 Mar 2005 11:59:03 -0000 1.2 --- MimeTypeObjectSupport.java 20 Mar 2005 20:47:19 -0000 1.3 *************** *** 194,198 **** += ("; charset=\"" + mime.getParameter("charset") + "\""); //contentType += ("; charset=\"" + GuiUser.getInstance().getFontHandler().getEncoding() + "\""); ! System.out.println(contentType); //} --- 194,198 ---- += ("; charset=\"" + mime.getParameter("charset") + "\""); //contentType += ("; charset=\"" + GuiUser.getInstance().getFontHandler().getEncoding() + "\""); ! //System.out.println(contentType); //} *************** *** 209,213 **** + "\""; ! System.out.println(contentType); } } --- 209,213 ---- + "\""; ! //System.out.println(contentType); } } *************** *** 288,292 **** + "\""; ! //System.out.println(contentType); } --- 288,292 ---- + "\""; ! ////System.out.println(contentType); } *************** *** 346,350 **** public static MimeTypeObject getPrimaryObject(MimeTypeObject object) { ! System.out.println("getprimaryobject" + object); MimeType mime = object.getMimeType(); --- 346,350 ---- public static MimeTypeObject getPrimaryObject(MimeTypeObject object) { ! //System.out.println("getprimaryobject" + object); MimeType mime = object.getMimeType(); *************** *** 362,366 **** if (primary.indexOf("multipart") != -1) { ! System.out.println("mimetype to string " + mime.toString()); String subtype = mime.getSubType(); --- 362,366 ---- if (primary.indexOf("multipart") != -1) { ! //System.out.println("mimetype to string " + mime.toString()); String subtype = mime.getSubType(); *************** *** 369,373 **** || subtype.equalsIgnoreCase("mixed")) { ! System.out.println("getprimary choose alternative now"); return chooseAlternative2(object); --- 369,373 ---- || subtype.equalsIgnoreCase("mixed")) { ! //System.out.println("getprimary choose alternative now"); return chooseAlternative2(object); *************** *** 515,519 **** Style def = context.getStyle(StyleContext.DEFAULT_STYLE); ! //System.out.println(def.get --- 515,519 ---- Style def = context.getStyle(StyleContext.DEFAULT_STYLE); ! ////System.out.println(def.get *************** *** 607,611 **** while ((o = message.getBody(i)) != null) { ! System.out.println("choosealternative2 go through body: " + i); MimeType mimetype = o.getMimeType(); --- 607,611 ---- while ((o = message.getBody(i)) != null) { ! //System.out.println("choosealternative2 go through body: " + i); MimeType mimetype = o.getMimeType(); *************** *** 645,649 **** } else { ! System.out.println("choosealternative mimetype is null"); } --- 645,649 ---- } else { ! //System.out.println("choosealternative mimetype is null"); } *************** *** 717,721 **** + "\""; ! System.out.println(contentType); } } --- 717,721 ---- + "\""; ! //System.out.println(contentType); } } *************** *** 727,731 **** //editorpane.setFont(new Font("batang", 12, Font.PLAIN)); ! System.out.println(object.getFilename()); if (object.getFile() != null) { --- 727,731 ---- //editorpane.setFont(new Font("batang", 12, Font.PLAIN)); ! //System.out.println(object.getFilename()); if (object.getFile() != null) { Index: AppInstance.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/util/AppInstance.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AppInstance.java 3 Apr 2004 07:56:45 -0000 1.1 --- AppInstance.java 20 Mar 2005 20:47:19 -0000 1.2 *************** *** 215,224 **** if(port == -1) { ! System.out.println("port = -1"); return; } ! System.out.println("portnumber = " + getPort()); try { --- 215,224 ---- if(port == -1) { ! //System.out.println("port = -1"); return; } ! //System.out.println("portnumber = " + getPort()); try { *************** *** 240,244 **** ! System.out.println("paraminvoker:" + in.readLine()); out.write(params); --- 240,244 ---- ! //System.out.println("paraminvoker:" + in.readLine()); out.write(params); *************** *** 246,250 **** out.flush(); ! //System.out.println("paraminvoker:" + in.readLine()); in.close(); --- 246,250 ---- out.flush(); ! ////System.out.println("paraminvoker:" + in.readLine()); in.close(); Index: AppSettings.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/util/AppSettings.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AppSettings.java 3 Apr 2004 07:56:45 -0000 1.1 --- AppSettings.java 20 Mar 2005 20:47:19 -0000 1.2 *************** *** 79,83 **** if (!exe.exists()) { ! System.out.println("exe doesnt exists"); return; --- 79,83 ---- if (!exe.exists()) { ! //System.out.println("exe doesnt exists"); return; Index: GeneralSupport.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/util/GeneralSupport.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GeneralSupport.java 3 Apr 2004 07:56:45 -0000 1.1 --- GeneralSupport.java 20 Mar 2005 20:47:19 -0000 1.2 *************** *** 128,132 **** if(!old.exists()) { ! System.out.println("old file doesnt exists"); return; --- 128,132 ---- if(!old.exists()) { ! //System.out.println("old file doesnt exists"); return; *************** *** 180,188 **** URL url = ClassLoader.getSystemResource(className); ! System.out.println(url.getPath()); ! System.out.println(className); ! System.out.println(url.getPath().substring(0,url.getPath().length() - className.length())); appDirectory = new File(url.getPath().substring(0,url.getPath().length() - className.length())); --- 180,188 ---- URL url = ClassLoader.getSystemResource(className); ! //System.out.println(url.getPath()); ! //System.out.println(className); ! //System.out.println(url.getPath().substring(0,url.getPath().length() - className.length())); appDirectory = new File(url.getPath().substring(0,url.getPath().length() - className.length())); Index: TimedSocket.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/util/TimedSocket.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TimedSocket.java 3 Apr 2004 07:56:45 -0000 1.1 --- TimedSocket.java 20 Mar 2005 20:47:19 -0000 1.2 *************** *** 106,114 **** Socket s = TimedSocket.getSocket ("192.168.0.3", 80, 5000); s.close(); ! System.out.println ("connected"); } catch (IOException ioe) { ! System.out.println ("time out"); } --- 106,114 ---- Socket s = TimedSocket.getSocket ("192.168.0.3", 80, 5000); s.close(); ! //System.out.println ("connected"); } catch (IOException ioe) { ! //System.out.println ("time out"); } Index: PlatformManager.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/util/PlatformManager.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PlatformManager.java 3 Apr 2004 07:56:45 -0000 1.1 --- PlatformManager.java 20 Mar 2005 20:47:19 -0000 1.2 *************** *** 62,66 **** arch = System.getProperty("os.arch"); ! //System.out.println(system + " " + version + " " + arch); } --- 62,66 ---- arch = System.getProperty("os.arch"); ! ////System.out.println(system + " " + version + " " + arch); } Index: TimeInterval.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/util/TimeInterval.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TimeInterval.java 3 Apr 2004 07:56:45 -0000 1.1 --- TimeInterval.java 20 Mar 2005 20:47:19 -0000 1.2 *************** *** 145,149 **** String stringdate = buffer.toString(); ! System.out.println(stringdate); --- 145,149 ---- String stringdate = buffer.toString(); ! //System.out.println(stringdate); *************** *** 173,177 **** String stringdate = buffer.toString(); ! System.out.println(stringdate); } --- 173,177 ---- String stringdate = buffer.toString(); ! //System.out.println(stringdate); } Index: CalendarBook.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/util/CalendarBook.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CalendarBook.java 3 Apr 2004 07:56:45 -0000 1.1 --- CalendarBook.java 20 Mar 2005 20:47:19 -0000 1.2 *************** *** 111,115 **** int lowerCut = getCut(date); ! System.out.println("lowercut = " + lowerCut); cal.set(Calendar.DAY_OF_MONTH, day + 1); --- 111,115 ---- int lowerCut = getCut(date); ! //System.out.println("lowercut = " + lowerCut); cal.set(Calendar.DAY_OF_MONTH, day + 1); *************** *** 119,123 **** int higherCut = getCut(date); ! System.out.println("highercut = " + higherCut); if (higherCut == lowerCut) --- 119,123 ---- int higherCut = getCut(date); ! //System.out.println("highercut = " + higherCut); if (higherCut == lowerCut) *************** *** 128,132 **** for (int i = lowerCut; i < higherCut; i++) { ev[i - lowerCut] = (Event) events.elementAt(i); ! System.out.println(ev[i - lowerCut].getDate()); } --- 128,132 ---- for (int i = lowerCut; i < higherCut; i++) { ev[i - lowerCut] = (Event) events.elementAt(i); ! //System.out.println(ev[i - lowerCut].getDate()); } *************** *** 175,179 **** return; ! System.out.println("addevent"); if (events.size() < 1) { --- 175,179 ---- return; ! //System.out.println("addevent"); if (events.size() < 1) { *************** *** 219,223 **** private int getCut(Date date) { ! System.out.println(date); Date eventDate; --- 219,223 ---- private int getCut(Date date) { ! //System.out.println(date); Date eventDate; *************** *** 256,260 **** int result = date.compareTo(halfdate); ! System.out.println("result=" + result); if (result > 0) { --- 256,260 ---- int result = date.compareTo(halfdate); ! //System.out.println("result=" + result); if (result > 0) { Index: ParameterServer.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/util/ParameterServer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ParameterServer.java 3 Apr 2004 07:56:45 -0000 1.1 --- ParameterServer.java 20 Mar 2005 20:47:19 -0000 1.2 *************** *** 83,87 **** public void clientConnect(Client client) { ! System.out.println("client connect"); if(socket != null) { --- 83,87 ---- public void clientConnect(Client client) { ! //System.out.println("client connect"); if(socket != null) { Index: Appointment.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/util/Appointment.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Appointment.java 3 Apr 2004 07:56:45 -0000 1.1 --- Appointment.java 20 Mar 2005 20:47:19 -0000 1.2 *************** *** 93,97 **** public Date getDate() { ! //System.out.println("date in getdate" + date); return date; } --- 93,97 ---- public Date getDate() { ! ////System.out.println("date in getdate" + date); return date; } Index: BeanProxy.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/util/BeanProxy.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BeanProxy.java 3 Apr 2004 07:56:45 -0000 1.1 --- BeanProxy.java 20 Mar 2005 20:47:19 -0000 1.2 *************** *** 114,121 **** if (methodname.equals("hashCode")) { ! //System.out.println("hashcode beanproxy = " + proxyHashCode(proxy)); return proxyHashCode(proxy); ! //System.out.println("call get class"); } --- 114,121 ---- if (methodname.equals("hashCode")) { ! ////System.out.println("hashcode beanproxy = " + proxyHashCode(proxy)); return proxyHashCode(proxy); ! ////System.out.println("call get class"); } *************** *** 123,132 **** if (methodname.equals("equals")) { ! //System.out.println("hashcode equals = " + proxyEquals(proxy, args[0])); return proxyEquals(proxy, args[0]); //return new Boolean(equals(args[0])); ! //System.out.println("call get class"); } --- 123,132 ---- if (methodname.equals("equals")) { ! ////System.out.println("hashcode equals = " + proxyEquals(proxy, args[0])); return proxyEquals(proxy, args[0]); //return new Boolean(equals(args[0])); ! ////System.out.println("call get class"); } *************** *** 153,157 **** if(method.getReturnType().isPrimitive()) { ! //System.out.println("isprimitive=" + method.getReturnType().getName() + propertyname); if(method.getReturnType().getName().equals("boolean")) { --- 153,157 ---- if(method.getReturnType().isPrimitive()) { ! ////System.out.println("isprimitive=" + method.getReturnType().getName() + propertyname); if(method.getReturnType().getName().equals("boolean")) { |
From: Stig T. <jw...@us...> - 2005-03-20 20:46:41
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/util/localnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13638/net/sf/mailsomething/util/localnet Modified Files: OutChannel.java InChannel.java ServerImpl.java PortBinding.java Client.java Log Message: Index: PortBinding.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/util/localnet/PortBinding.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PortBinding.java 3 Apr 2004 07:56:54 -0000 1.1 --- PortBinding.java 20 Mar 2005 20:46:31 -0000 1.2 *************** *** 91,95 **** serverSocket.bind(new InetSocketAddress(port)); ! System.out.println("Port bind listening on: " + port); setIsBound(true); --- 91,95 ---- serverSocket.bind(new InetSocketAddress(port)); ! //System.out.println("Port bind listening on: " + port); setIsBound(true); *************** *** 106,110 **** setIsBound(false); ! System.out.println("server ioexception " + f.getMessage()); } --- 106,110 ---- setIsBound(false); ! //System.out.println("server ioexception " + f.getMessage()); } Index: ServerImpl.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/util/localnet/ServerImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ServerImpl.java 3 Apr 2004 07:56:54 -0000 1.1 --- ServerImpl.java 20 Mar 2005 20:46:31 -0000 1.2 *************** *** 107,111 **** public void addConnection(Socket clientSocket) { ! System.out.println("serverimpl add connection"); sockets.add(clientSocket); --- 107,111 ---- public void addConnection(Socket clientSocket) { ! //System.out.println("serverimpl add connection"); sockets.add(clientSocket); *************** *** 147,151 **** public void log(String string) { ! /*System.out.println("listener = " + listener); if (listener != null) { --- 147,151 ---- public void log(String string) { ! /*//System.out.println("listener = " + listener); if (listener != null) { Index: InChannel.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/util/localnet/InChannel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** InChannel.java 3 Apr 2004 07:56:54 -0000 1.1 --- InChannel.java 20 Mar 2005 20:46:31 -0000 1.2 *************** *** 102,106 **** } ! System.out.println("inchannel break reading"); if (client != null) { --- 102,106 ---- } ! //System.out.println("inchannel break reading"); if (client != null) { Index: OutChannel.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/util/localnet/OutChannel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OutChannel.java 3 Apr 2004 07:56:54 -0000 1.1 --- OutChannel.java 20 Mar 2005 20:46:31 -0000 1.2 *************** *** 86,90 **** try { ! //System.out.println("outchannel write " + new String(bytes)); for(int i = 0; i < bytes.length; i++) --- 86,90 ---- try { ! ////System.out.println("outchannel write " + new String(bytes)); for(int i = 0; i < bytes.length; i++) *************** *** 121,125 **** byte[] bytes = (byte[])fifostack.getFirst(); ! //System.out.println("outchannel writing " + new String(bytes)); for(int i = 0; i < bytes.length; i++) --- 121,125 ---- byte[] bytes = (byte[])fifostack.getFirst(); ! ////System.out.println("outchannel writing " + new String(bytes)); for(int i = 0; i < bytes.length; i++) Index: Client.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/util/localnet/Client.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Client.java 3 Apr 2004 07:56:54 -0000 1.1 --- Client.java 20 Mar 2005 20:46:31 -0000 1.2 *************** *** 93,97 **** public void recieved(byte[] text) { ! System.out.println("recieved " + new String(text)); --- 93,97 ---- public void recieved(byte[] text) { ! //System.out.println("recieved " + new String(text)); |
From: Stig T. <jw...@us...> - 2005-03-20 20:46:26
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/util/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13476/net/sf/mailsomething/util/database Modified Files: LoadExport.java Log Message: Index: LoadExport.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/util/database/LoadExport.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LoadExport.java 3 Apr 2004 07:56:51 -0000 1.1 --- LoadExport.java 20 Mar 2005 20:46:17 -0000 1.2 *************** *** 109,113 **** s = conn.createStatement(); //String sql = line; //.substring(0,line.length()-1); ! System.out.println(sql.substring(0,sql.length()-1)); s.execute(sql); --- 109,113 ---- s = conn.createStatement(); //String sql = line; //.substring(0,line.length()-1); ! //System.out.println(sql.substring(0,sql.length()-1)); s.execute(sql); |
From: Stig T. <jw...@us...> - 2005-03-20 20:45:36
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/jpim/util/versitio In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12849/net/sf/jpim/util/versitio Modified Files: versitItem.java versitInputStream.java versitParser.java Log Message: Index: versitItem.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/jpim/util/versitio/versitItem.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** versitItem.java 3 Apr 2004 07:56:53 -0000 1.1 --- versitItem.java 20 Mar 2005 20:45:25 -0000 1.2 *************** *** 111,115 **** public void addParameter(String name, String value) { String values[]; ! //System.out.println("DEBUG:"+name+"="+value); if (m_Params.containsKey(name)) { String oldValues[] = (String[]) m_Params.get(name); --- 111,115 ---- public void addParameter(String name, String value) { String values[]; ! ////System.out.println("DEBUG:"+name+"="+value); if (m_Params.containsKey(name)) { String oldValues[] = (String[]) m_Params.get(name); *************** *** 182,186 **** String key = (String) enum.next(); String[] values = getParameter(key); ! System.out.println(" [" + m + "]" + key + "=" + StringUtil.joinList(values)); } } --- 182,186 ---- String key = (String) enum.next(); String[] values = getParameter(key); ! //System.out.println(" [" + m + "]" + key + "=" + StringUtil.joinList(values)); } } *************** *** 192,196 **** //count++; ! //System.out.println(line); versitItem item = new versitItem(); //String line = new String(entry); --- 192,196 ---- //count++; ! ////System.out.println(line); versitItem item = new versitItem(); //String line = new String(entry); *************** *** 216,220 **** /** //Move to a test ! System.out.println("("+count+")"+line); System.out.print("("+count+")"); if(item.hasGroup()) { --- 216,220 ---- /** //Move to a test ! //System.out.println("("+count+")"+line); System.out.print("("+count+")"); if(item.hasGroup()) { *************** *** 225,229 **** System.out.print(";"+item.getUnprocessedParameters()); } ! System.out.println(":"+item.getValue()); item.printParamDebug(); --- 225,229 ---- System.out.print(";"+item.getUnprocessedParameters()); } ! //System.out.println(":"+item.getValue()); item.printParamDebug(); Index: versitInputStream.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/jpim/util/versitio/versitInputStream.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** versitInputStream.java 3 Apr 2004 07:56:53 -0000 1.1 --- versitInputStream.java 20 Mar 2005 20:45:25 -0000 1.2 *************** *** 83,87 **** c = m_Input.read(); } ! //System.out.println("c="+(int)c); if (c == -1) { m_hasLine = false; --- 83,87 ---- c = m_Input.read(); } ! ////System.out.println("c="+(int)c); if (c == -1) { m_hasLine = false; Index: versitParser.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/jpim/util/versitio/versitParser.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** versitParser.java 3 Apr 2004 07:56:53 -0000 1.1 --- versitParser.java 20 Mar 2005 20:45:25 -0000 1.2 *************** *** 156,160 **** item = (versitItem) iter.next(); ! //System.out.println("Inspecting item "+pos+":"+item.getIdentifier()); if (item.getIdentifier().equalsIgnoreCase(versitToken.VERSION)) { return item.getValue(); --- 156,160 ---- item = (versitItem) iter.next(); ! ////System.out.println("Inspecting item "+pos+":"+item.getIdentifier()); if (item.getIdentifier().equalsIgnoreCase(versitToken.VERSION)) { return item.getValue(); |
From: Stig T. <jw...@us...> - 2005-03-20 20:45:36
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/jpim/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12849/net/sf/jpim/util Modified Files: UIDGenerator.java StringUtil.java MD5.java Log Message: Index: UIDGenerator.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/jpim/util/UIDGenerator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** UIDGenerator.java 3 Apr 2004 07:56:51 -0000 1.1 --- UIDGenerator.java 20 Mar 2005 20:45:25 -0000 1.2 *************** *** 92,100 **** long start = System.currentTimeMillis(); while (i < 1000) { ! System.out.println(getUID()); i++; } long stop = System.currentTimeMillis(); ! System.out.println("Time =" + (stop - start) + "[ms]"); }//main --- 92,100 ---- long start = System.currentTimeMillis(); while (i < 1000) { ! //System.out.println(getUID()); i++; } long stop = System.currentTimeMillis(); ! //System.out.println("Time =" + (stop - start) + "[ms]"); }//main Index: MD5.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/jpim/util/MD5.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MD5.java 3 Apr 2004 07:56:51 -0000 1.1 --- MD5.java 20 Mar 2005 20:45:25 -0000 1.2 *************** *** 1 **** ! /*** * jpim Java PIM Library * Copyright (c) 2001,2002 jpim team * * jpim is free software; you can distribute and use this source * under the terms of the BSD-style license received along with * the distribution. ***/ package net.sf.jpim.util; /** * This class implements the MD5 algorithm. * <p> * The specification is available from RFC 1321, * and there are numerous implementations out there, * this one was tuned specifically for hashing short * strings (i.e. passwords). * <p> * I do not recommend to use this implementation for * anything else but that, and if anybody feels that * this code is to "close" to something available on * the net, please contact me, and I will certainly take * steps to clear up the situation. */ public final class MD5 { /** * Returns the MD5 hash digest transformed into a hex * representation as <code>String</code>. * * @return the MD5 hash of the input as <code>String</code>. */ public static final String hash(String str) { return MD5.asHex(MD5.digest(str.getBytes())); }//hash /** * Returns the MD5 hash of the input data. * <p> * Following the the MD5 standard specification, the result * is returned least significant byte first, however, * many applications use the most significant byte first (more conventional). * * @param msg the <code>byte[]</code> to be digested. * * @return the MD5 hash of the data as <code>String</code>. */ public static final byte[] digest(byte[] msg) { int padsize = (120 - (msg.length % 64)) % 64; int i; long l = msg.length * 8; //MD5 registers int a = 0x67452301, aa, b = 0xefcdab89, bb, c = 0x98badcfe, cc, d = 0x10325476, dd; byte[] src = new byte[msg.length + padsize + 8]; //padding try { System.arraycopy(msg, 0, src, 0, msg.length); } catch (Exception ex) { //should not happen, but calm's the compiler } src[msg.length] = (byte) 0x80; for (i = msg.length + 1; i < msg.length + padsize; i++) src[i] = 0; //append length for (i = src.length - 8; i < src.length; i++) { src[i] = (byte) l; l >>>= 8; } int[] x = new int[16]; //prcess the data 16-word blocks for (i = 0; i < src.length; i += 64) { //construct block for (int j = 0; j < 16; j++) { x[j] = 0; for (int k = 3; k >= 0; k--) { x[j] <<= 8; x[j] += src[i + j * 4 + k] & 0xff; } } aa = a; bb = b; cc = c; dd = d; a = round1(a, b, c, d, 0, 7, 1, x); d = round1(d, a, b, c, 1, 12, 2, x); c = round1(c, d, a, b, 2, 17, 3, x); b = round1(b, c, d, a, 3, 22, 4, x); a = round1(a, b, c, d, 4, 7, 5, x); d = round1(d, a, b, c, 5, 12, 6, x); c = round1(c, d, a, b, 6, 17, 7, x); b = round1(b, c, d, a, 7, 22, 8, x); a = round1(a, b, c, d, 8, 7, 9, x); d = round1(d, a, b, c, 9, 12, 10, x); c = round1(c, d, a, b, 10, 17, 11, x); b = round1(b, c, d, a, 11, 22, 12, x); a = round1(a, b, c, d, 12, 7, 13, x); d = round1(d, a, b, c, 13, 12, 14, x); c = round1(c, d, a, b, 14, 17, 15, x); b = round1(b, c, d, a, 15, 22, 16, x); a = round2(a, b, c, d, 1, 5, 17, x); d = round2(d, a, b, c, 6, 9, 18, x); c = round2(c, d, a, b, 11, 14, 19, x); b = round2(b, c, d, a, 0, 20, 20, x); a = round2(a, b, c, d, 5, 5, 21, x); d = round2(d, a, b, c, 10, 9, 22, x); c = round2(c, d, a, b, 15, 14, 23, x); b = round2(b, c, d, a, 4, 20, 24, x); a = round2(a, b, c, d, 9, 5, 25, x); d = round2(d, a, b, c, 14, 9, 26, x); c = round2(c, d, a, b, 3, 14, 27, x); b = round2(b, c, d, a, 8, 20, 28, x); a = round2(a, b, c, d, 13, 5, 29, x); d = round2(d, a, b, c, 2, 9, 30, x); c = round2(c, d, a, b, 7, 14, 31, x); b = round2(b, c, d, a, 12, 20, 32, x); a = round3(a, b, c, d, 5, 4, 33, x); d = round3(d, a, b, c, 8, 11, 34, x); c = round3(c, d, a, b, 11, 16, 35, x); b = round3(b, c, d, a, 14, 23, 36, x); a = round3(a, b, c, d, 1, 4, 37, x); d = round3(d, a, b, c, 4, 11, 38, x); c = round3(c, d, a, b, 7, 16, 39, x); b = round3(b, c, d, a, 10, 23, 40, x); a = round3(a, b, c, d, 13, 4, 41, x); d = round3(d, a, b, c, 0, 11, 42, x); c = round3(c, d, a, b, 3, 16, 43, x); b = round3(b, c, d, a, 6, 23, 44, x); a = round3(a, b, c, d, 9, 4, 45, x); d = round3(d, a, b, c, 12, 11, 46, x); c = round3(c, d, a, b, 15, 16, 47, x); b = round3(b, c, d, a, 2, 23, 48, x); a = round4(a, b, c, d, 0, 6, 49, x); d = round4(d, a, b, c, 7, 10, 50, x); c = round4(c, d, a, b, 14, 15, 51, x); b = round4(b, c, d, a, 5, 21, 52, x); a = round4(a, b, c, d, 12, 6, 53, x); d = round4(d, a, b, c, 3, 10, 54, x); c = round4(c, d, a, b, 10, 15, 55, x); b = round4(b, c, d, a, 1, 21, 56, x); a = round4(a, b, c, d, 8, 6, 57, x); d = round4(d, a, b, c, 15, 10, 58, x); c = round4(c, d, a, b, 6, 15, 59, x); b = round4(b, c, d, a, 13, 21, 60, x); a = round4(a, b, c, d, 4, 6, 61, x); d = round4(d, a, b, c, 11, 10, 62, x); c = round4(c, d, a, b, 2, 15, 63, x); b = round4(b, c, d, a, 9, 21, 64, x); a += aa; b += bb; c += cc; d += dd; } byte[] ret = new byte[16]; for (i = 0; i < 4; i++) { ret[i] = (byte) a; a >>>= 8; } for (; i < 8; i++) { ret[i] = (byte) b; b >>>= 8; } for (; i < 12; i++) { ret[i] = (byte) c; c >>>= 8; } for (; i < 16; i++) { ret[i] = (byte) d; d >>>= 8; } return ret; }//digest /** MD5 Transformation routines *********************************************/ private static final int rot(int x, int s) { return x << s | x >>> (32 - s); }//rot private static final int F(int x, int y, int z) { return (x & y) | (~x & z); }//F private static final int G(int x, int y, int z) { return (x & z) | (y & ~z); }//G private static final int H(int x, int y, int z) { return x ^ y ^ z; }//H private static final int I(int x, int y, int z) { return y ^ (x | ~z); }//I private static final int round1(int a, int b, int c, int d, int k, int s, int i, int[] x) { return b + rot((a + F(b, c, d) + x[k] + T[i - 1]), s); }//round1 private static final int round2(int a, int b, int c, int d, int k, int s, int i, int[] x) { return b + rot((a + G(b, c, d) + x[k] + T[i - 1]), s); }//round2 private static final int round3(int a, int b, int c, int d, int k, int s, int i, int[] x) { return b + rot((a + H(b, c, d) + x[k] + T[i - 1]), s); }//round3 private static final int round4(int a, int b, int c, int d, int k, int s, int i, int[] x) { return b + rot((a + I(b, c, d) + x[k] + T[i - 1]), s); }//round4 private static final int T[] = { 0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee, 0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501, 0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be, 0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821, 0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa, 0xd62f105d, 0x02441453, 0xd8a1e681, 0xe7d3fbc8, 0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed, 0xa9e3e905, 0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a, 0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c, 0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70, 0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x04881d05, 0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665, 0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039, 0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1, 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1, 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391 }; /** END MD5 Transformation routines *****************************************/ /** * Returns a <code>String</code> containing unsigned hexadecimal * numbers as digits. * <p> * Contains two hex digit characters for each byte from the passed in * <code>byte[]</code>. * * @param data the array of bytes to be converted into a hex-string. * @return the generated hexadecimal representation as * <code>String</code>. */ public static final String asHex(byte[] data) { //double size, two bytes (hex range) for one byte StringBuffer buf = new StringBuffer(data.length * 2); for (int i = 0; i < data.length; i++) { //don't forget the second hex digit if (((int) data[i] & 0xff) < 0x10) { buf.append("0"); } buf.append(Long.toString((int) data[i] & 0xff, 16)); } return buf.toString(); }//asHex public static final long hashValue(byte[] msg, boolean high) { byte[] hash = MD5.digest(msg); byte[] val = new byte[8]; if (high) { System.arraycopy(hash, 8, val, 0, 8); } else { System.arraycopy(hash, 0, val, 0, 8); } System.out.println("Long from :" + asHex(val)); return bytes2long(val); }//hashValue private static final long bytes2long(byte[] data) { long l = 0; l = ((data[7] & 0xff) << 56) + ((data[6] & 0xff) << 48) + ((data[5] & 0xff) << 40) + ((data[4] & 0xff) << 32) + ((data[3] & 0xff) << 24) + ((data[2] & 0xff) << 16) + ((data[1] & 0xff) << 8) + ((data[0] & 0xff) << 0); return l; }//bytes2Long /** * A main, to allow using this class from the command line. */ public static void main(String[] args) { try { if (args == null || args.length == 0) { System.out.println("Usage: java MD5 <password>"); } byte[] msg = args[0].getBytes(); String hash = hash(args[0]); System.out.println("Hash=" + hash); System.out.println("Hex=" + Long.toHexString(Long.MAX_VALUE)); System.out.println("Low long=" + MD5.hashValue(msg, false)); System.out.println("High long=" + MD5.hashValue(msg, true)); msg = args[1].getBytes(); hash = hash(args[1]); System.out.println("Hash=" + hash); System.out.println("Hex=" + Long.toHexString(Long.MAX_VALUE)); System.out.println("Low long=" + MD5.hashValue(msg, false)); System.out.println("High long=" + MD5.hashValue(msg, true)); } catch (Exception ex) { ex.printStackTrace(); } }//main }//class MD5 \ No newline at end of file --- 1 ---- ! /*** * jpim Java PIM Library * Copyright (c) 2001,2002 jpim team * * jpim is free software; you can distribute and use this source * under the terms of the BSD-style license received along with * the distribution. ***/ package net.sf.jpim.util; /** * This class implements the MD5 algorithm. * <p> * The specification is available from RFC 1321, * and there are numerous implementations out there, * this one was tuned specifically for hashing short * strings (i.e. passwords). * <p> * I do not recommend to use this implementation for * anything else but that, and if anybody feels that * this code is to "close" to something available on * the net, please contact me, and I will certainly take * steps to clear up the situation. */ public final class MD5 { /** * Returns the MD5 hash digest transformed into a hex * representation as <code>String</code>. * * @return the MD5 hash of the input as <code>String</code>. */ public static final String hash(String str) { return MD5.asHex(MD5.digest(str.getBytes())); }//hash /** * Returns the MD5 hash of the input data. * <p> * Following the the MD5 standard specification, the result * is returned least significant byte first, however, * many applications use the most significant byte first (more conventional). * * @param msg the <code>byte[]</code> to be digested. * * @return the MD5 hash of the data as <code>String</code>. */ public static final byte[] digest(byte[] msg) { int padsize = (120 - (msg.length % 64)) % 64; int i; long l = msg.length * 8; //MD5 registers int a = 0x67452301, aa, b = 0xefcdab89, bb, c = 0x98badcfe, cc, d = 0x10325476, dd; byte[] src = new byte[msg.length + padsize + 8]; //padding try { System.arraycopy(msg, 0, src, 0, msg.length); } catch (Exception ex) { //should not happen, but calm's the compiler } src[msg.length] = (byte) 0x80; for (i = msg.length + 1; i < msg.length + padsize; i++) src[i] = 0; //append length for (i = src.length - 8; i < src.length; i++) { src[i] = (byte) l; l >>>= 8; } int[] x = new int[16]; //prcess the data 16-word blocks for (i = 0; i < src.length; i += 64) { //construct block for (int j = 0; j < 16; j++) { x[j] = 0; for (int k = 3; k >= 0; k--) { x[j] <<= 8; x[j] += src[i + j * 4 + k] & 0xff; } } aa = a; bb = b; cc = c; dd = d; a = round1(a, b, c, d, 0, 7, 1, x); d = round1(d, a, b, c, 1, 12, 2, x); c = round1(c, d, a, b, 2, 17, 3, x); b = round1(b, c, d, a, 3, 22, 4, x); a = round1(a, b, c, d, 4, 7, 5, x); d = round1(d, a, b, c, 5, 12, 6, x); c = round1(c, d, a, b, 6, 17, 7, x); b = round1(b, c, d, a, 7, 22, 8, x); a = round1(a, b, c, d, 8, 7, 9, x); d = round1(d, a, b, c, 9, 12, 10, x); c = round1(c, d, a, b, 10, 17, 11, x); b = round1(b, c, d, a, 11, 22, 12, x); a = round1(a, b, c, d, 12, 7, 13, x); d = round1(d, a, b, c, 13, 12, 14, x); c = round1(c, d, a, b, 14, 17, 15, x); b = round1(b, c, d, a, 15, 22, 16, x); a = round2(a, b, c, d, 1, 5, 17, x); d = round2(d, a, b, c, 6, 9, 18, x); c = round2(c, d, a, b, 11, 14, 19, x); b = round2(b, c, d, a, 0, 20, 20, x); a = round2(a, b, c, d, 5, 5, 21, x); d = round2(d, a, b, c, 10, 9, 22, x); c = round2(c, d, a, b, 15, 14, 23, x); b = round2(b, c, d, a, 4, 20, 24, x); a = round2(a, b, c, d, 9, 5, 25, x); d = round2(d, a, b, c, 14, 9, 26, x); c = round2(c, d, a, b, 3, 14, 27, x); b = round2(b, c, d, a, 8, 20, 28, x); a = round2(a, b, c, d, 13, 5, 29, x); d = round2(d, a, b, c, 2, 9, 30, x); c = round2(c, d, a, b, 7, 14, 31, x); b = round2(b, c, d, a, 12, 20, 32, x); a = round3(a, b, c, d, 5, 4, 33, x); d = round3(d, a, b, c, 8, 11, 34, x); c = round3(c, d, a, b, 11, 16, 35, x); b = round3(b, c, d, a, 14, 23, 36, x); a = round3(a, b, c, d, 1, 4, 37, x); d = round3(d, a, b, c, 4, 11, 38, x); c = round3(c, d, a, b, 7, 16, 39, x); b = round3(b, c, d, a, 10, 23, 40, x); a = round3(a, b, c, d, 13, 4, 41, x); d = round3(d, a, b, c, 0, 11, 42, x); c = round3(c, d, a, b, 3, 16, 43, x); b = round3(b, c, d, a, 6, 23, 44, x); a = round3(a, b, c, d, 9, 4, 45, x); d = round3(d, a, b, c, 12, 11, 46, x); c = round3(c, d, a, b, 15, 16, 47, x); b = round3(b, c, d, a, 2, 23, 48, x); a = round4(a, b, c, d, 0, 6, 49, x); d = round4(d, a, b, c, 7, 10, 50, x); c = round4(c, d, a, b, 14, 15, 51, x); b = round4(b, c, d, a, 5, 21, 52, x); a = round4(a, b, c, d, 12, 6, 53, x); d = round4(d, a, b, c, 3, 10, 54, x); c = round4(c, d, a, b, 10, 15, 55, x); b = round4(b, c, d, a, 1, 21, 56, x); a = round4(a, b, c, d, 8, 6, 57, x); d = round4(d, a, b, c, 15, 10, 58, x); c = round4(c, d, a, b, 6, 15, 59, x); b = round4(b, c, d, a, 13, 21, 60, x); a = round4(a, b, c, d, 4, 6, 61, x); d = round4(d, a, b, c, 11, 10, 62, x); c = round4(c, d, a, b, 2, 15, 63, x); b = round4(b, c, d, a, 9, 21, 64, x); a += aa; b += bb; c += cc; d += dd; } byte[] ret = new byte[16]; for (i = 0; i < 4; i++) { ret[i] = (byte) a; a >>>= 8; } for (; i < 8; i++) { ret[i] = (byte) b; b >>>= 8; } for (; i < 12; i++) { ret[i] = (byte) c; c >>>= 8; } for (; i < 16; i++) { ret[i] = (byte) d; d >>>= 8; } return ret; }//digest /** MD5 Transformation routines *********************************************/ private static final int rot(int x, int s) { return x << s | x >>> (32 - s); }//rot private static final int F(int x, int y, int z) { return (x & y) | (~x & z); }//F private static final int G(int x, int y, int z) { return (x & z) | (y & ~z); }//G private static final int H(int x, int y, int z) { return x ^ y ^ z; }//H private static final int I(int x, int y, int z) { return y ^ (x | ~z); }//I private static final int round1(int a, int b, int c, int d, int k, int s, int i, int[] x) { return b + rot((a + F(b, c, d) + x[k] + T[i - 1]), s); }//round1 private static final int round2(int a, int b, int c, int d, int k, int s, int i, int[] x) { return b + rot((a + G(b, c, d) + x[k] + T[i - 1]), s); }//round2 private static final int round3(int a, int b, int c, int d, int k, int s, int i, int[] x) { return b + rot((a + H(b, c, d) + x[k] + T[i - 1]), s); }//round3 private static final int round4(int a, int b, int c, int d, int k, int s, int i, int[] x) { return b + rot((a + I(b, c, d) + x[k] + T[i - 1]), s); }//round4 private static final int T[] = { 0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee, 0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501, 0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be, 0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821, 0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa, 0xd62f105d, 0x02441453, 0xd8a1e681, 0xe7d3fbc8, 0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed, 0xa9e3e905, 0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a, 0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c, 0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70, 0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x04881d05, 0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665, 0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039, 0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1, 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1, 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391 }; /** END MD5 Transformation routines *****************************************/ /** * Returns a <code>String</code> containing unsigned hexadecimal * numbers as digits. * <p> * Contains two hex digit characters for each byte from the passed in * <code>byte[]</code>. * * @param data the array of bytes to be converted into a hex-string. * @return the generated hexadecimal representation as * <code>String</code>. */ public static final String asHex(byte[] data) { //double size, two bytes (hex range) for one byte StringBuffer buf = new StringBuffer(data.length * 2); for (int i = 0; i < data.length; i++) { //don't forget the second hex digit if (((int) data[i] & 0xff) < 0x10) { buf.append("0"); } buf.append(Long.toString((int) data[i] & 0xff, 16)); } return buf.toString(); }//asHex public static final long hashValue(byte[] msg, boolean high) { byte[] hash = MD5.digest(msg); byte[] val = new byte[8]; if (high) { System.arraycopy(hash, 8, val, 0, 8); } else { System.arraycopy(hash, 0, val, 0, 8); } //System.out.println("Long from :" + asHex(val)); return bytes2long(val); }//hashValue private static final long bytes2long(byte[] data) { long l = 0; l = ((data[7] & 0xff) << 56) + ((data[6] & 0xff) << 48) + ((data[5] & 0xff) << 40) + ((data[4] & 0xff) << 32) + ((data[3] & 0xff) << 24) + ((data[2] & 0xff) << 16) + ((data[1] & 0xff) << 8) + ((data[0] & 0xff) << 0); return l; }//bytes2Long /** * A main, to allow using this class from the command line. */ public static void main(String[] args) { try { if (args == null || args.length == 0) { //System.out.println("Usage: java MD5 <password>"); } byte[] msg = args[0].getBytes(); String hash = hash(args[0]); //System.out.println("Hash=" + hash); //System.out.println("Hex=" + Long.toHexString(Long.MAX_VALUE)); //System.out.println("Low long=" + MD5.hashValue(msg, false)); //System.out.println("High long=" + MD5.hashValue(msg, true)); msg = args[1].getBytes(); hash = hash(args[1]); //System.out.println("Hash=" + hash); //System.out.println("Hex=" + Long.toHexString(Long.MAX_VALUE)); //System.out.println("Low long=" + MD5.hashValue(msg, false)); //System.out.println("High long=" + MD5.hashValue(msg, true)); } catch (Exception ex) { ex.printStackTrace(); } }//main }//class MD5 \ No newline at end of file Index: StringUtil.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/jpim/util/StringUtil.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** StringUtil.java 3 Apr 2004 07:56:51 -0000 1.1 --- StringUtil.java 20 Mar 2005 20:45:25 -0000 1.2 *************** *** 32,36 **** */ public static String[] split(String str, String delim) { ! //System.out.println(str); StringTokenizer strtok = null; ArrayList list = null; --- 32,36 ---- */ public static String[] split(String str, String delim) { ! ////System.out.println(str); StringTokenizer strtok = null; ArrayList list = null; *************** *** 43,47 **** while (strtok.hasMoreElements()) { String tok = strtok.nextToken(); ! //System.out.println(tok); //filter delimiters without value? if (tok.equals(delim)) { --- 43,47 ---- while (strtok.hasMoreElements()) { String tok = strtok.nextToken(); ! ////System.out.println(tok); //filter delimiters without value? if (tok.equals(delim)) { |