|
From: <de...@us...> - 2003-12-25 15:14:03
|
Update of /cvsroot/babeldoc/babeldoc/modules/scanner/src/com/babeldoc/scanner/worker In directory sc8-pr-cvs1:/tmp/cvs-serv19537/babeldoc/modules/scanner/src/com/babeldoc/scanner/worker Modified Files: MailboxScanner.java Log Message: Fixed bug introduced after Hans Benedict fixed bug he introduced ;) If charset is null then NPE is thrown from InputStreamReader constructor Index: MailboxScanner.java =================================================================== RCS file: /cvsroot/babeldoc/babeldoc/modules/scanner/src/com/babeldoc/scanner/worker/MailboxScanner.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** MailboxScanner.java 25 Dec 2003 14:15:50 -0000 1.31 --- MailboxScanner.java 25 Dec 2003 15:14:00 -0000 1.32 *************** *** 6,26 **** * * 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 acknowledgment: "This product includes software ! * developed by the Apache Software Foundation (http://www.apache.org/)." ! * Alternately, this acknowledgment may appear in the software itself, if and ! * wherever such third-party acknowledgments normally appear. ! * 4. The names "Apache" and "Apache Software Foundation" must not be used to ! * endorse or promote products derived from this software without prior written ! * permission. For written permission, please contact ap...@ap.... ! * 5. Products derived from this software may not be called "Apache", nor may ! * "Apache" appear in their name, without prior written permission of the ! * Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, --- 6,25 ---- * * 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 ! * acknowledgment: "This product includes software developed by the Apache ! * Software Foundation (http://www.apache.org/)." Alternately, this ! * acknowledgment may appear in the software itself, if and wherever such ! * third-party acknowledgments normally appear. 4. The names "Apache" and ! * "Apache Software Foundation" must not be used to endorse or promote products ! * derived from this software without prior written permission. For written ! * permission, please contact ap...@ap.... 5. Products derived from this ! * software may not be called "Apache", nor may "Apache" appear in their name, ! * without prior written permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, *************** *** 333,338 **** // Code donated by Hans Benedict. MimeType type = new MimeType(part.getContentType()); ! BufferedReader reader = new BufferedReader(new InputStreamReader(part ! .getInputStream(), type.getParameter("charset"))); StringBuffer result = new StringBuffer(); String line; --- 332,343 ---- // Code donated by Hans Benedict. MimeType type = new MimeType(part.getContentType()); ! BufferedReader reader = null; ! String charset = type.getParameter("charset"); ! if (charset != null) { ! reader = new BufferedReader(new InputStreamReader(part.getInputStream(), ! charset)); ! } else { ! reader = new BufferedReader(new InputStreamReader(part.getInputStream())); ! } StringBuffer result = new StringBuffer(); String line; |