From: Randy Baumgarte Date: Tue, 11 Oct 2011 11:52:09 +0000 (-0400) Subject: Remove obsolete class X-Git-Tag: version0.1.1~100 X-Git-Url: http://git.sourceforge.jp/view?p=neighbornote%2FNeighborNote.git;a=commitdiff_plain;h=49c53093b0bccf34dd11e26322954162e986b01d;ds=inline Remove obsolete class --- diff --git a/src/cx/fbn/nevernote/utilities/StringUtils.java b/src/cx/fbn/nevernote/utilities/StringUtils.java deleted file mode 100644 index 4d0d2c9..0000000 --- a/src/cx/fbn/nevernote/utilities/StringUtils.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * This file is part of NixNote - * Copyright 2009 Randy Baumgarte - * - * This file may be licensed under the terms of of the - * GNU General Public License Version 2 (the ``GPL''). - * - * Software distributed under the License is distributed - * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either - * express or implied. See the GPL for the specific language - * governing rights and limitations. - * - * You should have received a copy of the GPL along with this - * program. If not, go to http://www.gnu.org/licenses/gpl.html - * or write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * -*/ - -package cx.fbn.nevernote.utilities; - -import java.util.HashMap; - -public class StringUtils { - - private StringUtils() {} - - private static HashMap htmlEntities; - static { - htmlEntities = new HashMap(); - htmlEntities.put("<","<") ; htmlEntities.put(">",">"); - htmlEntities.put("&","&") ; htmlEntities.put(""","\""); - htmlEntities.put("à","à"); htmlEntities.put("à","À"); - htmlEntities.put("â","â") ; htmlEntities.put("ä","ä"); - htmlEntities.put("ä","Ä") ; htmlEntities.put("â","Â"); - htmlEntities.put("å","å") ; htmlEntities.put("å","Å"); - htmlEntities.put("æ","æ") ; htmlEntities.put("&aElig;","Æ" ); - htmlEntities.put("ç","ç"); htmlEntities.put("ç","Ç"); - htmlEntities.put("é","é"); htmlEntities.put("é","É" ); - htmlEntities.put("è","è"); htmlEntities.put("è","È"); - htmlEntities.put("ê","ê") ; htmlEntities.put("ê","Ê"); - htmlEntities.put("ë","ë") ; htmlEntities.put("ë","Ë"); - htmlEntities.put("ï","ï") ; htmlEntities.put("ï","Ï"); - htmlEntities.put("ô","ô") ; htmlEntities.put("ô","Ô"); - htmlEntities.put("ö","ö") ; htmlEntities.put("ö","Ö"); - htmlEntities.put("ø","ø") ; htmlEntities.put("ø","Ø"); - htmlEntities.put("ß","ß") ; htmlEntities.put("ù","ù"); - htmlEntities.put("ù","Ù"); htmlEntities.put("û","û"); - htmlEntities.put("û","Û") ; htmlEntities.put("ü","ü"); - htmlEntities.put("ü","Ü") ; htmlEntities.put(" "," "); - htmlEntities.put("©","\u00a9"); htmlEntities.put("'", "'"); - htmlEntities.put("®","\u00ae"); htmlEntities.put("¡", "\u00a1"); - htmlEntities.put("€","\u20a0"); htmlEntities.put("¢", "\u00a2"); - htmlEntities.put("£", "\u00a3"); htmlEntities.put("&curen;", "\u00a4"); - htmlEntities.put("¥", "\u00a5"); htmlEntities.put("¦", "\u00a6"); - htmlEntities.put("§", "\u00a7"); htmlEntities.put("¨", "\u00a8"); - htmlEntities.put("©", "\u00a9"); htmlEntities.put("ª", "\u00aa"); - htmlEntities.put("&laqo;", "\u00ab"); htmlEntities.put("¬", "\u00ac"); - htmlEntities.put("®", "\u00ae"); htmlEntities.put("¯", "\u00af"); - } - - - - public static final String unescapeHTML(String source, int start){ - int i,j; - - i = source.indexOf("&", start); - while (i>-1) { - j = source.indexOf(";" ,i); - if (j > i) { - String entityToLookFor = source.substring(i , j + 1); - String value = htmlEntities.get(entityToLookFor); - if (value != null) { - value = " "; - source = new StringBuffer().append(source.substring(0 , i).toLowerCase()) - .append(value) - .append(source.substring(j + 1)) - .toString(); - i = source.indexOf("&", i+1); - } - } - } - return source; - } - - - public static final String unescapeHTML2(String source, int start){ - int i,j; - - i = source.indexOf("&", start); - if (i > -1) { - j = source.indexOf(";" ,i); - if (j > i) { - String entityToLookFor = source.substring(i , j + 1); - String value = htmlEntities.get(entityToLookFor); - if (value != null) { - value = " "; - source = new StringBuffer().append(source.substring(0 , i).toLowerCase()) - .append(value) - .append(source.substring(j + 1)) - .toString(); - return unescapeHTML(source, i + 1); // recursive call - } - } - } - return source; - } -}