View Javadoc

1   /****************************************************************
2    * Licensed to the Apache Software Foundation (ASF) under one   *
3    * or more contributor license agreements.  See the NOTICE file *
4    * distributed with this work for additional information        *
5    * regarding copyright ownership.  The ASF licenses this file   *
6    * to you under the Apache License, Version 2.0 (the            *
7    * "License"); you may not use this file except in compliance   *
8    * with the License.  You may obtain a copy of the License at   *
9    *                                                              *
10   *   http://www.apache.org/licenses/LICENSE-2.0                 *
11   *                                                              *
12   * Unless required by applicable law or agreed to in writing,   *
13   * software distributed under the License is distributed on an  *
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
15   * KIND, either express or implied.  See the License for the    *
16   * specific language governing permissions and limitations      *
17   * under the License.                                           *
18   ****************************************************************/
19  
20  
21  
22  
23  package org.apache.james.smtpserver.urirbl;
24  
25  import java.util.HashSet;
26  
27  /**
28   * A utility class that caches sets of multi-part top level domains (TLDs) for
29   * quick lookup.
30   */
31  public class TLDLookup {
32      
33      /** Simple regular expression to match strings in the cache. Note: if the
34          collection of known mult-part TLDs change to contain characters other 
35          than these, this string must be modified. */
36      static private final String tld = "[A-Za-z0-9\\-]*";
37      
38      /** Simple regular expression that matches a two-part TLD */
39      static private final String tld2 = tld+"\\."+tld;
40      
41      /** Simple regular expression that matches a three-part TLD */
42      static private final String tld3 = tld+"\\."+tld+"\\."+tld;
43      
44      /** Array of all known multi-level TLDs */
45      static private final String[] multiPartTLDs = initMultiPartTLDs();
46      
47      /** A set of all known two-part TLDs */
48      static private final HashSet twoPartTLDs = initTwoPartTLDs();
49      
50      /** A set of all known three-part TLDs */
51      static private final HashSet threePartTLDs = initThreePartTLDs();
52  
53      /** controls testing/debug output */
54      static private boolean testing = false;
55      
56      /**
57       * Determines if a two-part domain string (xxx.xxx) is contained in the 
58       * cache of known two-part TLDs.
59       *
60       * @param domain a String representing a two-part domain
61       * @return true if the domain string is found in the cache, false otherwise
62       */
63      static public boolean isTwoPartTLD(String domain) {
64          return twoPartTLDs.contains(domain);
65      }
66      
67      /**
68       * Determines if a three-part domain string (xxx.xxx.xxx) is contained in
69       * the cache of known three-part TLDs.
70       *
71       * @param domain a String representing a three-part domain
72       * @return true if the domain string is found in the cache, false otherwise
73       */
74      static public boolean isThreePartTLD(String domain) {
75          return threePartTLDs.contains(domain);
76      }
77      
78      /**
79       * Initialize two-part top-level domain cache.
80       *
81       * @return a HashSet containing all known two-part TLDs
82       */
83      static private HashSet initTwoPartTLDs() {
84          HashSet set = new HashSet(900);
85          for (int i=0; i<multiPartTLDs.length; i++) {
86              try {
87                  if (multiPartTLDs[i].matches("^"+tld2+"$")) {
88                      set.add(multiPartTLDs[i]);
89                  }
90              }
91              catch (Exception ex) {
92                  debugOut(ex);
93              }
94          }
95          debugOut("initTwoPartTLDs size="+set.size());
96          return set;
97      }
98  
99      /**
100      * Initialize three-part top-level domain cache.
101      *
102      * @return a HashSet containing all known three-part TLDs
103      */
104     static private HashSet initThreePartTLDs() {
105         HashSet set = new HashSet();
106         for (int i=0; i<multiPartTLDs.length; i++) {
107             try {
108                 if (multiPartTLDs[i].matches("^"+tld3+"$")) {
109                     debugOut("adding \"" + multiPartTLDs[i] + "\"");
110                     set.add(multiPartTLDs[i]);
111                 }
112             }
113             catch (Exception ex) {
114                 debugOut(ex);
115             }
116         }
117         debugOut("initThreePartTLDs size="+set.size());
118         return set;
119     }
120     
121     /**
122      * Initialize an array of Strings containing all known multi-part TLDs
123      *
124      * @return an array of all known multi-part TLDs
125      */
126     static private String[] initMultiPartTLDs() {
127         String[] tmp = new String[] {
128             "com.ac",
129             "edu.ac",
130             "gov.ac",
131             "edu.ai",
132             "gov.ai",
133             "com.ar",
134             "net.ar",
135             "org.ar",
136             "gov.ar",
137             "mil.ar",
138             "edu.ar",
139             "int.ar",
140             "co.at",
141             "ac.at",
142             "or.at",
143             "gv.at",
144             "priv.at",
145             "com.au",
146             "gov.au",
147             "org.au",
148             "edu.au",
149             "id.au",
150             "oz.au",
151             "info.au",
152             "net.au",
153             "asn.au",
154             "csiro.au",
155             "telememo.au",
156             "conf.au",
157             "otc.au",
158             "com.az",
159             "net.az",
160             "org.az",
161             "com.bb",
162             "net.bb",
163             "org.bb",
164             "ac.be",
165             "belgie.be",
166             "dns.be",
167             "fgov.be",
168             "com.bh",
169             "gov.bh",
170             "net.bh",
171             "edu.bh",
172             "org.bh",
173             "com.bm",
174             "edu.bm",
175             "gov.bm",
176             "org.bm",
177             "net.bm",
178             "adm.br",
179             "adv.br",
180             "agr.br",
181             "am.br",
182             "arq.br",
183             "art.br",
184             "ato.br",
185             "bio.br",
186             "bmd.br",
187             "cim.br",
188             "cng.br",
189             "cnt.br",
190             "com.br",
191             "coop.br",
192             "ecn.br",
193             "edu.br",
194             "eng.br",
195             "esp.br",
196             "etc.br",
197             "eti.br",
198             "far.br",
199             "fm.br",
200             "fnd.br",
201             "fot.br",
202             "fst.br",
203             "g12.br",
204             "ggf.br",
205             "gov.br",
206             "imb.br",
207             "ind.br",
208             "inf.br",
209             "jor.br",
210             "lel.br",
211             "mat.br",
212             "med.br",
213             "mil.br",
214             "mus.br",
215             "net.br",
216             "nom.br",
217             "not.br",
218             "ntr.br",
219             "odo.br",
220             "org.br",
221             "ppg.br",
222             "pro.br",
223             "psc.br",
224             "psi.br",
225             "qsl.br",
226             "rec.br",
227             "slg.br",
228             "srv.br",
229             "tmp.br",
230             "trd.br",
231             "tur.br",
232             "tv.br",
233             "vet.br",
234             "zlg.br",
235             "com.bs",
236             "net.bs",
237             "org.bs",
238             "ab.ca",
239             "bc.ca",
240             "mb.ca",
241             "nb.ca",
242             "nf.ca",
243             "nl.ca",
244             "ns.ca",
245             "nt.ca",
246             "nu.ca",
247             "on.ca",
248             "pe.ca",
249             "qc.ca",
250             "sk.ca",
251             "yk.ca",
252             "co.ck",
253             "net.ck",
254             "org.ck",
255             "edu.ck",
256             "gov.ck",
257             "com.cn",
258             "edu.cn",
259             "gov.cn",
260             "net.cn",
261             "org.cn",
262             "ac.cn",
263             "ah.cn",
264             "bj.cn",
265             "cq.cn",
266             "gd.cn",
267             "gs.cn",
268             "gx.cn",
269             "gz.cn",
270             "hb.cn",
271             "he.cn",
272             "hi.cn",
273             "hk.cn",
274             "hl.cn",
275             "hn.cn",
276             "jl.cn",
277             "js.cn",
278             "ln.cn",
279             "mo.cn",
280             "nm.cn",
281             "nx.cn",
282             "qh.cn",
283             "sc.cn",
284             "sn.cn",
285             "sh.cn",
286             "sx.cn",
287             "tj.cn",
288             "tw.cn",
289             "xj.cn",
290             "xz.cn",
291             "yn.cn",
292             "zj.cn",
293             "arts.co",
294             "com.co",
295             "edu.co",
296             "firm.co",
297             "gov.co",
298             "info.co",
299             "int.co",
300             "nom.co",
301             "mil.co",
302             "org.co",
303             "rec.co",
304             "store.co",
305             "web.co",
306             "ac.cr",
307             "co.cr",
308             "ed.cr",
309             "fi.cr",
310             "go.cr",
311             "or.cr",
312             "sa.cr",
313             "com.cu",
314             "net.cu",
315             "org.cu",
316             "ac.cy",
317             "com.cy",
318             "gov.cy",
319             "net.cy",
320             "org.cy",
321             "co.dk",
322             "art.do",
323             "com.do",
324             "edu.do",
325             "gov.do",
326             "org.do",
327             "mil.do",
328             "net.do",
329             "web.do",
330             "com.dz",
331             "org.dz",
332             "net.dz",
333             "gov.dz",
334             "edu.dz",
335             "ass.dz",
336             "pol.dz",
337             "art.dz",
338             "com.ec",
339             "k12.ec",
340             "edu.ec",
341             "fin.ec",
342             "med.ec",
343             "gov.ec",
344             "mil.ec",
345             "org.ec",
346             "net.ec",
347             "com.eg",
348             "edu.eg",
349             "eun.eg",
350             "gov.eg",
351             "net.eg",
352             "org.eg",
353             "sci.eg",
354             "com.er",
355             "net.er",
356             "org.er",
357             "edu.er",
358             "mil.er",
359             "gov.er",
360             "ind.er",
361             "com.et",
362             "gov.et",
363             "org.et",
364             "edu.et",
365             "net.et",
366             "biz.et",
367             "name.et",
368             "info.et",
369             "ac.fj",
370             "com.fj",
371             "gov.fj",
372             "id.fj",
373             "org.fj",
374             "school.fj",
375             "com.fk",
376             "ac.fk",
377             "gov.fk",
378             "net.fk",
379             "nom.fk",
380             "org.fk",
381             "asso.fr",
382             "nom.fr",
383             "barreau.fr",
384             "com.fr",
385             "prd.fr",
386             "presse.fr",
387             "tm.fr",
388             "aeroport.fr",
389             "assedic.fr",
390             "avocat.fr",
391             "avoues.fr",
392             "cci.fr",
393             "chambagri.fr",
394             "chirurgiens-dentistes.fr",
395             "experts-comptables.fr",
396             "geometre-expert.fr",
397             "gouv.fr",
398             "greta.fr",
399             "huissier-justice.fr",
400             "medecin.fr",
401             "notaires.fr",
402             "pharmacien.fr",
403             "port.fr",
404             "veterinaire.fr",
405             "com.ge",
406             "edu.ge",
407             "gov.ge",
408             "mil.ge",
409             "net.ge",
410             "org.ge",
411             "pvt.ge",
412             "co.gg",
413             "org.gg",
414             "sch.gg",
415             "ac.gg",
416             "gov.gg",
417             "ltd.gg",
418             "ind.gg",
419             "net.gg",
420             "alderney.gg",
421             "guernsey.gg",
422             "sark.gg",
423             "com.gu",
424             "edu.gu",
425             "net.gu",
426             "org.gu",
427             "gov.gu",
428             "mil.gu",
429             "com.hk",
430             "net.hk",
431             "org.hk",
432             "idv.hk",
433             "gov.hk",
434             "edu.hk",
435             "co.hu",
436             "2000.hu",
437             "erotika.hu",
438             "jogasz.hu",
439             "sex.hu",
440             "video.hu",
441             "info.hu",
442             "agrar.hu",
443             "film.hu",
444             "konyvelo.hu",
445             "shop.hu",
446             "org.hu",
447             "bolt.hu",
448             "forum.hu",
449             "lakas.hu",
450             "suli.hu",
451             "priv.hu",
452             "casino.hu",
453             "games.hu",
454             "media.hu",
455             "szex.hu",
456             "sport.hu",
457             "city.hu",
458             "hotel.hu",
459             "news.hu",
460             "tozsde.hu",
461             "tm.hu",
462             "erotica.hu",
463             "ingatlan.hu",
464             "reklam.hu",
465             "utazas.hu",
466             "ac.id",
467             "co.id",
468             "go.id",
469             "mil.id",
470             "net.id",
471             "or.id",
472             "co.il",
473             "net.il",
474             "org.il",
475             "ac.il",
476             "gov.il",
477             "k12.il",
478             "muni.il",
479             "idf.il",
480             "co.im",
481             "net.im",
482             "org.im",
483             "ac.im",
484             "lkd.co.im",
485             "gov.im",
486             "nic.im",
487             "plc.co.im",
488             "co.in",
489             "net.in",
490             "ac.in",
491             "ernet.in",
492             "gov.in",
493             "nic.in",
494             "res.in",
495             "gen.in",
496             "firm.in",
497             "mil.in",
498             "org.in",
499             "ind.in",
500             "ac.je",
501             "co.je",
502             "net.je",
503             "org.je",
504             "gov.je",
505             "ind.je",
506             "jersey.je",
507             "ltd.je",
508             "sch.je",
509             "com.jo",
510             "org.jo",
511             "net.jo",
512             "gov.jo",
513             "edu.jo",
514             "mil.jo",
515             "ad.jp",
516             "ac.jp",
517             "co.jp",
518             "go.jp",
519             "or.jp",
520             "ne.jp",
521             "gr.jp",
522             "ed.jp",
523             "lg.jp",
524             "net.jp",
525             "org.jp",
526             "gov.jp",
527             "hokkaido.jp",
528             "aomori.jp",
529             "iwate.jp",
530             "miyagi.jp",
531             "akita.jp",
532             "yamagata.jp",
533             "fukushima.jp",
534             "ibaraki.jp",
535             "tochigi.jp",
536             "gunma.jp",
537             "saitama.jp",
538             "chiba.jp",
539             "tokyo.jp",
540             "kanagawa.jp",
541             "niigata.jp",
542             "toyama.jp",
543             "ishikawa.jp",
544             "fukui.jp",
545             "yamanashi.jp",
546             "nagano.jp",
547             "gifu.jp",
548             "shizuoka.jp",
549             "aichi.jp",
550             "mie.jp",
551             "shiga.jp",
552             "kyoto.jp",
553             "osaka.jp",
554             "hyogo.jp",
555             "nara.jp",
556             "wakayama.jp",
557             "tottori.jp",
558             "shimane.jp",
559             "okayama.jp",
560             "hiroshima.jp",
561             "yamaguchi.jp",
562             "tokushima.jp",
563             "kagawa.jp",
564             "ehime.jp",
565             "kochi.jp",
566             "fukuoka.jp",
567             "saga.jp",
568             "nagasaki.jp",
569             "kumamoto.jp",
570             "oita.jp",
571             "miyazaki.jp",
572             "kagoshima.jp",
573             "okinawa.jp",
574             "sapporo.jp",
575             "sendai.jp",
576             "yokohama.jp",
577             "kawasaki.jp",
578             "nagoya.jp",
579             "kobe.jp",
580             "kitakyushu.jp",
581             "utsunomiya.jp",
582             "kanazawa.jp",
583             "takamatsu.jp",
584             "matsuyama.jp",
585             "com.kh",
586             "net.kh",
587             "org.kh",
588             "per.kh",
589             "edu.kh",
590             "gov.kh",
591             "mil.kh",
592             "ac.kr",
593             "co.kr",
594             "go.kr",
595             "ne.kr",
596             "or.kr",
597             "pe.kr",
598             "re.kr",
599             "seoul.kr",
600             "kyonggi.kr",
601             "com.kw",
602             "net.kw",
603             "org.kw",
604             "edu.kw",
605             "gov.kw",
606             "com.la",
607             "net.la",
608             "org.la",
609             "com.lb",
610             "org.lb",
611             "net.lb",
612             "edu.lb",
613             "gov.lb",
614             "mil.lb",
615             "com.lc",
616             "edu.lc",
617             "gov.lc",
618             "net.lc",
619             "org.lc",
620             "com.lv",
621             "net.lv",
622             "org.lv",
623             "edu.lv",
624             "gov.lv",
625             "mil.lv",
626             "id.lv",
627             "asn.lv",
628             "conf.lv",
629             "com.ly",
630             "net.ly",
631             "org.ly",
632             "co.ma",
633             "net.ma",
634             "org.ma",
635             "press.ma",
636             "ac.ma",
637             "com.mk",
638             "com.mm",
639             "net.mm",
640             "org.mm",
641             "edu.mm",
642             "gov.mm",
643             "com.mo",
644             "net.mo",
645             "org.mo",
646             "edu.mo",
647             "gov.mo",
648             "com.mt",
649             "net.mt",
650             "org.mt",
651             "edu.mt",
652             "tm.mt",
653             "uu.mt",
654             "com.mx",
655             "net.mx",
656             "org.mx",
657             "com.my",
658             "org.my",
659             "gov.my",
660             "edu.my",
661             "net.my",
662             "com.na",
663             "org.na",
664             "net.na",
665             "alt.na",
666             "edu.na",
667             "cul.na",
668             "unam.na",
669             "telecom.na",
670             "com.nc",
671             "net.nc",
672             "org.nc",
673             "ac.ng",
674             "edu.ng",
675             "sch.ng",
676             "com.ng",
677             "gov.ng",
678             "org.ng",
679             "net.ng",
680             "gob.ni",
681             "com.ni",
682             "net.ni",
683             "edu.ni",
684             "nom.ni",
685             "org.ni",
686             "com.np",
687             "net.np",
688             "org.np",
689             "gov.np",
690             "edu.np",
691             "ac.nz",
692             "co.nz",
693             "cri.nz",
694             "gen.nz",
695             "geek.nz",
696             "govt.nz",
697             "iwi.nz",
698             "maori.nz",
699             "mil.nz",
700             "net.nz",
701             "org.nz",
702             "school.nz",
703             "com.om",
704             "co.om",
705             "edu.om",
706             "ac.om",
707             "gov.om",
708             "net.om",
709             "org.om",
710             "mod.om",
711             "museum.om",
712             "biz.om",
713             "pro.om",
714             "med.om",
715             "com.pa",
716             "net.pa",
717             "org.pa",
718             "edu.pa",
719             "ac.pa",
720             "gob.pa",
721             "sld.pa",
722             "edu.pe",
723             "gob.pe",
724             "nom.pe",
725             "mil.pe",
726             "org.pe",
727             "com.pe",
728             "net.pe",
729             "com.pg",
730             "net.pg",
731             "ac.pg",
732             "com.ph",
733             "net.ph",
734             "org.ph",
735             "mil.ph",
736             "ngo.ph",
737             "aid.pl",
738             "agro.pl",
739             "atm.pl",
740             "auto.pl",
741             "biz.pl",
742             "com.pl",
743             "edu.pl",
744             "gmina.pl",
745             "gsm.pl",
746             "info.pl",
747             "mail.pl",
748             "miasta.pl",
749             "media.pl",
750             "mil.pl",
751             "net.pl",
752             "nieruchomosci.pl",
753             "nom.pl",
754             "org.pl",
755             "pc.pl",
756             "powiat.pl",
757             "priv.pl",
758             "realestate.pl",
759             "rel.pl",
760             "sex.pl",
761             "shop.pl",
762             "sklep.pl",
763             "sos.pl",
764             "szkola.pl",
765             "targi.pl",
766             "tm.pl",
767             "tourism.pl",
768             "travel.pl",
769             "turystyka.pl",
770             "com.pk",
771             "net.pk",
772             "edu.pk",
773             "org.pk",
774             "fam.pk",
775             "biz.pk",
776             "web.pk",
777             "gov.pk",
778             "gob.pk",
779             "gok.pk",
780             "gon.pk",
781             "gop.pk",
782             "gos.pk",
783             "edu.ps",
784             "gov.ps",
785             "plo.ps",
786             "sec.ps",
787             "com.py",
788             "net.py",
789             "org.py",
790             "edu.py",
791             "com.qa",
792             "net.qa",
793             "org.qa",
794             "edu.qa",
795             "gov.qa",
796             "asso.re",
797             "com.re",
798             "nom.re",
799             "com.ru",
800             "net.ru",
801             "org.ru",
802             "pp.ru",
803             "com.sa",
804             "edu.sa",
805             "sch.sa",
806             "med.sa",
807             "gov.sa",
808             "net.sa",
809             "org.sa",
810             "pub.sa",
811             "com.sb",
812             "net.sb",
813             "org.sb",
814             "edu.sb",
815             "gov.sb",
816             "com.sd",
817             "net.sd",
818             "org.sd",
819             "edu.sd",
820             "sch.sd",
821             "med.sd",
822             "gov.sd",
823             "tm.se",
824             "press.se",
825             "parti.se",
826             "brand.se",
827             "fh.se",
828             "fhsk.se",
829             "fhv.se",
830             "komforb.se",
831             "kommunalforbund.se",
832             "komvux.se",
833             "lanarb.se",
834             "lanbib.se",
835             "naturbruksgymn.se",
836             "sshn.se",
837             "org.se",
838             "pp.se",
839             "com.sg",
840             "net.sg",
841             "org.sg",
842             "edu.sg",
843             "gov.sg",
844             "per.sg",
845             "com.sh",
846             "net.sh",
847             "org.sh",
848             "edu.sh",
849             "gov.sh",
850             "mil.sh",
851             "gov.st",
852             "saotome.st",
853             "principe.st",
854             "consulado.st",
855             "embaixada.st",
856             "org.st",
857             "edu.st",
858             "net.st",
859             "com.st",
860             "store.st",
861             "mil.st",
862             "co.st",
863             "com.sv",
864             "org.sv",
865             "edu.sv",
866             "gob.sv",
867             "red.sv",
868             "com.sy",
869             "net.sy",
870             "org.sy",
871             "gov.sy",
872             "ac.th",
873             "co.th",
874             "go.th",
875             "net.th",
876             "or.th",
877             "com.tn",
878             "net.tn",
879             "org.tn",
880             "edunet.tn",
881             "gov.tn",
882             "ens.tn",
883             "fin.tn",
884             "nat.tn",
885             "ind.tn",
886             "info.tn",
887             "intl.tn",
888             "rnrt.tn",
889             "rnu.tn",
890             "rns.tn",
891             "tourism.tn",
892             "com.tr",
893             "net.tr",
894             "org.tr",
895             "edu.tr",
896             "gov.tr",
897             "mil.tr",
898             "bbs.tr",
899             "k12.tr",
900             "gen.tr",
901             "co.tt",
902             "com.tt",
903             "org.tt",
904             "net.tt",
905             "biz.tt",
906             "info.tt",
907             "pro.tt",
908             "name.tt",
909             "gov.tt",
910             "edu.tt",
911             "nic.tt",
912             "us.tt",
913             "uk.tt",
914             "ca.tt",
915             "eu.tt",
916             "es.tt",
917             "fr.tt",
918             "it.tt",
919             "se.tt",
920             "dk.tt",
921             "be.tt",
922             "de.tt",
923             "at.tt",
924             "au.tt",
925             "co.tv",
926             "com.tw",
927             "net.tw",
928             "org.tw",
929             "edu.tw",
930             "idv.tw",
931             "gove.tw",
932             "com.ua",
933             "net.ua",
934             "org.ua",
935             "edu.ua",
936             "gov.ua",
937             "ac.ug",
938             "co.ug",
939             "or.ug",
940             "go.ug",
941             "co.uk",
942             "me.uk",
943             "org.uk",
944             "edu.uk",
945             "ltd.uk",
946             "plc.uk",
947             "net.uk",
948             "sch.uk",
949             "nic.uk",
950             "ac.uk",
951             "gov.uk",
952             "nhs.uk",
953             "police.uk",
954             "mod.uk",
955             "dni.us",
956             "fed.us",
957             "com.uy",
958             "edu.uy",
959             "net.uy",
960             "org.uy",
961             "gub.uy",
962             "mil.uy",
963             "com.ve",
964             "net.ve",
965             "org.ve",
966             "co.ve",
967             "edu.ve",
968             "gov.ve",
969             "mil.ve",
970             "arts.ve",
971             "bib.ve",
972             "firm.ve",
973             "info.ve",
974             "int.ve",
975             "nom.ve",
976             "rec.ve",
977             "store.ve",
978             "tec.ve",
979             "web.ve",
980             "co.vi",
981             "net.vi",
982             "org.vi",
983             "com.vn",
984             "biz.vn",
985             "edu.vn",
986             "gov.vn",
987             "net.vn",
988             "org.vn",
989             "int.vn",
990             "ac.vn",
991             "pro.vn",
992             "info.vn",
993             "health.vn",
994             "name.vn",
995             "com.vu",
996             "edu.vu",
997             "net.vu",
998             "org.vu",
999             "de.vu",
1000             "ch.vu",
1001             "fr.vu",
1002             "com.ws",
1003             "net.ws",
1004             "org.ws",
1005             "gov.ws",
1006             "edu.ws",
1007             "ac.yu",
1008             "co.yu",
1009             "edu.yu",
1010             "org.yu",
1011             "com.ye",
1012             "net.ye",
1013             "org.ye",
1014             "gov.ye",
1015             "edu.ye",
1016             "mil.ye",
1017             "ac.za",
1018             "alt.za",
1019             "bourse.za",
1020             "city.za",
1021             "co.za",
1022             "edu.za",
1023             "gov.za",
1024             "law.za",
1025             "mil.za",
1026             "net.za",
1027             "ngo.za",
1028             "nom.za",
1029             "org.za",
1030             "school.za",
1031             "tm.za",
1032             "web.za",
1033             "co.zw",
1034             "ac.zw",
1035             "org.zw",
1036             "gov.zw",
1037             "eu.org",
1038             "au.com",
1039             "br.com",
1040             "cn.com",
1041             "de.com",
1042             "de.net",
1043             "eu.com",
1044             "gb.com",
1045             "gb.net",
1046             "hu.com",
1047             "no.com",
1048             "qc.com",
1049             "ru.com",
1050             "sa.com",
1051             "se.com",
1052             "uk.com",
1053             "uk.net",
1054             "us.com",
1055             "uy.com",
1056             "za.com",
1057             "dk.org",
1058             "tel.no",
1059             "fax.nr",
1060             "mob.nr",
1061             "mobil.nr",
1062             "mobile.nr",
1063             "tel.nr",
1064             "tlf.nr",
1065             "e164.arpa"
1066         };
1067         debugOut("array size=" + tmp.length);
1068         return tmp;
1069     }
1070     
1071     /**
1072      * Debugging output
1073      */
1074     private static void debugOut(String msg) {
1075         if (true == testing) {
1076             System.out.println(msg);
1077         }
1078     }
1079     
1080     /**
1081      * Debugging output
1082      */
1083     private static void debugOut(Throwable th) {
1084         if (true == testing) {
1085             System.out.println(th);
1086         }
1087     }
1088 }
1089 
1090 
1091