HTMLErrorMessage.java
上传用户:huihesys
上传日期:2007-01-04
资源大小:3877k
文件大小:2k
- /* $Id: HTMLErrorMessage.java,v 1.2 2000/04/06 08:02:02 wastl Exp $ */
- package net.wastl.webmail.ui.html;
- import gnu.regexp.*;
- import java.util.*;
- import net.wastl.webmail.server.Storage;
- // This class is broken !!!
- /*
- * HTMLErrorMessage.java
- *
- * Created: Thu Mar 25 11:53:23 1999
- *
- * Copyright (C) 1999-2000 Sebastian Schaffert
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
- /**
- *
- *
- * Created: Thu Mar 25 11:53:23 1999
- *
- * @author Sebastian Schaffert
- * @version
- */
- public class HTMLErrorMessage extends HTMLDocument {
-
- protected static RE regexp;
-
- public HTMLErrorMessage(Storage loader, String message) {
- //super("WebMail Error Message ",loader.getTextFile(loader.getStringResource("error",Locale.getDefault()),Locale.getDefault()));
-
- try {
- if(regexp==null) {
- regexp=new RE("<<([^>]+)>>",RE.REG_ICASE & RE.REG_MULTILINE,RESyntax.RE_SYNTAX_PERL5);
- }
- } catch(Exception e) {
- e.printStackTrace();
- }
-
-
- REMatch[] matches=regexp.getAllMatches(content);
- for(int i=0;i<matches.length;i++) {
- content=regexp.substitute(content,message,0);
- }
- }
-
- } // HTMLErrorMessage