New upstream version 1.6
Emmanuel Bourg
6 years ago
0 | # Licensed to the Apache Software Foundation (ASF) under one or more | |
1 | # contributor license agreements. See the NOTICE file distributed with | |
2 | # this work for additional information regarding copyright ownership. | |
3 | # The ASF licenses this file to You under the Apache License, Version 2.0 | |
4 | # (the "License"); you may not use this file except in compliance with | |
5 | # the License. You may obtain a copy of the License at | |
6 | # | |
7 | # http://www.apache.org/licenses/LICENSE-2.0 | |
8 | # | |
9 | # Unless required by applicable law or agreed to in writing, software | |
10 | # distributed under the License is distributed on an "AS IS" BASIS, | |
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
12 | # See the License for the specific language governing permissions and | |
13 | # limitations under the License. | |
14 | ||
15 | language: java | |
16 | sudo: false | |
17 | ||
18 | jdk: | |
19 | - openjdk7 | |
20 | - oraclejdk8 | |
21 | ||
22 | after_success: | |
23 | - mvn clean cobertura:cobertura coveralls:report |
23 | 23 | |
24 | 24 | export MAVEN_OPTS="-Xmx512m" # Unix |
25 | 25 | set MAVEN_OPTS="-Xmx512m" # Windows |
26 | ||
27 | There can be problems building the site using Maven 3.0.5 or earlier; | |
28 | if so please use a later version. |
0 | 0 | Apache Commons Validator |
1 | Copyright 2001-2016 The Apache Software Foundation | |
1 | Copyright 2001-2017 The Apache Software Foundation | |
2 | 2 | |
3 | 3 | This product includes software developed at |
4 | 4 | The Apache Software Foundation (http://www.apache.org/). |
0 | Apache Apache Commons Validator | |
1 | Version 1.5.1 | |
2 | RELEASE NOTES | |
0 | Apache Commons Validator 1.6 | |
1 | RELEASE NOTES | |
3 | 2 | |
4 | The Apache Commons Validator team is pleased to announce the release of Apache Apache Commons Validator 1.5.1 | |
3 | The Apache Commons Validator team is pleased to announce the release of Apache Commons Validator 1.6 | |
5 | 4 | |
6 | 5 | Apache Commons Validator provides the building blocks for both client side validation and server side data validation. |
7 | 6 | It may be used standalone or with a framework like Struts. |
8 | 7 | |
9 | This is a maintenance release. | |
8 | This is primarily a maintenance release. | |
10 | 9 | All projects are encouraged to update to this release of Apache Commons Validator. |
11 | 10 | |
12 | 11 | Commons Validator requires Java 1.6 or later. |
13 | ||
14 | IMPORTANT NOTES | |
12 | Main enhancements ================= | |
13 | * Modulus Ten Check Digit Implementation | |
14 | * Generic CreditCard validation (syntax and checkdigit only; does not check IIN) | |
15 | * CreditCard validation specification by numeric range | |
16 | IMPORTANT NOTES | |
15 | 17 | =============== |
16 | 18 | |
17 | 19 | BREAKING CHANGES: |
26 | 28 | Changes in this version include: |
27 | 29 | |
28 | 30 | New features: |
29 | o VALIDATOR-351: DomainValidator - allow access to internal arrays | |
31 | o VALIDATOR-415: Simplify building new CreditCard validators | |
32 | o VALIDATOR-413: Generic CreditCard validation | |
33 | o VALIDATOR-394: General Modulus Ten Check Digit Implementation Thanks to Niall Pemberton. | |
30 | 34 | |
31 | 35 | Fixed Bugs: |
32 | o VALIDATOR-392: Mastercard Series 2 BIN ranges (active from October 2016) added to CreditCardValidator | |
33 | To disable the new ranges, use option MASTERCARD_PRE_OCT2016 or validator MASTERCARD_VALIDATOR_PRE_OCT2016 Thanks to Tim Deboer. | |
34 | o VALIDATOR-386: org.apache.commons.validator.routines.DomainValidator.ArrayType is not public Thanks to Auke van Leeuwen. | |
35 | o VALIDATOR-359: EmailValidator does not catch invalid email address like dora@.com Thanks to Dora Kinghorn. | |
36 | o VALIDATOR-384: EmailValidator does not support escaped quotes in a quoted string Thanks to Kris Babic. | |
36 | o VALIDATOR-420: Query params validator shouldn't accept whitespaces Thanks to Marcin Gasior. | |
37 | o VALIDATOR-419: Invalid IPv6 addresses that are IPv4-mapped pass InetAddressValidator validation Thanks to Denis Iskhakov. | |
38 | o VALIDATOR-418: UrlValidatorTest: testIsValid() does not run all tests Thanks to Robert McGuigan. | |
39 | o VALIDATOR-379: CodeValidator unconditionally trim()s the input string - document the behaviour | |
40 | o VALIDATOR-387: Userinfo without colon should be valid in UrlValidator Thanks to Shumpei Akai. | |
41 | o VALIDATOR-411: UrlValidator accepts ports above max limit of 16-bit unsigned integer | |
42 | o VALIDATOR-407: Generic .shop top level domain is considered invalid | |
43 | o VALIDATOR-405: IBANValidator - Costa Rica entry has been updated in SWIFT docs | |
44 | o VALIDATOR-401: IBANValidator fails for Seychelles and Ukraine | |
45 | o VALIDATOR-391: UrlValidator.isValid throws exception for FILEURLs | |
46 | Fixed code so it handles URLs with no authority field Thanks to Mark E. Scott, Jr. & Jason Loomis. | |
37 | 47 | |
38 | 48 | Changes: |
39 | o Updated to TLD list Version 2016041301, Last Updated Thu Apr 14 07:07:01 2016 UTC | |
49 | o IANA TLD lists: Updated to Version 2017020400, Last Updated Sat Feb 4 07:07:01 2017 UTC | |
50 | o Update to version 73 of SWIFT IBAN list: added BY (Belarus) and IQ (Iraq); fixed Santa Lucia format | |
40 | 51 | |
52 | ||
53 | Historical list of changes: http://commons.apache.org/proper/commons-validator/changes-report.html | |
41 | 54 | |
42 | 55 | For complete information on Apache Commons Validator, including instructions on how to submit bug reports, |
43 | 56 | patches, or suggestions for improvement, see the Apache Apache Commons Validator website: |
44 | 57 | |
45 | http://commons.apache.org/proper/commons-validator/⏎ | |
58 | http://commons.apache.org/proper/commons-validator/ |
0 | # Licensed to the Apache Software Foundation (ASF) under one or more | |
1 | # contributor license agreements. See the NOTICE file distributed with | |
2 | # this work for additional information regarding copyright ownership. | |
3 | # The ASF licenses this file to You under the Apache License, Version 2.0 | |
4 | # (the "License"); you may not use this file except in compliance with | |
5 | # the License. You may obtain a copy of the License at | |
6 | # | |
7 | # http://www.apache.org/licenses/LICENSE-2.0 | |
8 | # | |
9 | # Unless required by applicable law or agreed to in writing, software | |
10 | # distributed under the License is distributed on an "AS IS" BASIS, | |
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
12 | # See the License for the specific language governing permissions and | |
13 | # limitations under the License. | |
14 | ||
15 | # $Id: build.properties.sample 1237244 2012-01-29 11:23:19Z simonetripodi $ | |
16 | # $Rev: 1237244 $ | |
17 | # $Date: 2012-01-29 12:23:19 +0100 (Sun, 29 Jan 2012) $ | |
18 | # ----------------------------------------------------------------------------- | |
19 | # This is an example "build.properties" file. Make any changes you need, | |
20 | # and rename this file to "build.properties" in the same directory that | |
21 | # contains the "build.xml" file. | |
22 | # ----------------------------------------------------------------------------- | |
23 | apache.dir=D:/Java/Programs/Apache | |
24 | ||
25 | ||
26 | # The JAR file containing version 1.7.0 (or later) of the Beanutils package | |
27 | # from the Jakarta Commons project. | |
28 | commons-beanutils.jar=../beanutils/dist/commons-beanutils.jar | |
29 | ||
30 | # The JAR file containing version 1.8 (or later) of the Digester package | |
31 | # from the Jakarta Commons project. | |
32 | commons-digester.jar=../digester/dist/commons-digester.jar | |
33 | ||
34 | # The JAR file containing version 1.1 (or later) of the Logging package | |
35 | # from the Jakarta Commons project. | |
36 | commons-logging.jar=../logging/dist/commons-logging.jar | |
37 | ||
38 | # The JAR file containing version 3.8.1 (or later) of | |
39 | # JUnit Unit Testing (http://www.junit.org) | |
40 | junit.jar=D:/java/Lib/junit3.8.1/junit.jar | |
41 | ||
42 | # Needed for building the version Javadocs | |
43 | xerces.jar=${apache.dir}/xerces-2_5_0/xercesImpl.jar | |
44 | ||
45 | # jsdoc 1.5.2 or Newer is needed for building the Javascript Javadocs | |
46 | jsdoc.home=/cygdrive/d/Projects/Sourceforge/JsDoc/JSDoc-1.5.2 | |
47 | ||
48 | #############################Maven Variables ####################################### | |
49 | # CVS Start Change Log date | |
50 | maven.changelog.range=2000 | |
51 | ||
52 | ||
53 | # If you are using ssh tunneling & have a .cvspass file setup | |
54 | cvs.developer.host=localhost | |
55 | # Maven deploy user | |
56 | cvs.developer.id=rleland | |
57 | ||
58 | ######## Maven Variables located in your $HOME/build.properties #### | |
59 | # maven.username=rleland | |
60 | # maven.mode.online=true | |
61 | # maven.debugOn=true |
0 | <!-- | |
1 | Licensed to the Apache Software Foundation (ASF) under one or more | |
2 | contributor license agreements. See the NOTICE file distributed with | |
3 | this work for additional information regarding copyright ownership. | |
4 | The ASF licenses this file to You under the Apache License, Version 2.0 | |
5 | (the "License"); you may not use this file except in compliance with | |
6 | the License. You may obtain a copy of the License at | |
7 | ||
8 | http://www.apache.org/licenses/LICENSE-2.0 | |
9 | ||
10 | Unless required by applicable law or agreed to in writing, software | |
11 | distributed under the License is distributed on an "AS IS" BASIS, | |
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | See the License for the specific language governing permissions and | |
14 | limitations under the License. | |
15 | --> | |
16 | <project name="Validator" default="dist" basedir="."> | |
17 | ||
18 | ||
19 | <!-- | |
20 | "Validator" component of the Apache Commons Subproject | |
21 | $Id: build.xml 1705347 2015-09-25 20:17:56Z adrianc $ | |
22 | --> | |
23 | ||
24 | ||
25 | <!-- ========== Initialize Properties ===================================== --> | |
26 | ||
27 | ||
28 | <property file="build.properties"/> <!-- Component local --> | |
29 | <property file="../build.properties"/> <!-- Commons local --> | |
30 | <property file="${user.home}/build.properties"/> <!-- User local --> | |
31 | ||
32 | ||
33 | <!-- ========== External Dependencies ===================================== --> | |
34 | ||
35 | ||
36 | <!-- The directories corresponding to your necessary dependencies --> | |
37 | <property name="junit.home" value="/usr/local/junit3.8.1"/> | |
38 | <property name="commons.home" value="../../jakarta-commons"/> | |
39 | <property name="sandbox.home" value="../../jakarta-commons-sandbox"/> | |
40 | <property name="beanutils.home" value="${commons.home}/beanutils"/> | |
41 | <property name="collections.home" value="${commons.home}/collections"/> | |
42 | <property name="digester.home" value="${commons.home}/digester"/> | |
43 | <property name="logging.home" value="${commons.home}/logging"/> | |
44 | ||
45 | ||
46 | <!-- ========== Derived Values ============================================ --> | |
47 | ||
48 | ||
49 | <!-- The locations of necessary jar files --> | |
50 | <property name="junit.jar" value="${junit.home}/junit.jar"/> | |
51 | <property name="commons-beanutils.jar" value="${beanutils.home}/dist/commons-beanutils.jar"/> | |
52 | <property name="commons-digester.jar" value="${digester.home}/dist/commons-digester.jar"/> | |
53 | <property name="commons-logging.jar" value="${logging.home}/dist/commons-logging.jar"/> | |
54 | <property name="commons-collections.jar" value="${collections.home}/dist/commons-collections.jar"/> | |
55 | ||
56 | ||
57 | <!-- ========== Component Declarations ==================================== --> | |
58 | ||
59 | ||
60 | <!-- The name of this component --> | |
61 | <property name="component.name" value="validator"/> | |
62 | ||
63 | <!-- The primary package name of this component --> | |
64 | <property name="component.package" value="org.apache.commons.validator"/> | |
65 | ||
66 | <!-- The title of this component --> | |
67 | <property name="component.title" value="Commons Validator"/> | |
68 | ||
69 | <!-- The current version number of this component --> | |
70 | <property name="component.version" value="1.5.0-SNAPSHOT"/> | |
71 | ||
72 | <!-- The base directory for compilation targets --> | |
73 | <property name="build.home" value="target"/> | |
74 | ||
75 | <!-- The base directory for component resources --> | |
76 | <property name="resources.home" value="src/main/resources"/> | |
77 | ||
78 | <!-- The base directory for distribution targets --> | |
79 | <property name="dist.home" value="dist"/> | |
80 | ||
81 | <!-- The base directory for release targets --> | |
82 | <property name="release.home" value="release" /> | |
83 | ||
84 | <!-- The base directory for component sources --> | |
85 | <property name="source.home" value="src/main/java"/> | |
86 | ||
87 | <!-- The base directory for unit test sources --> | |
88 | <property name="test.home" value="src/test"/> | |
89 | ||
90 | <!-- The base directory for example sources --> | |
91 | <property name="example.home" value="src/example"/> | |
92 | ||
93 | <!-- Directory where test results are stored --> | |
94 | <property name="test.results.dir" value="${build.home}/test-results" /> | |
95 | ||
96 | <!-- Directory where binary release files are staged --> | |
97 | <property name="stage.bin.dir" value="${release.home}/stage/bin"/> | |
98 | ||
99 | <!-- Directory where source release files are staged --> | |
100 | <property name="stage.src.dir" value="${release.home}/stage/src"/> | |
101 | ||
102 | <!-- Directory where release builds are prepared for upload --> | |
103 | <property name="upload.dir" value="${release.home}/upload"/> | |
104 | ||
105 | <!-- Base file name for upload files --> | |
106 | <property name="upload.file.base" value="${component.name}-${component.version}"/> | |
107 | ||
108 | <!-- Download lib dir --> | |
109 | <property name="download.lib.dir" value="lib"/> | |
110 | ||
111 | <!-- ========== Compiler Defaults ========================================= --> | |
112 | ||
113 | ||
114 | <!-- source JDK version (should be same as maven.compile.source) --> | |
115 | <property name="compile.source" value="1.5"/> | |
116 | ||
117 | <!-- target JDK version (should be same as maven.compile.target) --> | |
118 | <property name="compile.target" value="1.5"/> | |
119 | ||
120 | <!-- Should Java compilations set the 'debug' compiler option? --> | |
121 | <property name="compile.debug" value="true"/> | |
122 | ||
123 | <!-- Should Java compilations set the 'deprecation' compiler option? --> | |
124 | <property name="compile.deprecation" value="false"/> | |
125 | ||
126 | <!-- Should Java compilations set the 'optimize' compiler option? --> | |
127 | <property name="compile.optimize" value="true"/> | |
128 | ||
129 | <!-- Construct compile classpath --> | |
130 | <path id="compile.classpath"> | |
131 | <pathelement location="${build.home}/classes"/> | |
132 | <pathelement location="${commons-beanutils.jar}"/> | |
133 | <pathelement location="${commons-digester.jar}"/> | |
134 | <pathelement location="${commons-logging.jar}"/> | |
135 | <pathelement location="${commons-collections.jar}"/> | |
136 | <path refid="downloaded.lib.classpath"/> | |
137 | </path> | |
138 | ||
139 | <!-- Construct compile classpath --> | |
140 | <path id="downloaded.lib.classpath"> | |
141 | <pathelement location="${download.lib.dir}/commons-beanutils.jar"/> | |
142 | <pathelement location="${download.lib.dir}/commons-digester.jar"/> | |
143 | <pathelement location="${download.lib.dir}/commons-logging.jar"/> | |
144 | <pathelement location="${download.lib.dir}/commons-collections.jar"/> | |
145 | <pathelement location="${download.lib.dir}/junit.jar"/> | |
146 | </path> | |
147 | ||
148 | <!-- ========== Test Execution Defaults =================================== --> | |
149 | ||
150 | ||
151 | <!-- Construct unit test classpath --> | |
152 | <path id="test.classpath"> | |
153 | <pathelement location="${build.home}/classes"/> | |
154 | <pathelement location="${build.home}/tests"/> | |
155 | <pathelement location="${commons-beanutils.jar}"/> | |
156 | <pathelement location="${commons-digester.jar}"/> | |
157 | <pathelement location="${commons-logging.jar}"/> | |
158 | <pathelement location="${commons-collections.jar}"/> | |
159 | <pathelement location="${junit.jar}"/> | |
160 | <pathelement location="${xerces.jar}"/> | |
161 | <path refid="downloaded.lib.classpath"/> | |
162 | </path> | |
163 | ||
164 | <!-- Should all tests fail if one does? --> | |
165 | <property name="test.failonerror" value="true"/> | |
166 | ||
167 | <!-- ========== Example Execution Defaults ================================ --> | |
168 | ||
169 | ||
170 | <!-- Construct example classpath --> | |
171 | <path id="example.classpath"> | |
172 | <path refid="test.classpath"/> | |
173 | <pathelement location="${build.home}/example" /> | |
174 | </path> | |
175 | ||
176 | ||
177 | <!-- ========== Executable Targets ======================================== --> | |
178 | ||
179 | ||
180 | <target name="init" | |
181 | description="Initialize and evaluate conditionals"> | |
182 | <echo message="-------- ${component.name} ${component.version} --------"/> | |
183 | <filter token="name" value="${component.name}"/> | |
184 | <filter token="package" value="${component.package}"/> | |
185 | <filter token="version" value="${component.version}"/> | |
186 | <filter token="compilesource" value="${compile.source}"/> | |
187 | <filter token="compiletarget" value="${compile.target}"/> | |
188 | <available property="jsdoc.found" type="file" file="${jsdoc.home}/jsdoc.pl"/> | |
189 | </target> | |
190 | ||
191 | ||
192 | <target name="prepare" depends="init,download-dependencies" | |
193 | description="Prepare build directory"> | |
194 | <mkdir dir="${build.home}"/> | |
195 | <mkdir dir="${build.home}/classes"/> | |
196 | <mkdir dir="${build.home}/tests"/> | |
197 | <mkdir dir="${test.results.dir}"/> | |
198 | </target> | |
199 | ||
200 | ||
201 | <target name="static" depends="prepare" | |
202 | description="Copy static files to build directory"> | |
203 | <tstamp/> | |
204 | </target> | |
205 | ||
206 | ||
207 | <target name="compile" depends="static" | |
208 | description="Compile shareable components"> | |
209 | <javac srcdir="${source.home}" | |
210 | destdir="${build.home}/classes" | |
211 | source="${compile.source}" | |
212 | target="${compile.target}" | |
213 | debug="${compile.debug}" | |
214 | deprecation="${compile.deprecation}" | |
215 | optimize="${compile.optimize}"> | |
216 | <classpath refid="compile.classpath"/> | |
217 | </javac> | |
218 | <copy todir="${build.home}/classes" filtering="on"> | |
219 | <fileset dir="${source.home}" | |
220 | excludes="**/*.java"/> | |
221 | </copy> | |
222 | <copy todir="${build.home}/classes"> | |
223 | <fileset dir="${resources.home}" includes="**/*.dtd,**/*.xml"/> | |
224 | </copy> | |
225 | </target> | |
226 | ||
227 | ||
228 | <target name="clean" | |
229 | description="Clean build and distribution directories"> | |
230 | <delete dir="${build.home}"/> | |
231 | <delete dir="${dist.home}"/> | |
232 | <delete dir="${release.home}"/> | |
233 | </target> | |
234 | ||
235 | ||
236 | <target name="all" depends="clean,compile" | |
237 | description="Clean and compile all components"/> | |
238 | ||
239 | ||
240 | <target name="javadoc.init" | |
241 | description="Initializes Javadoc directories"> | |
242 | <mkdir dir="${dist.home}"/> | |
243 | <mkdir dir="${dist.home}/docs"/> | |
244 | <mkdir dir="${dist.home}/docs/apidocs"/> | |
245 | </target> | |
246 | ||
247 | <target name="javadoc" depends="compile" | |
248 | description="Create component Javadoc documentation"> | |
249 | <!--javadoc sourcepath="${source.home}" | |
250 | destdir="${dist.home}/docs/apidocs" | |
251 | packagenames="org.apache.commons.*" | |
252 | author="true" | |
253 | private="true" | |
254 | version="true" | |
255 | doctitle="<h1>${component.title} (Version ${component.version})</h1>" | |
256 | windowtitle="${component.title} (Version ${component.version})" | |
257 | bottom="Copyright (c) 2001-2004 Apache Software Foundation" | |
258 | classpathref="compile.classpath" / --> | |
259 | </target> | |
260 | ||
261 | ||
262 | ||
263 | <target name="change-log" > | |
264 | <cvschangelog destfile="changelog.xml" start="${cvs.start}" /> | |
265 | <style in="changelog.xml" out="changelog.html" style="${ant.home}/etc/changelog.xsl"> | |
266 | <param name="title" expression="Validator ChangeLog"/> | |
267 | <param name="module" expression="commons"/> | |
268 | <param name="cvsweb" expression="http://cvs.apache.org/viewcvs/"/> | |
269 | </style> | |
270 | </target> | |
271 | ||
272 | ||
273 | ||
274 | <target name="dist" depends="compile,javadoc" | |
275 | description="Create binary distribution"> | |
276 | <mkdir dir="${dist.home}"/> | |
277 | ||
278 | <copy file="LICENSE.txt" | |
279 | todir="${dist.home}"/> | |
280 | <copy file="NOTICE.txt" | |
281 | todir="${dist.home}"/> | |
282 | <copy file="RELEASE-NOTES.txt" | |
283 | todir="${dist.home}"/> | |
284 | <mkdir dir="${build.home}/classes/META-INF"/> | |
285 | <copy file="LICENSE.txt" | |
286 | tofile="${build.home}/classes/META-INF/LICENSE.txt"/> | |
287 | <copy file="NOTICE.txt" | |
288 | tofile="${build.home}/classes/META-INF/NOTICE.txt"/> | |
289 | ||
290 | <manifest file="${build.home}/MANIFEST.MF"> | |
291 | <attribute name="Specification-Title" value="${component.title}"/> | |
292 | <attribute name="Specification-Version" value="${component.version}"/> | |
293 | <attribute name="Specification-Vendor" value="Apache Software Foundation"/> | |
294 | <attribute name="Implementation-Title" value="${component.title}"/> | |
295 | <attribute name="Implementation-Version" value="${component.version}"/> | |
296 | <attribute name="Implementation-Vendor" value="Apache Software Foundation"/> | |
297 | <attribute name="Implementation-Vendor-Id" value="org.apache"/> | |
298 | <attribute name="X-Compile-Source-JDK" value="${compile.source}"/> | |
299 | <attribute name="X-Compile-Target-JDK" value="${compile.target}"/> | |
300 | </manifest> | |
301 | ||
302 | <jar jarfile="${dist.home}/commons-${component.name}-${component.version}.jar" | |
303 | basedir="${build.home}/classes" | |
304 | manifest="${build.home}/MANIFEST.MF"/> | |
305 | </target> | |
306 | ||
307 | <!-- ========== Unit Test Targets ========================================= --> | |
308 | ||
309 | ||
310 | <target name="compile.tests" depends="compile" | |
311 | description="Compile unit test cases"> | |
312 | <javac srcdir="${test.home}/java" | |
313 | destdir="${build.home}/tests" | |
314 | debug="${compile.debug}" | |
315 | deprecation="${compile.deprecation}" | |
316 | optimize="${compile.optimize}"> | |
317 | <classpath refid="test.classpath"/> | |
318 | </javac> | |
319 | <copy todir="${build.home}/tests" filtering="on"> | |
320 | <fileset dir="${test.home}/resources"/> | |
321 | </copy> | |
322 | </target> | |
323 | ||
324 | ||
325 | <target name="test" depends="compile.tests,test.main,test.checkdigit,test.routines" | |
326 | description="Run all unit test cases"> | |
327 | </target> | |
328 | ||
329 | <target name="test.main" depends="compile.tests" | |
330 | description="Run main unit test cases"> | |
331 | <echo message="Running main tests ..."/> | |
332 | ||
333 | <junit fork="yes" forkmode="once" printsummary="yes" | |
334 | haltonfailure="${test.failonerror}" | |
335 | failureproperty="main.test.failed" showoutput="true"> | |
336 | <classpath refid="test.classpath"/> | |
337 | <formatter type="plain"/> | |
338 | <batchtest todir="${test.results.dir}"> | |
339 | <fileset dir="${test.home}/java"> | |
340 | <include name="org/apache/commons/validator/*Test.java" /> | |
341 | <exclude name="**/Abstract*Test.java" /> | |
342 | </fileset> | |
343 | </batchtest> | |
344 | </junit> | |
345 | </target> | |
346 | ||
347 | <target name="test.checkdigit" depends="compile.tests" | |
348 | description="Run checkdigit unit test cases"> | |
349 | <echo message="Running checkdigit tests ..."/> | |
350 | ||
351 | <junit fork="yes" forkmode="once" printsummary="yes" | |
352 | haltonfailure="${test.failonerror}" | |
353 | failureproperty="main.test.failed" showoutput="true"> | |
354 | <classpath refid="test.classpath"/> | |
355 | <formatter type="plain"/> | |
356 | <batchtest todir="${test.results.dir}"> | |
357 | <fileset dir="${test.home}/java"> | |
358 | <include name="org/apache/commons/validator/routines/checkdigit/*Test.java" /> | |
359 | <exclude name="**/Abstract*Test.java" /> | |
360 | </fileset> | |
361 | </batchtest> | |
362 | </junit> | |
363 | </target> | |
364 | ||
365 | <target name="test.routines" depends="compile.tests" | |
366 | description="Run routines unit test cases"> | |
367 | <echo message="Running routines tests ..."/> | |
368 | ||
369 | <junit fork="yes" forkmode="once" printsummary="yes" | |
370 | haltonfailure="${test.failonerror}" | |
371 | failureproperty="main.test.failed" showoutput="true"> | |
372 | <classpath refid="test.classpath"/> | |
373 | <formatter type="plain"/> | |
374 | <batchtest todir="${test.results.dir}"> | |
375 | <fileset dir="${test.home}/java"> | |
376 | <include name="org/apache/commons/validator/routines/*Test.java" /> | |
377 | <exclude name="**/Abstract*Test.java" /> | |
378 | </fileset> | |
379 | </batchtest> | |
380 | </junit> | |
381 | </target> | |
382 | ||
383 | <!-- ========== Example Targets =========================================== --> | |
384 | ||
385 | ||
386 | <target name="prepare.example" depends="compile" | |
387 | description="Prepare example directory"> | |
388 | <mkdir dir="${build.home}/example"/> | |
389 | </target> | |
390 | ||
391 | ||
392 | <target name="compile.example" depends="prepare.example" | |
393 | description="Compile example application"> | |
394 | <javac srcdir="${example.home}" | |
395 | destdir="${build.home}/example" | |
396 | debug="${compile.debug}" | |
397 | deprecation="${compile.deprecation}" | |
398 | optimize="${compile.optimize}"> | |
399 | <classpath refid="example.classpath"/> | |
400 | </javac> | |
401 | <copy todir="${build.home}/example" filtering="on"> | |
402 | <fileset dir="${example.home}" excludes="**/*.java"/> | |
403 | </copy> | |
404 | </target> | |
405 | ||
406 | ||
407 | <target name="example" depends="compile.example,compile.tests" | |
408 | description="Run example application"> | |
409 | <java fork="yes" | |
410 | classname="org.apache.commons.validator.example.ValidateExample" | |
411 | taskname="main" failonerror="true"> | |
412 | <classpath refid="example.classpath" /> | |
413 | </java> | |
414 | </target> | |
415 | ||
416 | ||
417 | <!-- ========== Release Targets =========================================== --> | |
418 | ||
419 | ||
420 | <target name="release" depends="clean,dist" | |
421 | description="Construct release distribution"> | |
422 | <mkdir dir="${stage.bin.dir}/${upload.file.base}"/> | |
423 | <mkdir dir="${stage.src.dir}/${upload.file.base}-src"/> | |
424 | <copy todir="${stage.bin.dir}/${upload.file.base}"> | |
425 | <fileset dir="${dist.home}"/> | |
426 | </copy> | |
427 | <copy todir="${stage.src.dir}/${upload.file.base}-src"> | |
428 | <fileset dir="."> | |
429 | <exclude name="build.properties"/> | |
430 | <exclude name="${build.home}/**"/> | |
431 | <exclude name="${dist.home}/**"/> | |
432 | <exclude name="${build.home}/**"/> | |
433 | </fileset> | |
434 | </copy> | |
435 | <mkdir dir="${upload.dir}"/> | |
436 | <zip zipfile="${upload.dir}/${upload.file.base}.zip" | |
437 | basedir="${stage.bin.dir}"/> | |
438 | <zip zipfile="${upload.dir}/${upload.file.base}-src.zip" | |
439 | basedir="${stage.src.dir}"/> | |
440 | <tar tarfile="${upload.dir}/${upload.file.base}.tar" | |
441 | basedir="${stage.bin.dir}" | |
442 | longfile="gnu"/> | |
443 | <tar tarfile="${upload.dir}/${upload.file.base}-src.tar" | |
444 | basedir="${stage.src.dir}" | |
445 | longfile="gnu"/> | |
446 | <gzip src="${upload.dir}/${upload.file.base}.tar" | |
447 | zipfile="${upload.dir}/${upload.file.base}.tar.gz"/> | |
448 | <gzip src="${upload.dir}/${upload.file.base}-src.tar" | |
449 | zipfile="${upload.dir}/${upload.file.base}-src.tar.gz"/> | |
450 | </target> | |
451 | ||
452 | ||
453 | <!-- ========== Download Dependencies =========================================== --> | |
454 | ||
455 | <target name="download-dependencies" | |
456 | depends="check-availability" unless="skip.download"> | |
457 | <echo message="doing download-dependencies..." /> | |
458 | <antcall target="download-beanutils" /> | |
459 | <antcall target="download-digester" /> | |
460 | <antcall target="download-logging" /> | |
461 | <antcall target="download-collections" /> | |
462 | <antcall target="download-junit" /> | |
463 | </target> | |
464 | ||
465 | <target name="check-availability"> | |
466 | <echo message="doing check-availability..." /> | |
467 | <available file="${commons-beanutils.jar}" property="beanutils.found"/> | |
468 | <available file="${commons-digester.jar}" property="digester.found"/> | |
469 | <available file="${commons-logging.jar}" property="logging.found"/> | |
470 | <available file="${commons-collections.jar}" property="collections.found"/> | |
471 | <available file="${junit.jar}" property="junit.found"/> | |
472 | </target> | |
473 | ||
474 | <target name="download-beanutils" unless="beanutils.found"> | |
475 | <echo message="Downloading beanutils..."/> | |
476 | <mkdir dir="${download.lib.dir}" /> | |
477 | <get dest="${download.lib.dir}/commons-beanutils.jar" | |
478 | usetimestamp="true" ignoreerrors="true" | |
479 | src="http://repo.maven.apache.org/maven2/commons-beanutils/commons-beanutils/1.9.2/commons-beanutils-1.9.2.jar"/> | |
480 | </target> | |
481 | ||
482 | <target name="download-digester" unless="digester.found"> | |
483 | <echo message="Downloading digester..."/> | |
484 | <mkdir dir="${download.lib.dir}" /> | |
485 | <get dest="${download.lib.dir}/commons-digester.jar" | |
486 | usetimestamp="true" ignoreerrors="true" | |
487 | src="http://repo.maven.apache.org/maven2/commons-digester/commons-digester/1.8.1/commons-digester-1.8.1.jar"/> | |
488 | </target> | |
489 | ||
490 | <target name="download-logging" unless="logging.found"> | |
491 | <echo message="Downloading logging..."/> | |
492 | <mkdir dir="${download.lib.dir}" /> | |
493 | <get dest="${download.lib.dir}/commons-logging.jar" | |
494 | usetimestamp="true" ignoreerrors="true" | |
495 | src="http://repo.maven.apache.org/maven2/commons-logging/commons-logging/1.2/commons-logging-1.2.jar"/> | |
496 | </target> | |
497 | ||
498 | <target name="download-collections" unless="collections.found"> | |
499 | <echo message="Downloading collections..."/> | |
500 | <mkdir dir="${download.lib.dir}" /> | |
501 | <get dest="${download.lib.dir}/commons-collections.jar" | |
502 | usetimestamp="true" ignoreerrors="true" | |
503 | src="http://repo.maven.apache.org/maven2/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar"/> | |
504 | </target> | |
505 | ||
506 | <target name="download-junit" unless="junit.found"> | |
507 | <echo message="Downloading junit..."/> | |
508 | <mkdir dir="${download.lib.dir}" /> | |
509 | <get dest="${download.lib.dir}/junit.jar" | |
510 | usetimestamp="true" ignoreerrors="true" | |
511 | src="http://repo.maven.apache.org/maven2/junit/junit/3.8.1/junit-3.8.1.jar"/> | |
512 | </target> | |
513 | ||
514 | </project> | |
515 |
0 | @echo off | |
1 | ||
2 | rem * $Id: jsdoc.bat 1608569 2014-07-07 19:28:41Z britter $ | |
3 | rem * ==================================================================== | |
4 | rem * | |
5 | rem * Licensed to the Apache Software Foundation (ASF) under one or more | |
6 | rem * contributor license agreements. See the NOTICE file distributed with | |
7 | rem * this work for additional information regarding copyright ownership. | |
8 | rem * The ASF licenses this file to You under the Apache License, Version 2.0 | |
9 | rem * (the "License"); you may not use this file except in compliance with | |
10 | rem * the License. You may obtain a copy of the License at | |
11 | rem * | |
12 | rem * http://www.apache.org/licenses/LICENSE-2.0 | |
13 | rem * | |
14 | rem * Unless required by applicable law or agreed to in writing, software | |
15 | rem * distributed under the License is distributed on an "AS IS" BASIS, | |
16 | rem * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
17 | rem * See the License for the specific language governing permissions and | |
18 | rem * limitations under the License. | |
19 | ||
20 | rem *--------------------------------------------------------------* | |
21 | rem * * | |
22 | rem * JSDoc is a perl script for generating javadoc for javascript.* | |
23 | rem * * | |
24 | rem * The latest version can be downloaded from : * | |
25 | rem * * | |
26 | rem * http://sourceforge.net/projects/jsdoc/ * | |
27 | rem * * | |
28 | rem * N.B. You also need something like ActivePerl installed to * | |
29 | rem * run this on windows. See the Installation instructions: * | |
30 | rem * * | |
31 | rem * http://jsdoc.sourceforge.net/#install * | |
32 | rem * * | |
33 | rem *--------------------------------------------------------------* | |
34 | ||
35 | set _PACKAGE=/org/apache/commons/validator/javascript | |
36 | set _JSDOC_HOME=%1 | |
37 | set _JAVASCRIPT_DIR=%2%_PACKAGE% | |
38 | set _OUTPUT_DIR=%3%_PACKAGE% | |
39 | set _COPYRIGHT="Copyright © 2000-2014 - Apache Software Foundation" | |
40 | perl %_JSDOC_HOME%/jsdoc.pl --project-summary %_JAVASCRIPT_DIR%/package.html --project-name "Package %_PACKAGE%" --page-footer %_COPYRIGHT% -d %_OUTPUT_DIR% %_JAVASCRIPT_DIR% |
0 | #!/bin/sh | |
1 | # $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//validator/etc/jsdoc.sh,v 1.4 2004/05/21 14:28:12 rleland Exp $ | |
2 | # $Revision: 1608569 $ | |
3 | # $Date: 2014-07-07 21:28:41 +0200 (Mon, 07 Jul 2014) $ | |
4 | # | |
5 | # ==================================================================== | |
6 | # Licensed to the Apache Software Foundation (ASF) under one or more | |
7 | # contributor license agreements. See the NOTICE file distributed with | |
8 | # this work for additional information regarding copyright ownership. | |
9 | # The ASF licenses this file to You under the Apache License, Version 2.0 | |
10 | # (the "License"); you may not use this file except in compliance with | |
11 | # the License. You may obtain a copy of the License at | |
12 | # | |
13 | # http://www.apache.org/licenses/LICENSE-2.0 | |
14 | # | |
15 | # Unless required by applicable law or agreed to in writing, software | |
16 | # distributed under the License is distributed on an "AS IS" BASIS, | |
17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
18 | # See the License for the specific language governing permissions and | |
19 | # limitations under the License. | |
20 | # | |
21 | ||
22 | # jsdoc is a perl script for generating javadoc for javascript. | |
23 | # The latest version can be downloaded from : | |
24 | # http://sourceforge.net/projects/jsdoc/ | |
25 | # | |
26 | ||
27 | dirtoprocess=$2 | |
28 | outputto=$3 | |
29 | package=/org/apache/commons/validator/javascript | |
30 | perl $1/jsdoc.pl --project-summary ${dirtoprocess}${package}/package.html --project-name "Package org.apache.commons.validator.javascript" --page-footer "Copyright © 2000-2014 - Apache Software Foundation | |
31 | " -d ${outputto}/${package} -r $dirtoprocess |
19 | 19 | <parent> |
20 | 20 | <groupId>org.apache.commons</groupId> |
21 | 21 | <artifactId>commons-parent</artifactId> |
22 | <version>39</version> | |
22 | <version>42</version> | |
23 | 23 | </parent> |
24 | 24 | <modelVersion>4.0.0</modelVersion> |
25 | 25 | <groupId>commons-validator</groupId> |
26 | 26 | <artifactId>commons-validator</artifactId> |
27 | <version>1.5.1</version> | |
27 | <version>1.6</version> | |
28 | 28 | <name>Apache Commons Validator</name> |
29 | 29 | <description> |
30 | 30 | Apache Commons Validator provides the building blocks for both client side validation and server side data validation. |
123 | 123 | </contributors> |
124 | 124 | |
125 | 125 | <scm> |
126 | <connection>scm:svn:http://svn.apache.org/repos/asf/commons/proper/validator/tags/VALIDATOR_1_5_1</connection> | |
127 | <developerConnection>scm:svn:https://svn.apache.org/repos/asf/commons/proper/validator/tags/VALIDATOR_1_5_1</developerConnection> | |
128 | <url>http://svn.apache.org/viewvc/commons/proper/validator/tags/VALIDATOR_1_5_1</url> | |
126 | <connection>scm:svn:http://svn.apache.org/repos/asf/commons/proper/validator/tags/VALIDATOR_1_6/</connection> | |
127 | <developerConnection>scm:svn:https://svn.apache.org/repos/asf/commons/proper/validator/tags/VALIDATOR_1_6/</developerConnection> | |
128 | <url>http://svn.apache.org/viewvc/commons/proper/validator/tags/VALIDATOR_1_6/</url> | |
129 | 129 | </scm> |
130 | 130 | |
131 | 131 | <distributionManagement> |
139 | 139 | <properties> |
140 | 140 | <commons.componentid>validator</commons.componentid> |
141 | 141 | <!-- Re-generate the download page using: mvn commons:download-page --> |
142 | <commons.release.version>1.5.1</commons.release.version> | |
143 | <commons.rc.version>RC2</commons.rc.version> | |
142 | <commons.release.version>1.6</commons.release.version> | |
143 | <commons.rc.version>RC1</commons.rc.version> | |
144 | 144 | <commons.release.desc>(requires JDK ${maven.compiler.target})</commons.release.desc> |
145 | <commons.release.2.version>1.4.1</commons.release.2.version> | |
146 | <commons.release.2.desc>(requires JDK 1.4)</commons.release.2.desc> | |
147 | <commons.release.2.binary.suffix /> | |
148 | 145 | <commons.jira.id>VALIDATOR</commons.jira.id> |
149 | 146 | <commons.jira.pid>12310494</commons.jira.pid> |
150 | 147 | <commons.encoding>UTF-8</commons.encoding> |
284 | 281 | </plugin> |
285 | 282 | <plugin> |
286 | 283 | <artifactId>maven-pmd-plugin</artifactId> |
287 | <version>3.5</version> | |
284 | <version>3.7</version> | |
288 | 285 | <configuration> |
289 | 286 | <targetJdk>${maven.compiler.target}</targetJdk> |
290 | 287 | </configuration> |
300 | 297 | <plugin> |
301 | 298 | <groupId>org.codehaus.mojo</groupId> |
302 | 299 | <artifactId>findbugs-maven-plugin</artifactId> |
303 | <version>3.0.2</version> | |
300 | <version>3.0.4</version> | |
304 | 301 | <configuration> |
305 | 302 | <threshold>Normal</threshold> |
306 | 303 | <effort>Default</effort> |
63 | 63 | --> |
64 | 64 | |
65 | 65 | <body> |
66 | <release version="1.5.1" date="2016-??-??" description=" | |
66 | <release version="1.6" date="2017-02-20" description=" | |
67 | This is primarily a maintenance release. | |
68 | ||
69 | All projects are encouraged to update to this release of | |
70 | Apache Commons Validator. | |
71 | ||
72 | Commons Validator requires Java 1.6 or later. | |
73 | ||
74 | Main enhancements | |
75 | ================= | |
76 | ||
77 | * Modulus Ten Check Digit Implementation | |
78 | ||
79 | * Generic CreditCard validation (syntax and checkdigit only; does not check IIN) | |
80 | ||
81 | * CreditCard validation specification by numeric range | |
82 | ||
83 | IMPORTANT NOTES | |
84 | =============== | |
85 | ||
86 | ||
87 | BREAKING CHANGES: | |
88 | ||
89 | * NONE. | |
90 | ||
91 | ||
92 | DEPENDENCIES | |
93 | ============ | |
94 | ||
95 | The dependencies for Validator have not changed since the 1.4 release. | |
96 | ||
97 | For the current list of dependencies, please see | |
98 | http://commons.apache.org/validator/dependencies.html | |
99 | "> | |
100 | <action issue="VALIDATOR-420" type="fix" dev="sebb" due-to="Marcin Gasior"> | |
101 | Query params validator shouldn't accept whitespaces | |
102 | </action> | |
103 | <action issue="VALIDATOR-419" type="fix" dev="sebb" due-to="Denis Iskhakov"> | |
104 | Invalid IPv6 addresses that are IPv4-mapped pass InetAddressValidator validation | |
105 | </action> | |
106 | <action issue="VALIDATOR-418" type="fix" dev="britter" due-to="Robert McGuigan"> | |
107 | UrlValidatorTest: testIsValid() does not run all tests | |
108 | </action> | |
109 | <action issue="VALIDATOR-415" type="add" dev="sebb"> | |
110 | Simplify building new CreditCard validators | |
111 | </action> | |
112 | <action issue="VALIDATOR-413" type="add" dev="sebb"> | |
113 | Generic CreditCard validation | |
114 | </action> | |
115 | <action issue="VALIDATOR-379" type="fix" dev="sebb"> | |
116 | CodeValidator unconditionally trim()s the input string - document the behaviour | |
117 | </action> | |
118 | <action issue="VALIDATOR-387" type="fix" dev="sebb" due-to="Shumpei Akai"> | |
119 | Userinfo without colon should be valid in UrlValidator | |
120 | </action> | |
121 | <action issue="VALIDATOR-394" type="add" dev="sebb" due-to="Niall Pemberton"> | |
122 | General Modulus Ten Check Digit Implementation | |
123 | </action> | |
124 | <action issue="VALIDATOR-411" type="fix" dev="sebb"> | |
125 | UrlValidator accepts ports above max limit of 16-bit unsigned integer | |
126 | </action> | |
127 | <action type="update" dev="sebb"> | |
128 | IANA TLD lists: Updated to Version 2017020400, Last Updated Sat Feb 4 07:07:01 2017 UTC | |
129 | </action> | |
130 | <action type="update" dev="sebb"> | |
131 | Update to version 73 of SWIFT IBAN list: added BY (Belarus) and IQ (Iraq); fixed Santa Lucia format | |
132 | </action> | |
133 | <action issue="VALIDATOR-407" type="fix" dev="sebb"> | |
134 | Generic .shop top level domain is considered invalid | |
135 | </action> | |
136 | <action issue="VALIDATOR-405" type="fix" dev="sebb"> | |
137 | IBANValidator - Costa Rica entry has been updated in SWIFT docs | |
138 | </action> | |
139 | <action issue="VALIDATOR-401" type="fix" dev="britter"> | |
140 | IBANValidator fails for Seychelles and Ukraine | |
141 | </action> | |
142 | <action issue="VALIDATOR-391" type="fix" dev="sebb" due-to="Mark E. Scott, Jr. & Jason Loomis"> | |
143 | UrlValidator.isValid throws exception for FILEURLs | |
144 | Fixed code so it handles URLs with no authority field | |
145 | </action> | |
146 | </release> | |
147 | <release version="1.5.1" date="2016-04-30" description=" | |
67 | 148 | This is a maintenance release. |
68 | 149 | |
69 | 150 | All projects are encouraged to update to this release of |
13 | 13 | ## KIND, either express or implied. See the License for the |
14 | 14 | ## specific language governing permissions and limitations |
15 | 15 | ## under the License. |
16 | Apache ${project.name} | |
17 | Version ${version} | |
18 | RELEASE NOTES | |
16 | ## | |
17 | ${project.name} ${version} | |
18 | RELEASE NOTES | |
19 | 19 | |
20 | The ${developmentTeam} is pleased to announce the release of Apache ${project.name} ${version} | |
20 | The ${developmentTeam} is pleased to announce the release of ${project.name} ${version} | |
21 | 21 | |
22 | 22 | $introduction.replaceAll("(?<!\015)\012", " |
23 | 23 | ").replaceAll("(?m)^ +","") |
24 | 24 | |
25 | 25 | ## N.B. the available variables are described here: |
26 | 26 | ## http://maven.apache.org/plugins/maven-changes-plugin/examples/using-a-custom-announcement-template.html |
27 | ## | |
27 | 28 | ## Hack to improve layout: replace all pairs of spaces with a single new-line |
28 | 29 | $release.description.replaceAll(" ", " |
29 | 30 | ") |
43 | 44 | ## Use replaceAll to fix up LF-only line ends on Windows. |
44 | 45 | #set($action=$actionItem.getAction().replaceAll("\n"," |
45 | 46 | ")) |
47 | ## Replace < with < so can embed tag markup | |
48 | #set($action=$action.replaceAll("<","<")) | |
49 | ## use an empty date to mean don't format the entry | |
50 | ## TODO how to enable leading spaces without compromising html report | |
51 | ## unfortunately leading spaces are trimmed even from CDATA sections | |
52 | #if ($actionItem.getDate() && $actionItem.getDate().length()==0) | |
53 | $action | |
54 | #else | |
46 | 55 | ## Fix up indentation for multi-line action descriptions |
47 | 56 | #set($action=$action.replaceAll("(?m)^ +",$indent2)) |
48 | 57 | #if ($actionItem.getIssue()) |
60 | 69 | #set($dueto="") |
61 | 70 | #end |
62 | 71 | o $issue ${action}$dueto |
72 | #end | |
63 | 73 | #set($action="") |
64 | 74 | #set($issue="") |
65 | 75 | #set($dueto="") |
75 | 85 | #foreach($actionItem in $release.getActions('add')) |
76 | 86 | #processaction() |
77 | 87 | #end |
88 | ||
78 | 89 | #end |
79 | ||
90 | ## | |
80 | 91 | #if ($release.getActions('fix').size() !=0) |
81 | 92 | Fixed Bugs: |
82 | 93 | #foreach($actionItem in $release.getActions('fix')) |
83 | 94 | #processaction() |
84 | 95 | #end |
96 | ||
85 | 97 | #end |
86 | ||
98 | ## | |
87 | 99 | #if ($release.getActions('update').size() !=0) |
88 | 100 | Changes: |
89 | 101 | #foreach($actionItem in $release.getActions('update')) |
90 | 102 | #processaction() |
91 | 103 | #end |
104 | ||
92 | 105 | #end |
93 | ||
106 | ## | |
94 | 107 | #if ($release.getActions('remove').size() !=0) |
95 | 108 | Removed: |
96 | 109 | #foreach($actionItem in $release.getActions('remove')) |
100 | 113 | ## End of main loop |
101 | 114 | #end |
102 | 115 | |
116 | Historical list of changes: ${project.url}changes-report.html | |
117 | ||
103 | 118 | For complete information on ${project.name}, including instructions on how to submit bug reports, |
104 | 119 | patches, or suggestions for improvement, see the Apache ${project.name} website: |
105 | 120 | |
106 | ${project.url}⏎ | |
121 | ${project.url} |
63 | 63 | * <br> |
64 | 64 | * Or just avoid using parentheses except for the parts you want to capture |
65 | 65 | * |
66 | * @version $Revision: 1739011 $ | |
66 | * @version $Revision: 1781789 $ | |
67 | 67 | * @since Validator 1.4 |
68 | 68 | */ |
69 | 69 | public final class CodeValidator implements Serializable { |
217 | 217 | /** |
218 | 218 | * Validate the code returning either <code>true</code> |
219 | 219 | * or <code>false</code>. |
220 | * <p> | |
221 | * This calls {@link #validate(String)} and returns false | |
222 | * if the return value is null, true otherwise. | |
223 | * <p> | |
224 | * Note that {@link #validate(String)} trims the input | |
225 | * and if there is a {@link RegexValidator} it may also | |
226 | * change the input as part of the validation. | |
220 | 227 | * |
221 | 228 | * @param input The code to validate |
222 | 229 | * @return <code>true</code> if valid, otherwise |
229 | 236 | /** |
230 | 237 | * Validate the code returning either the valid code or |
231 | 238 | * <code>null</code> if invalid. |
239 | * <p> | |
240 | * Note that this method trims the input | |
241 | * and if there is a {@link RegexValidator} it may also | |
242 | * change the input as part of the validation. | |
232 | 243 | * |
233 | 244 | * @param input The code to validate |
234 | 245 | * @return The code if valid, otherwise <code>null</code> |
37 | 37 | * |
38 | 38 | * <p> |
39 | 39 | * configures the validator to only pass American Express and Visa cards. |
40 | * If a card type is not directly supported by this class, you can implement | |
41 | * the CreditCardType interface and pass an instance into the | |
42 | * <code>addAllowedCardType</code> method. | |
40 | * If a card type is not directly supported by this class, you can create an | |
41 | * instance of the {@link CodeValidator} class and pass it to a {@link CreditCardValidator} | |
42 | * constructor along with any existing validators. For example: | |
43 | 43 | * </p> |
44 | 44 | * |
45 | * <pre> | |
46 | * <code>CreditCardValidator ccv = new CreditCardValidator( | |
47 | * new CodeValidator[] { | |
48 | * CreditCardValidator.AMEX_VALIDATOR, | |
49 | * CreditCardValidator.VISA_VALIDATOR, | |
50 | * new CodeValidator("^(4)(\\d{12,18})$", LUHN_VALIDATOR) // add VPAY | |
51 | * };</code> | |
52 | * </pre> | |
53 | * | |
45 | 54 | * <p> |
46 | * For a similar implementation in Perl, reference Sean M. Burke's | |
47 | * <a href="http://www.speech.cs.cmu.edu/~sburke/pub/luhn_lib.html">script</a>. | |
55 | * Alternatively you can define a validator using the {@link CreditCardRange} class. | |
56 | * For example: | |
57 | * </p> | |
58 | * | |
59 | * <pre> | |
60 | * <code>CreditCardValidator ccv = new CreditCardValidator( | |
61 | * new CreditCardRange[]{ | |
62 | * new CreditCardRange("300", "305", 14, 14), // Diners | |
63 | * new CreditCardRange("3095", null, 14, 14), // Diners | |
64 | * new CreditCardRange("36", null, 14, 14), // Diners | |
65 | * new CreditCardRange("38", "39", 14, 14), // Diners | |
66 | * new CreditCardRange("4", null, new int[] {13, 16}), // VISA | |
67 | * } | |
68 | * ); | |
69 | * </code> | |
70 | * </pre> | |
71 | * <p> | |
72 | * This can be combined with a list of {@code CodeValidator}s | |
73 | * </p> | |
74 | * <p> | |
48 | 75 | * More information can be found in Michael Gilleland's essay |
49 | 76 | * <a href="http://web.archive.org/web/20120614072656/http://www.merriampark.com/anatomycc.htm">Anatomy of Credit Card Numbers</a>. |
50 | 77 | * </p> |
51 | 78 | * |
52 | * @version $Revision: 1739207 $ | |
79 | * @version $Revision: 1782740 $ | |
53 | 80 | * @since Validator 1.4 |
54 | 81 | */ |
55 | 82 | public class CreditCardValidator implements Serializable { |
56 | 83 | |
57 | 84 | private static final long serialVersionUID = 5955978921148959496L; |
85 | ||
86 | private static final int MIN_CC_LENGTH = 12; // minimum allowed length | |
87 | ||
88 | private static final int MAX_CC_LENGTH = 19; // maximum allowed length | |
89 | ||
90 | /** | |
91 | * Class that represents a credit card range. | |
92 | * @since 1.6 | |
93 | */ | |
94 | public static class CreditCardRange { | |
95 | final String low; // e.g. 34 or 644 | |
96 | final String high; // e.g. 34 or 65 | |
97 | final int minLen; // e.g. 16 or -1 | |
98 | final int maxLen; // e.g. 19 or -1 | |
99 | final int lengths[]; // e.g. 16,18,19 | |
100 | ||
101 | /** | |
102 | * Create a credit card range specifier for use in validation | |
103 | * of the number syntax including the IIN range. | |
104 | * <p> | |
105 | * The low and high parameters may be shorter than the length | |
106 | * of an IIN (currently 6 digits) in which case subsequent digits | |
107 | * are ignored and may range from 0-9. | |
108 | * <br> | |
109 | * The low and high parameters may be different lengths. | |
110 | * e.g. Discover "644" and "65". | |
111 | * </p> | |
112 | * @param low the low digits of the IIN range | |
113 | * @param high the high digits of the IIN range | |
114 | * @param minLen the minimum length of the entire number | |
115 | * @param maxLen the maximum length of the entire number | |
116 | */ | |
117 | public CreditCardRange(String low, String high, int minLen, int maxLen) { | |
118 | this.low = low; | |
119 | this.high = high; | |
120 | this.minLen = minLen; | |
121 | this.maxLen = maxLen; | |
122 | this.lengths = null; | |
123 | } | |
124 | ||
125 | /** | |
126 | * Create a credit card range specifier for use in validation | |
127 | * of the number syntax including the IIN range. | |
128 | * <p> | |
129 | * The low and high parameters may be shorter than the length | |
130 | * of an IIN (currently 6 digits) in which case subsequent digits | |
131 | * are ignored and may range from 0-9. | |
132 | * <br> | |
133 | * The low and high parameters may be different lengths. | |
134 | * e.g. Discover "644" and "65". | |
135 | * </p> | |
136 | * @param low the low digits of the IIN range | |
137 | * @param high the high digits of the IIN range | |
138 | * @param lengths array of valid lengths | |
139 | */ | |
140 | public CreditCardRange(String low, String high, int [] lengths) { | |
141 | this.low = low; | |
142 | this.high = high; | |
143 | this.minLen = -1; | |
144 | this.maxLen = -1; | |
145 | this.lengths = lengths.clone(); | |
146 | } | |
147 | } | |
58 | 148 | |
59 | 149 | /** |
60 | 150 | * Option specifying that no cards are allowed. This is useful if |
120 | 210 | */ |
121 | 211 | private static final CheckDigit LUHN_VALIDATOR = LuhnCheckDigit.LUHN_CHECK_DIGIT; |
122 | 212 | |
123 | /** American Express (Amex) Card Validator */ | |
213 | /** | |
214 | * American Express (Amex) Card Validator | |
215 | * <p> | |
216 | * 34xxxx (15) <br> | |
217 | * 37xxxx (15) <br> | |
218 | */ | |
124 | 219 | public static final CodeValidator AMEX_VALIDATOR = new CodeValidator("^(3[47]\\d{13})$", LUHN_VALIDATOR); |
125 | 220 | |
126 | /** Diners Card Validator */ | |
221 | /** | |
222 | * Diners Card Validator | |
223 | * <p> | |
224 | * 300xxx - 305xxx (14) <br> | |
225 | * 3095xx (14) <br> | |
226 | * 36xxxx (14) <br> | |
227 | * 38xxxx (14) <br> | |
228 | * 39xxxx (14) <br> | |
229 | */ | |
127 | 230 | public static final CodeValidator DINERS_VALIDATOR = new CodeValidator("^(30[0-5]\\d{11}|3095\\d{10}|36\\d{12}|3[8-9]\\d{12})$", LUHN_VALIDATOR); |
128 | 231 | |
129 | /** Discover Card regular expressions */ | |
232 | /** | |
233 | * Discover Card regular expressions | |
234 | * <p> | |
235 | * 6011xx (16) <br> | |
236 | * 644xxx - 65xxxx (16) <br> | |
237 | */ | |
130 | 238 | private static final RegexValidator DISCOVER_REGEX = new RegexValidator(new String[] {"^(6011\\d{12})$", "^(64[4-9]\\d{13})$", "^(65\\d{14})$"}); |
131 | 239 | |
132 | 240 | /** Discover Card Validator */ |
133 | 241 | public static final CodeValidator DISCOVER_VALIDATOR = new CodeValidator(DISCOVER_REGEX, LUHN_VALIDATOR); |
134 | 242 | |
135 | /** Mastercard regular expressions */ | |
243 | /** | |
244 | * Mastercard regular expressions | |
245 | * <p> | |
246 | * 2221xx - 2720xx (16) <br> | |
247 | * 51xxx - 55xxx (16) <br> | |
248 | */ | |
136 | 249 | private static final RegexValidator MASTERCARD_REGEX = new RegexValidator( |
137 | 250 | new String[] { |
138 | 251 | "^(5[1-5]\\d{14})$", // 51 - 55 (pre Oct 2016) |
155 | 268 | @Deprecated |
156 | 269 | public static final CodeValidator MASTERCARD_VALIDATOR_PRE_OCT2016 = new CodeValidator("^(5[1-5]\\d{14})$", LUHN_VALIDATOR); |
157 | 270 | |
158 | /** Visa Card Validator */ | |
271 | /** | |
272 | * Visa Card Validator | |
273 | * <p> | |
274 | * 4xxxxx (13 or 16) | |
275 | */ | |
159 | 276 | public static final CodeValidator VISA_VALIDATOR = new CodeValidator("^(4)(\\d{12}|\\d{15})$", LUHN_VALIDATOR); |
160 | 277 | |
161 | /** VPay (Visa) Card Validator | |
278 | /** VPay (Visa) Card Validator | |
279 | * <p> | |
280 | * 4xxxxx (13-19) | |
162 | 281 | * @since 1.5.0 |
163 | 282 | */ |
164 | 283 | public static final CodeValidator VPAY_VALIDATOR = new CodeValidator("^(4)(\\d{12,18})$", LUHN_VALIDATOR); |
219 | 338 | throw new IllegalArgumentException("Card validators are missing"); |
220 | 339 | } |
221 | 340 | Collections.addAll(cardTypes, creditCardValidators); |
341 | } | |
342 | ||
343 | /** | |
344 | * Create a new CreditCardValidator with the specified {@link CreditCardRange}s. | |
345 | * @param creditCardRanges Set of valid code validators | |
346 | * @since 1.6 | |
347 | */ | |
348 | public CreditCardValidator(CreditCardRange[] creditCardRanges) { | |
349 | if (creditCardRanges == null) { | |
350 | throw new IllegalArgumentException("Card ranges are missing"); | |
351 | } | |
352 | Collections.addAll(cardTypes, createRangeValidator(creditCardRanges, LUHN_VALIDATOR)); | |
353 | } | |
354 | ||
355 | /** | |
356 | * Create a new CreditCardValidator with the specified {@link CodeValidator}s | |
357 | * and {@link CreditCardRange}s. | |
358 | * <p> | |
359 | * This can be used to combine predefined validators such as {@link #MASTERCARD_VALIDATOR} | |
360 | * with additional validators using the simpler {@link CreditCardRange}s. | |
361 | * @param creditCardValidators Set of valid code validators | |
362 | * @param creditCardRanges Set of valid code validators | |
363 | * @since 1.6 | |
364 | */ | |
365 | public CreditCardValidator(CodeValidator[] creditCardValidators, CreditCardRange[] creditCardRanges) { | |
366 | if (creditCardValidators == null) { | |
367 | throw new IllegalArgumentException("Card validators are missing"); | |
368 | } | |
369 | if (creditCardRanges == null) { | |
370 | throw new IllegalArgumentException("Card ranges are missing"); | |
371 | } | |
372 | Collections.addAll(cardTypes, creditCardValidators); | |
373 | Collections.addAll(cardTypes, createRangeValidator(creditCardRanges, LUHN_VALIDATOR)); | |
374 | } | |
375 | ||
376 | /** | |
377 | * Create a new generic CreditCardValidator which validates the syntax and check digit only. | |
378 | * Does not check the Issuer Identification Number (IIN) | |
379 | * | |
380 | * @param minLen minimum allowed length | |
381 | * @param maxLen maximum allowed length | |
382 | * @return the validator | |
383 | * @since 1.6 | |
384 | */ | |
385 | public static CreditCardValidator genericCreditCardValidator(int minLen, int maxLen) { | |
386 | return new CreditCardValidator(new CodeValidator[] {new CodeValidator("(\\d+)", minLen, maxLen, LUHN_VALIDATOR)}); | |
387 | } | |
388 | ||
389 | /** | |
390 | * Create a new generic CreditCardValidator which validates the syntax and check digit only. | |
391 | * Does not check the Issuer Identification Number (IIN) | |
392 | * | |
393 | * @param length exact length | |
394 | * @return the validator | |
395 | * @since 1.6 | |
396 | */ | |
397 | public static CreditCardValidator genericCreditCardValidator(int length) { | |
398 | return genericCreditCardValidator(length, length); | |
399 | } | |
400 | ||
401 | /** | |
402 | * Create a new generic CreditCardValidator which validates the syntax and check digit only. | |
403 | * Does not check the Issuer Identification Number (IIN) | |
404 | * | |
405 | * @return the validator | |
406 | * @since 1.6 | |
407 | */ | |
408 | public static CreditCardValidator genericCreditCardValidator() { | |
409 | return genericCreditCardValidator(MIN_CC_LENGTH, MAX_CC_LENGTH); | |
222 | 410 | } |
223 | 411 | |
224 | 412 | /** |
258 | 446 | return null; |
259 | 447 | |
260 | 448 | } |
449 | ||
450 | // package protected for unit test access | |
451 | static boolean validLength(int valueLength, CreditCardRange range) { | |
452 | if (range.lengths != null) { | |
453 | for(int length : range.lengths) { | |
454 | if (valueLength == length) { | |
455 | return true; | |
456 | } | |
457 | } | |
458 | return false; | |
459 | } | |
460 | return valueLength >= range.minLen && valueLength <= range.maxLen; | |
461 | } | |
462 | ||
463 | // package protected for unit test access | |
464 | static CodeValidator createRangeValidator(final CreditCardRange[] creditCardRanges, final CheckDigit digitCheck ) { | |
465 | return new CodeValidator( | |
466 | // must be numeric (rest of validation is done later) | |
467 | new RegexValidator("(\\d+)") { | |
468 | private static final long serialVersionUID = 1L; | |
469 | private CreditCardRange[] ccr = creditCardRanges.clone(); | |
470 | @Override | |
471 | // must return full string | |
472 | public String validate(String value) { | |
473 | if (super.match(value) != null) { | |
474 | int length = value.length(); | |
475 | for(CreditCardRange range : ccr) { | |
476 | if (validLength(length, range)) { | |
477 | if (range.high == null) { // single prefix only | |
478 | if (value.startsWith(range.low)) { | |
479 | return value; | |
480 | } | |
481 | } else if (range.low.compareTo(value) <= 0 // no need to trim value here | |
482 | && | |
483 | // here we have to ignore digits beyond the prefix | |
484 | range.high.compareTo(value.substring(0, range.high.length())) >= 0) { | |
485 | return value; | |
486 | } | |
487 | } | |
488 | } | |
489 | } | |
490 | return null; | |
491 | } | |
492 | @Override | |
493 | public boolean isValid(String value) { | |
494 | return validate(value) != null; | |
495 | } | |
496 | @Override | |
497 | public String[] match(String value) { | |
498 | return new String[]{validate(value)}; | |
499 | } | |
500 | }, digitCheck); | |
501 | } | |
502 | ||
261 | 503 | /** |
262 | 504 | * Tests whether the given flag is on. If the flag is not a power of 2 |
263 | 505 | * (ie. 3) this tests whether the combination of flags is on. |
57 | 57 | * {@link java.net.InetAddress} for that functionality.) |
58 | 58 | * </p> |
59 | 59 | * |
60 | * @version $Revision: 1740822 $ | |
60 | * @version $Revision: 1781829 $ | |
61 | 61 | * @since Validator 1.4 |
62 | 62 | */ |
63 | 63 | public class DomainValidator implements Serializable { |
282 | 282 | |
283 | 283 | // WARNING: this array MUST be sorted, otherwise it cannot be searched reliably using binary search |
284 | 284 | private static final String[] GENERIC_TLDS = new String[] { |
285 | // Taken from Version 2016042500, Last Updated Mon Apr 25 07:07:01 2016 UTC | |
285 | // Taken from Version 2017020400, Last Updated Sat Feb 4 07:07:01 2017 UTC | |
286 | 286 | "aaa", // aaa American Automobile Association, Inc. |
287 | 287 | "aarp", // aarp AARP |
288 | "abarth", // abarth Fiat Chrysler Automobiles N.V. | |
288 | 289 | "abb", // abb ABB Ltd |
289 | 290 | "abbott", // abbott Abbott Laboratories, Inc. |
290 | 291 | "abbvie", // abbvie AbbVie Inc. |
292 | "abc", // abc Disney Enterprises, Inc. | |
293 | "able", // able Able Inc. | |
291 | 294 | "abogado", // abogado Top Level Domain Holdings Limited |
292 | 295 | "abudhabi", // abudhabi Abu Dhabi Systems and Information Centre |
293 | 296 | "academy", // academy Half Oaks, LLC |
302 | 305 | "adult", // adult ICM Registry AD LLC |
303 | 306 | "aeg", // aeg Aktiebolaget Electrolux |
304 | 307 | "aero", // aero Societe Internationale de Telecommunications Aeronautique (SITA INC USA) |
308 | "aetna", // aetna Aetna Life Insurance Company | |
309 | "afamilycompany", // afamilycompany Johnson Shareholdings, Inc. | |
305 | 310 | "afl", // afl Australian Football League |
306 | 311 | "agakhan", // agakhan Fondation Aga Khan (Aga Khan Foundation) |
307 | 312 | "agency", // agency Steel Falls, LLC |
308 | 313 | "aig", // aig American International Group, Inc. |
314 | "aigo", // aigo aigo Digital Technology Co,Ltd. | |
315 | "airbus", // airbus Airbus S.A.S. | |
309 | 316 | "airforce", // airforce United TLD Holdco Ltd. |
310 | 317 | "airtel", // airtel Bharti Airtel Limited |
311 | 318 | "akdn", // akdn Fondation Aga Khan (Aga Khan Foundation) |
319 | "alfaromeo", // alfaromeo Fiat Chrysler Automobiles N.V. | |
312 | 320 | "alibaba", // alibaba Alibaba Group Holding Limited |
313 | 321 | "alipay", // alipay Alibaba Group Holding Limited |
314 | 322 | "allfinanz", // allfinanz Allfinanz Deutsche Vermögensberatung Aktiengesellschaft |
323 | "allstate", // allstate Allstate Fire and Casualty Insurance Company | |
315 | 324 | "ally", // ally Ally Financial Inc. |
316 | 325 | "alsace", // alsace REGION D ALSACE |
326 | "alstom", // alstom ALSTOM | |
327 | "americanexpress", // americanexpress American Express Travel Related Services Company, Inc. | |
328 | "americanfamily", // americanfamily AmFam, Inc. | |
329 | "amex", // amex American Express Travel Related Services Company, Inc. | |
330 | "amfam", // amfam AmFam, Inc. | |
317 | 331 | "amica", // amica Amica Mutual Insurance Company |
318 | 332 | "amsterdam", // amsterdam Gemeente Amsterdam |
319 | 333 | "analytics", // analytics Campus IP LLC |
320 | 334 | "android", // android Charleston Road Registry Inc. |
321 | 335 | "anquan", // anquan QIHOO 360 TECHNOLOGY CO. LTD. |
336 | "anz", // anz Australia and New Zealand Banking Group Limited | |
337 | "aol", // aol AOL Inc. | |
322 | 338 | "apartments", // apartments June Maple, LLC |
323 | 339 | "app", // app Charleston Road Registry Inc. |
324 | 340 | "apple", // apple Apple Inc. |
326 | 342 | "aramco", // aramco Aramco Services Company |
327 | 343 | "archi", // archi STARTING DOT LIMITED |
328 | 344 | "army", // army United TLD Holdco Ltd. |
345 | "art", // art UK Creative Ideas Limited | |
329 | 346 | "arte", // arte Association Relative à la Télévision Européenne G.E.I.E. |
347 | "asda", // asda Wal-Mart Stores, Inc. | |
330 | 348 | "asia", // asia DotAsia Organisation Ltd. |
331 | 349 | "associates", // associates Baxter Hill, LLC |
350 | "athleta", // athleta The Gap, Inc. | |
332 | 351 | "attorney", // attorney United TLD Holdco, Ltd |
333 | 352 | "auction", // auction United TLD HoldCo, Ltd. |
334 | 353 | "audi", // audi AUDI Aktiengesellschaft |
354 | "audible", // audible Amazon Registry Services, Inc. | |
335 | 355 | "audio", // audio Uniregistry, Corp. |
356 | "auspost", // auspost Australian Postal Corporation | |
336 | 357 | "author", // author Amazon Registry Services, Inc. |
337 | 358 | "auto", // auto Uniregistry, Corp. |
338 | 359 | "autos", // autos DERAutos, LLC |
342 | 363 | "azure", // azure Microsoft Corporation |
343 | 364 | "baby", // baby Johnson & Johnson Services, Inc. |
344 | 365 | "baidu", // baidu Baidu, Inc. |
366 | "banamex", // banamex Citigroup Inc. | |
367 | "bananarepublic", // bananarepublic The Gap, Inc. | |
345 | 368 | "band", // band United TLD Holdco, Ltd |
346 | 369 | "bank", // bank fTLD Registry Services, LLC |
347 | 370 | "bar", // bar Punto 2012 Sociedad Anonima Promotora de Inversion de Capital Variable |
350 | 373 | "barclays", // barclays Barclays Bank PLC |
351 | 374 | "barefoot", // barefoot Gallo Vineyards, Inc. |
352 | 375 | "bargains", // bargains Half Hallow, LLC |
376 | "baseball", // baseball MLB Advanced Media DH, LLC | |
377 | "basketball", // basketball Fédération Internationale de Basketball (FIBA) | |
353 | 378 | "bauhaus", // bauhaus Werkhaus GmbH |
354 | 379 | "bayern", // bayern Bayern Connect GmbH |
355 | 380 | "bbc", // bbc British Broadcasting Corporation |
381 | "bbt", // bbt BB&T Corporation | |
356 | 382 | "bbva", // bbva BANCO BILBAO VIZCAYA ARGENTARIA, S.A. |
357 | 383 | "bcg", // bcg The Boston Consulting Group, Inc. |
358 | 384 | "bcn", // bcn Municipi de Barcelona |
359 | 385 | "beats", // beats Beats Electronics, LLC |
386 | "beauty", // beauty L'Oréal | |
360 | 387 | "beer", // beer Top Level Domain Holdings Limited |
361 | 388 | "bentley", // bentley Bentley Motors Limited |
362 | 389 | "berlin", // berlin dotBERLIN GmbH & Co. KG |
363 | 390 | "best", // best BestTLD Pty Ltd |
391 | "bestbuy", // bestbuy BBY Solutions, Inc. | |
364 | 392 | "bet", // bet Afilias plc |
365 | 393 | "bharti", // bharti Bharti Enterprises (Holding) Private Limited |
366 | 394 | "bible", // bible American Bible Society |
372 | 400 | "biz", // biz Neustar, Inc. |
373 | 401 | "black", // black Afilias Limited |
374 | 402 | "blackfriday", // blackfriday Uniregistry, Corp. |
403 | "blanco", // blanco BLANCO GmbH + Co KG | |
404 | "blockbuster", // blockbuster Dish DBS Corporation | |
405 | "blog", // blog Knock Knock WHOIS There, LLC | |
375 | 406 | "bloomberg", // bloomberg Bloomberg IP Holdings LLC |
376 | 407 | "blue", // blue Afilias Limited |
377 | 408 | "bms", // bms Bristol-Myers Squibb Company |
380 | 411 | "bnpparibas", // bnpparibas BNP Paribas |
381 | 412 | "boats", // boats DERBoats, LLC |
382 | 413 | "boehringer", // boehringer Boehringer Ingelheim International GmbH |
414 | "bofa", // bofa NMS Services, Inc. | |
383 | 415 | "bom", // bom Núcleo de Informação e Coordenação do Ponto BR - NIC.br |
384 | 416 | "bond", // bond Bond University Limited |
385 | 417 | "boo", // boo Charleston Road Registry Inc. |
386 | 418 | "book", // book Amazon Registry Services, Inc. |
419 | "booking", // booking Booking.com B.V. | |
387 | 420 | "boots", // boots THE BOOTS COMPANY PLC |
388 | 421 | "bosch", // bosch Robert Bosch GMBH |
389 | 422 | "bostik", // bostik Bostik SA |
423 | "boston", // boston Boston TLD Management, LLC | |
390 | 424 | "bot", // bot Amazon Registry Services, Inc. |
391 | 425 | "boutique", // boutique Over Galley, LLC |
426 | "box", // box NS1 Limited | |
392 | 427 | "bradesco", // bradesco Banco Bradesco S.A. |
393 | 428 | "bridgestone", // bridgestone Bridgestone Corporation |
394 | 429 | "broadway", // broadway Celebrate Broadway, Inc. |
407 | 442 | "cafe", // cafe Pioneer Canyon, LLC |
408 | 443 | "cal", // cal Charleston Road Registry Inc. |
409 | 444 | "call", // call Amazon Registry Services, Inc. |
445 | "calvinklein", // calvinklein PVH gTLD Holdings LLC | |
446 | "cam", // cam AC Webconnecting Holding B.V. | |
410 | 447 | "camera", // camera Atomic Maple, LLC |
411 | 448 | "camp", // camp Delta Dynamite, LLC |
412 | 449 | "cancerresearch", // cancerresearch Australian Cancer Research Foundation |
413 | 450 | "canon", // canon Canon Inc. |
414 | 451 | "capetown", // capetown ZA Central Registry NPC trading as ZA Central Registry |
415 | 452 | "capital", // capital Delta Mill, LLC |
453 | "capitalone", // capitalone Capital One Financial Corporation | |
416 | 454 | "car", // car Cars Registry Limited |
417 | 455 | "caravan", // caravan Caravan International, Inc. |
418 | 456 | "cards", // cards Foggy Hollow, LLC |
422 | 460 | "cars", // cars Uniregistry, Corp. |
423 | 461 | "cartier", // cartier Richemont DNS Inc. |
424 | 462 | "casa", // casa Top Level Domain Holdings Limited |
463 | "case", // case CNH Industrial N.V. | |
464 | "caseih", // caseih CNH Industrial N.V. | |
425 | 465 | "cash", // cash Delta Lake, LLC |
426 | 466 | "casino", // casino Binky Sky, LLC |
427 | 467 | "cat", // cat Fundacio puntCAT |
428 | 468 | "catering", // catering New Falls. LLC |
469 | "catholic", // catholic Pontificium Consilium de Comunicationibus Socialibus (PCCS) (Pontifical Council for Social Communication) | |
429 | 470 | "cba", // cba COMMONWEALTH BANK OF AUSTRALIA |
430 | 471 | "cbn", // cbn The Christian Broadcasting Network, Inc. |
472 | "cbre", // cbre CBRE, Inc. | |
473 | "cbs", // cbs CBS Domains Inc. | |
431 | 474 | "ceb", // ceb The Corporate Executive Board Company |
432 | 475 | "center", // center Tin Mill, LLC |
433 | 476 | "ceo", // ceo CEOTLD Pty Ltd |
439 | 482 | "chase", // chase JPMorgan Chase & Co. |
440 | 483 | "chat", // chat Sand Fields, LLC |
441 | 484 | "cheap", // cheap Sand Cover, LLC |
485 | "chintai", // chintai CHINTAI Corporation | |
442 | 486 | "chloe", // chloe Richemont DNS Inc. |
443 | 487 | "christmas", // christmas Uniregistry, Corp. |
444 | 488 | "chrome", // chrome Charleston Road Registry Inc. |
489 | "chrysler", // chrysler FCA US LLC. | |
445 | 490 | "church", // church Holly Fileds, LLC |
446 | 491 | "cipriani", // cipriani Hotel Cipriani Srl |
447 | 492 | "circle", // circle Amazon Registry Services, Inc. |
448 | 493 | "cisco", // cisco Cisco Technology, Inc. |
494 | "citadel", // citadel Citadel Domain LLC | |
495 | "citi", // citi Citigroup Inc. | |
449 | 496 | "citic", // citic CITIC Group Corporation |
450 | 497 | "city", // city Snow Sky, LLC |
451 | 498 | "cityeats", // cityeats Lifestyle Domain Holdings, Inc. |
464 | 511 | "college", // college XYZ.COM LLC |
465 | 512 | "cologne", // cologne NetCologne Gesellschaft für Telekommunikation mbH |
466 | 513 | "com", // com VeriSign Global Registry Services |
514 | "comcast", // comcast Comcast IP Holdings I, LLC | |
467 | 515 | "commbank", // commbank COMMONWEALTH BANK OF AUSTRALIA |
468 | 516 | "community", // community Fox Orchard, LLC |
469 | 517 | "company", // company Silver Avenue, LLC |
476 | 524 | "contact", // contact Top Level Spectrum, Inc. |
477 | 525 | "contractors", // contractors Magic Woods, LLC |
478 | 526 | "cooking", // cooking Top Level Domain Holdings Limited |
527 | "cookingchannel", // cookingchannel Lifestyle Domain Holdings, Inc. | |
479 | 528 | "cool", // cool Koko Lake, LLC |
480 | 529 | "coop", // coop DotCooperation LLC |
481 | 530 | "corsica", // corsica Collectivité Territoriale de Corse |
489 | 538 | "cricket", // cricket dot Cricket Limited |
490 | 539 | "crown", // crown Crown Equipment Corporation |
491 | 540 | "crs", // crs Federated Co-operatives Limited |
541 | "cruise", // cruise Viking River Cruises (Bermuda) Ltd. | |
492 | 542 | "cruises", // cruises Spring Way, LLC |
493 | 543 | "csc", // csc Alliance-One Services, Inc. |
494 | 544 | "cuisinella", // cuisinella SALM S.A.S. |
497 | 547 | "dabur", // dabur Dabur India Limited |
498 | 548 | "dad", // dad Charleston Road Registry Inc. |
499 | 549 | "dance", // dance United TLD Holdco Ltd. |
550 | "data", // data Dish DBS Corporation | |
500 | 551 | "date", // date dot Date Limited |
501 | 552 | "dating", // dating Pine Fest, LLC |
502 | 553 | "datsun", // datsun NISSAN MOTOR CO., LTD. |
503 | 554 | "day", // day Charleston Road Registry Inc. |
504 | 555 | "dclk", // dclk Charleston Road Registry Inc. |
556 | "dds", // dds Minds + Machines Group Limited | |
557 | "deal", // deal Amazon Registry Services, Inc. | |
505 | 558 | "dealer", // dealer Dealer Dot Com, Inc. |
506 | 559 | "deals", // deals Sand Sunset, LLC |
507 | 560 | "degree", // degree United TLD Holdco, Ltd |
515 | 568 | "desi", // desi Desi Networks LLC |
516 | 569 | "design", // design Top Level Design, LLC |
517 | 570 | "dev", // dev Charleston Road Registry Inc. |
571 | "dhl", // dhl Deutsche Post AG | |
518 | 572 | "diamonds", // diamonds John Edge, LLC |
519 | 573 | "diet", // diet Uniregistry, Corp. |
520 | 574 | "digital", // digital Dash Park, LLC |
521 | 575 | "direct", // direct Half Trail, LLC |
522 | 576 | "directory", // directory Extra Madison, LLC |
523 | 577 | "discount", // discount Holly Hill, LLC |
578 | "discover", // discover Discover Financial Services | |
579 | "dish", // dish Dish DBS Corporation | |
580 | "diy", // diy Lifestyle Domain Holdings, Inc. | |
524 | 581 | "dnp", // dnp Dai Nippon Printing Co., Ltd. |
525 | 582 | "docs", // docs Charleston Road Registry Inc. |
583 | "doctor", // doctor Brice Trail, LLC | |
584 | "dodge", // dodge FCA US LLC. | |
526 | 585 | "dog", // dog Koko Mill, LLC |
527 | 586 | "doha", // doha Communications Regulatory Authority (CRA) |
528 | 587 | "domains", // domains Sugar Cross, LLC |
529 | // "doosan", // doosan Doosan Corporation (retired) | |
588 | // "doosan", // doosan Doosan Corporation (retired) | |
589 | "dot", // dot Dish DBS Corporation | |
530 | 590 | "download", // download dot Support Limited |
531 | 591 | "drive", // drive Charleston Road Registry Inc. |
592 | "dtv", // dtv Dish DBS Corporation | |
532 | 593 | "dubai", // dubai Dubai Smart Government Department |
594 | "duck", // duck Johnson Shareholdings, Inc. | |
595 | "dunlop", // dunlop The Goodyear Tire & Rubber Company | |
596 | "duns", // duns The Dun & Bradstreet Corporation | |
597 | "dupont", // dupont E. I. du Pont de Nemours and Company | |
533 | 598 | "durban", // durban ZA Central Registry NPC trading as ZA Central Registry |
534 | 599 | "dvag", // dvag Deutsche Vermögensberatung Aktiengesellschaft DVAG |
600 | "dvr", // dvr Hughes Satellite Systems Corporation | |
535 | 601 | "earth", // earth Interlink Co., Ltd. |
536 | 602 | "eat", // eat Charleston Road Registry Inc. |
603 | "eco", // eco Big Room Inc. | |
537 | 604 | "edeka", // edeka EDEKA Verband kaufmännischer Genossenschaften e.V. |
538 | 605 | "edu", // edu EDUCAUSE |
539 | 606 | "education", // education Brice Way, LLC |
543 | 610 | "engineer", // engineer United TLD Holdco Ltd. |
544 | 611 | "engineering", // engineering Romeo Canyon |
545 | 612 | "enterprises", // enterprises Snow Oaks, LLC |
613 | "epost", // epost Deutsche Post AG | |
546 | 614 | "epson", // epson Seiko Epson Corporation |
547 | 615 | "equipment", // equipment Corn Station, LLC |
616 | "ericsson", // ericsson Telefonaktiebolaget L M Ericsson | |
548 | 617 | "erni", // erni ERNI Group Holding AG |
549 | 618 | "esq", // esq Charleston Road Registry Inc. |
550 | 619 | "estate", // estate Trixy Park, LLC |
620 | "esurance", // esurance Esurance Insurance Company | |
551 | 621 | "eurovision", // eurovision European Broadcasting Union (EBU) |
552 | 622 | "eus", // eus Puntueus Fundazioa |
553 | 623 | "events", // events Pioneer Maple, LLC |
565 | 635 | "fan", // fan Asiamix Digital Ltd |
566 | 636 | "fans", // fans Asiamix Digital Limited |
567 | 637 | "farm", // farm Just Maple, LLC |
638 | "farmers", // farmers Farmers Insurance Exchange | |
568 | 639 | "fashion", // fashion Top Level Domain Holdings Limited |
569 | 640 | "fast", // fast Amazon Registry Services, Inc. |
641 | "fedex", // fedex Federal Express Corporation | |
570 | 642 | "feedback", // feedback Top Level Spectrum, Inc. |
643 | "ferrari", // ferrari Fiat Chrysler Automobiles N.V. | |
571 | 644 | "ferrero", // ferrero Ferrero Trading Lux S.A. |
645 | "fiat", // fiat Fiat Chrysler Automobiles N.V. | |
646 | "fidelity", // fidelity Fidelity Brokerage Services LLC | |
647 | "fido", // fido Rogers Communications Canada Inc. | |
572 | 648 | "film", // film Motion Picture Domain Registry Pty Ltd |
573 | 649 | "final", // final Núcleo de Informação e Coordenação do Ponto BR - NIC.br |
574 | 650 | "finance", // finance Cotton Cypress, LLC |
575 | 651 | "financial", // financial Just Cover, LLC |
652 | "fire", // fire Amazon Registry Services, Inc. | |
576 | 653 | "firestone", // firestone Bridgestone Corporation |
577 | 654 | "firmdale", // firmdale Firmdale Holdings Limited |
578 | 655 | "fish", // fish Fox Woods, LLC |
581 | 658 | "fitness", // fitness Brice Orchard, LLC |
582 | 659 | "flickr", // flickr Yahoo! Domain Services Inc. |
583 | 660 | "flights", // flights Fox Station, LLC |
661 | "flir", // flir FLIR Systems, Inc. | |
584 | 662 | "florist", // florist Half Cypress, LLC |
585 | 663 | "flowers", // flowers Uniregistry, Corp. |
586 | "flsmidth", // flsmidth FLSmidth A/S | |
664 | // "flsmidth", // flsmidth FLSmidth A/S retired 2016-07-22 | |
587 | 665 | "fly", // fly Charleston Road Registry Inc. |
588 | 666 | "foo", // foo Charleston Road Registry Inc. |
667 | "food", // food Lifestyle Domain Holdings, Inc. | |
668 | "foodnetwork", // foodnetwork Lifestyle Domain Holdings, Inc. | |
589 | 669 | "football", // football Foggy Farms, LLC |
590 | 670 | "ford", // ford Ford Motor Company |
591 | 671 | "forex", // forex DOTFOREX REGISTRY LTD |
593 | 673 | "forum", // forum Fegistry, LLC |
594 | 674 | "foundation", // foundation John Dale, LLC |
595 | 675 | "fox", // fox FOX Registry, LLC |
676 | "free", // free Amazon Registry Services, Inc. | |
596 | 677 | "fresenius", // fresenius Fresenius Immobilien-Verwaltungs-GmbH |
597 | 678 | "frl", // frl FRLregistry B.V. |
598 | 679 | "frogans", // frogans OP3FT |
680 | "frontdoor", // frontdoor Lifestyle Domain Holdings, Inc. | |
599 | 681 | "frontier", // frontier Frontier Communications Corporation |
600 | 682 | "ftr", // ftr Frontier Communications Corporation |
683 | "fujitsu", // fujitsu Fujitsu Limited | |
684 | "fujixerox", // fujixerox Xerox DNHC LLC | |
685 | "fun", // fun DotSpace, Inc. | |
601 | 686 | "fund", // fund John Castle, LLC |
602 | 687 | "furniture", // furniture Lone Fields, LLC |
603 | 688 | "futbol", // futbol United TLD Holdco, Ltd. |
607 | 692 | "gallo", // gallo Gallo Vineyards, Inc. |
608 | 693 | "gallup", // gallup Gallup, Inc. |
609 | 694 | "game", // game Uniregistry, Corp. |
695 | "games", // games United TLD Holdco Ltd. | |
696 | "gap", // gap The Gap, Inc. | |
610 | 697 | "garden", // garden Top Level Domain Holdings Limited |
611 | 698 | "gbiz", // gbiz Charleston Road Registry Inc. |
612 | 699 | "gdn", // gdn Joint Stock Company "Navigation-information systems" |
613 | 700 | "gea", // gea GEA Group Aktiengesellschaft |
614 | 701 | "gent", // gent COMBELL GROUP NV/SA |
615 | 702 | "genting", // genting Resorts World Inc. Pte. Ltd. |
703 | "george", // george Wal-Mart Stores, Inc. | |
616 | 704 | "ggee", // ggee GMO Internet, Inc. |
617 | 705 | "gift", // gift Uniregistry, Corp. |
618 | 706 | "gifts", // gifts Goose Sky, LLC |
619 | 707 | "gives", // gives United TLD Holdco Ltd. |
620 | 708 | "giving", // giving Giving Limited |
709 | "glade", // glade Johnson Shareholdings, Inc. | |
621 | 710 | "glass", // glass Black Cover, LLC |
622 | 711 | "gle", // gle Charleston Road Registry Inc. |
623 | 712 | "global", // global Dot Global Domain Registry Limited |
626 | 715 | "gmbh", // gmbh Extra Dynamite, LLC |
627 | 716 | "gmo", // gmo GMO Internet, Inc. |
628 | 717 | "gmx", // gmx 1&1 Mail & Media GmbH |
718 | "godaddy", // godaddy Go Daddy East, LLC | |
629 | 719 | "gold", // gold June Edge, LLC |
630 | 720 | "goldpoint", // goldpoint YODOBASHI CAMERA CO.,LTD. |
631 | 721 | "golf", // golf Lone Falls, LLC |
632 | 722 | "goo", // goo NTT Resonant Inc. |
723 | "goodhands", // goodhands Allstate Fire and Casualty Insurance Company | |
724 | "goodyear", // goodyear The Goodyear Tire & Rubber Company | |
633 | 725 | "goog", // goog Charleston Road Registry Inc. |
634 | 726 | "google", // google Charleston Road Registry Inc. |
635 | 727 | "gop", // gop Republican State Leadership Committee, Inc. |
641 | 733 | "green", // green Afilias Limited |
642 | 734 | "gripe", // gripe Corn Sunset, LLC |
643 | 735 | "group", // group Romeo Town, LLC |
736 | "guardian", // guardian The Guardian Life Insurance Company of America | |
644 | 737 | "gucci", // gucci Guccio Gucci S.p.a. |
645 | 738 | "guge", // guge Charleston Road Registry Inc. |
646 | 739 | "guide", // guide Snow Moon, LLC |
647 | 740 | "guitars", // guitars Uniregistry, Corp. |
648 | 741 | "guru", // guru Pioneer Cypress, LLC |
742 | "hair", // hair L'Oreal | |
649 | 743 | "hamburg", // hamburg Hamburg Top-Level-Domain GmbH |
650 | 744 | "hangout", // hangout Charleston Road Registry Inc. |
651 | 745 | "haus", // haus United TLD Holdco, LTD. |
746 | "hbo", // hbo HBO Registry Services, Inc. | |
747 | "hdfc", // hdfc HOUSING DEVELOPMENT FINANCE CORPORATION LIMITED | |
652 | 748 | "hdfcbank", // hdfcbank HDFC Bank Limited |
653 | 749 | "health", // health DotHealth, LLC |
654 | 750 | "healthcare", // healthcare Silver Glen, LLC |
656 | 752 | "helsinki", // helsinki City of Helsinki |
657 | 753 | "here", // here Charleston Road Registry Inc. |
658 | 754 | "hermes", // hermes Hermes International |
755 | "hgtv", // hgtv Lifestyle Domain Holdings, Inc. | |
659 | 756 | "hiphop", // hiphop Uniregistry, Corp. |
757 | "hisamitsu", // hisamitsu Hisamitsu Pharmaceutical Co.,Inc. | |
660 | 758 | "hitachi", // hitachi Hitachi, Ltd. |
661 | 759 | "hiv", // hiv dotHIV gemeinnuetziger e.V. |
760 | "hkt", // hkt PCCW-HKT DataCom Services Limited | |
662 | 761 | "hockey", // hockey Half Willow, LLC |
663 | 762 | "holdings", // holdings John Madison, LLC |
664 | 763 | "holiday", // holiday Goose Woods, LLC |
665 | 764 | "homedepot", // homedepot Homer TLC, Inc. |
765 | "homegoods", // homegoods The TJX Companies, Inc. | |
666 | 766 | "homes", // homes DERHomes, LLC |
767 | "homesense", // homesense The TJX Companies, Inc. | |
667 | 768 | "honda", // honda Honda Motor Co., Ltd. |
769 | "honeywell", // honeywell Honeywell GTLD LLC | |
668 | 770 | "horse", // horse Top Level Domain Holdings Limited |
771 | "hospital", // hospital Ruby Pike, LLC | |
669 | 772 | "host", // host DotHost Inc. |
670 | 773 | "hosting", // hosting Uniregistry, Corp. |
774 | "hot", // hot Amazon Registry Services, Inc. | |
671 | 775 | "hoteles", // hoteles Travel Reservations SRL |
672 | 776 | "hotmail", // hotmail Microsoft Corporation |
673 | 777 | "house", // house Sugar Park, LLC |
674 | 778 | "how", // how Charleston Road Registry Inc. |
675 | 779 | "hsbc", // hsbc HSBC Holdings PLC |
676 | 780 | "htc", // htc HTC corporation |
781 | "hughes", // hughes Hughes Satellite Systems Corporation | |
782 | "hyatt", // hyatt Hyatt GTLD, L.L.C. | |
677 | 783 | "hyundai", // hyundai Hyundai Motor Company |
678 | 784 | "ibm", // ibm International Business Machines Corporation |
679 | 785 | "icbc", // icbc Industrial and Commercial Bank of China Limited |
680 | 786 | "ice", // ice IntercontinentalExchange, Inc. |
681 | 787 | "icu", // icu One.com A/S |
788 | "ieee", // ieee IEEE Global LLC | |
682 | 789 | "ifm", // ifm ifm electronic gmbh |
683 | "iinet", // iinet Connect West Pty. Ltd. | |
790 | // "iinet", // iinet Connect West Pty. Ltd. (Retired) | |
791 | "ikano", // ikano Ikano S.A. | |
684 | 792 | "imamat", // imamat Fondation Aga Khan (Aga Khan Foundation) |
793 | "imdb", // imdb Amazon Registry Services, Inc. | |
685 | 794 | "immo", // immo Auburn Bloom, LLC |
686 | 795 | "immobilien", // immobilien United TLD Holdco Ltd. |
687 | 796 | "industries", // industries Outer House, LLC |
693 | 802 | "insurance", // insurance fTLD Registry Services LLC |
694 | 803 | "insure", // insure Pioneer Willow, LLC |
695 | 804 | "int", // int Internet Assigned Numbers Authority |
805 | "intel", // intel Intel Corporation | |
696 | 806 | "international", // international Wild Way, LLC |
807 | "intuit", // intuit Intuit Administrative Services, Inc. | |
697 | 808 | "investments", // investments Holly Glen, LLC |
698 | 809 | "ipiranga", // ipiranga Ipiranga Produtos de Petroleo S.A. |
699 | 810 | "irish", // irish Dot-Irish LLC |
702 | 813 | "ist", // ist Istanbul Metropolitan Municipality |
703 | 814 | "istanbul", // istanbul Istanbul Metropolitan Municipality / Medya A.S. |
704 | 815 | "itau", // itau Itau Unibanco Holding S.A. |
816 | "itv", // itv ITV Services Limited | |
817 | "iveco", // iveco CNH Industrial N.V. | |
705 | 818 | "iwc", // iwc Richemont DNS Inc. |
706 | 819 | "jaguar", // jaguar Jaguar Land Rover Ltd |
707 | 820 | "java", // java Oracle Corporation |
708 | 821 | "jcb", // jcb JCB Co., Ltd. |
709 | 822 | "jcp", // jcp JCP Media, Inc. |
823 | "jeep", // jeep FCA US LLC. | |
710 | 824 | "jetzt", // jetzt New TLD Company AB |
711 | 825 | "jewelry", // jewelry Wild Bloom, LLC |
826 | "jio", // jio Affinity Names, Inc. | |
712 | 827 | "jlc", // jlc Richemont DNS Inc. |
713 | 828 | "jll", // jll Jones Lang LaSalle Incorporated |
714 | 829 | "jmp", // jmp Matrix IP LLC |
720 | 835 | "jpmorgan", // jpmorgan JPMorgan Chase & Co. |
721 | 836 | "jprs", // jprs Japan Registry Services Co., Ltd. |
722 | 837 | "juegos", // juegos Uniregistry, Corp. |
838 | "juniper", // juniper JUNIPER NETWORKS, INC. | |
723 | 839 | "kaufen", // kaufen United TLD Holdco Ltd. |
724 | 840 | "kddi", // kddi KDDI CORPORATION |
725 | 841 | "kerryhotels", // kerryhotels Kerry Trading Co. Limited |
729 | 845 | "kia", // kia KIA MOTORS CORPORATION |
730 | 846 | "kim", // kim Afilias Limited |
731 | 847 | "kinder", // kinder Ferrero Trading Lux S.A. |
848 | "kindle", // kindle Amazon Registry Services, Inc. | |
732 | 849 | "kitchen", // kitchen Just Goodbye, LLC |
733 | 850 | "kiwi", // kiwi DOT KIWI LIMITED |
734 | 851 | "koeln", // koeln NetCologne Gesellschaft für Telekommunikation mbH |
735 | 852 | "komatsu", // komatsu Komatsu Ltd. |
853 | "kosher", // kosher Kosher Marketing Assets LLC | |
736 | 854 | "kpmg", // kpmg KPMG International Cooperative (KPMG International Genossenschaft) |
737 | 855 | "kpn", // kpn Koninklijke KPN N.V. |
738 | 856 | "krd", // krd KRG Department of Information Technology |
740 | 858 | "kuokgroup", // kuokgroup Kerry Trading Co. Limited |
741 | 859 | "kyoto", // kyoto Academic Institution: Kyoto Jyoho Gakuen |
742 | 860 | "lacaixa", // lacaixa CAIXA D'ESTALVIS I PENSIONS DE BARCELONA |
861 | "ladbrokes", // ladbrokes LADBROKES INTERNATIONAL PLC | |
743 | 862 | "lamborghini", // lamborghini Automobili Lamborghini S.p.A. |
744 | 863 | "lamer", // lamer The Estée Lauder Companies Inc. |
745 | 864 | "lancaster", // lancaster LANCASTER |
865 | "lancia", // lancia Fiat Chrysler Automobiles N.V. | |
866 | "lancome", // lancome L'Oréal | |
746 | 867 | "land", // land Pine Moon, LLC |
747 | 868 | "landrover", // landrover Jaguar Land Rover Ltd |
748 | 869 | "lanxess", // lanxess LANXESS Corporation |
749 | 870 | "lasalle", // lasalle Jones Lang LaSalle Incorporated |
750 | 871 | "lat", // lat ECOM-LAC Federación de Latinoamérica y el Caribe para Internet y el Comercio Electrónico |
872 | "latino", // latino Dish DBS Corporation | |
751 | 873 | "latrobe", // latrobe La Trobe University |
752 | 874 | "law", // law Minds + Machines Group Limited |
753 | 875 | "lawyer", // lawyer United TLD Holdco, Ltd |
754 | 876 | "lds", // lds IRI Domain Management, LLC |
755 | 877 | "lease", // lease Victor Trail, LLC |
756 | 878 | "leclerc", // leclerc A.C.D. LEC Association des Centres Distributeurs Edouard Leclerc |
879 | "lefrak", // lefrak LeFrak Organization, Inc. | |
757 | 880 | "legal", // legal Blue Falls, LLC |
881 | "lego", // lego LEGO Juris A/S | |
758 | 882 | "lexus", // lexus TOYOTA MOTOR CORPORATION |
759 | 883 | "lgbt", // lgbt Afilias Limited |
760 | 884 | "liaison", // liaison Liaison Technologies, Incorporated |
764 | 888 | "lifestyle", // lifestyle Lifestyle Domain Holdings, Inc. |
765 | 889 | "lighting", // lighting John McCook, LLC |
766 | 890 | "like", // like Amazon Registry Services, Inc. |
891 | "lilly", // lilly Eli Lilly and Company | |
767 | 892 | "limited", // limited Big Fest, LLC |
768 | 893 | "limo", // limo Hidden Frostbite, LLC |
769 | 894 | "lincoln", // lincoln Ford Motor Company |
770 | 895 | "linde", // linde Linde Aktiengesellschaft |
771 | 896 | "link", // link Uniregistry, Corp. |
897 | "lipsy", // lipsy Lipsy Ltd | |
772 | 898 | "live", // live United TLD Holdco Ltd. |
773 | 899 | "living", // living Lifestyle Domain Holdings, Inc. |
774 | 900 | "lixil", // lixil LIXIL Group Corporation |
775 | 901 | "loan", // loan dot Loan Limited |
776 | 902 | "loans", // loans June Woods, LLC |
903 | "locker", // locker Dish DBS Corporation | |
777 | 904 | "locus", // locus Locus Analytics LLC |
905 | "loft", // loft Annco, Inc. | |
778 | 906 | "lol", // lol Uniregistry, Corp. |
779 | 907 | "london", // london Dot London Domains Limited |
780 | 908 | "lotte", // lotte Lotte Holdings Co., Ltd. |
781 | 909 | "lotto", // lotto Afilias Limited |
782 | 910 | "love", // love Merchant Law Group LLP |
911 | "lpl", // lpl LPL Holdings, Inc. | |
912 | "lplfinancial", // lplfinancial LPL Holdings, Inc. | |
783 | 913 | "ltd", // ltd Over Corner, LLC |
784 | 914 | "ltda", // ltda InterNetX Corp. |
915 | "lundbeck", // lundbeck H. Lundbeck A/S | |
785 | 916 | "lupin", // lupin LUPIN LIMITED |
786 | 917 | "luxe", // luxe Top Level Domain Holdings Limited |
787 | 918 | "luxury", // luxury Luxury Partners LLC |
919 | "macys", // macys Macys, Inc. | |
788 | 920 | "madrid", // madrid Comunidad de Madrid |
789 | 921 | "maif", // maif Mutuelle Assurance Instituteur France (MAIF) |
790 | 922 | "maison", // maison Victor Frostbite, LLC |
796 | 928 | "marketing", // marketing Fern Pass, LLC |
797 | 929 | "markets", // markets DOTMARKETS REGISTRY LTD |
798 | 930 | "marriott", // marriott Marriott Worldwide Corporation |
931 | "marshalls", // marshalls The TJX Companies, Inc. | |
932 | "maserati", // maserati Fiat Chrysler Automobiles N.V. | |
933 | "mattel", // mattel Mattel Sites, Inc. | |
799 | 934 | "mba", // mba Lone Hollow, LLC |
935 | "mcd", // mcd McDonald’s Corporation | |
936 | "mcdonalds", // mcdonalds McDonald’s Corporation | |
937 | "mckinsey", // mckinsey McKinsey Holdings, Inc. | |
800 | 938 | "med", // med Medistry LLC |
801 | 939 | "media", // media Grand Glen, LLC |
802 | 940 | "meet", // meet Afilias Limited |
806 | 944 | "men", // men Exclusive Registry Limited |
807 | 945 | "menu", // menu Wedding TLD2, LLC |
808 | 946 | "meo", // meo PT Comunicacoes S.A. |
947 | "metlife", // metlife MetLife Services and Solutions, LLC | |
809 | 948 | "miami", // miami Top Level Domain Holdings Limited |
810 | 949 | "microsoft", // microsoft Microsoft Corporation |
811 | 950 | "mil", // mil DoD Network Information Center |
812 | 951 | "mini", // mini Bayerische Motoren Werke Aktiengesellschaft |
952 | "mint", // mint Intuit Administrative Services, Inc. | |
953 | "mit", // mit Massachusetts Institute of Technology | |
954 | "mitsubishi", // mitsubishi Mitsubishi Corporation | |
955 | "mlb", // mlb MLB Advanced Media DH, LLC | |
813 | 956 | "mls", // mls The Canadian Real Estate Association |
814 | 957 | "mma", // mma MMA IARD |
815 | 958 | "mobi", // mobi Afilias Technologies Limited dba dotMobi |
959 | "mobile", // mobile Dish DBS Corporation | |
816 | 960 | "mobily", // mobily GreenTech Consultancy Company W.L.L. |
817 | 961 | "moda", // moda United TLD Holdco Ltd. |
818 | 962 | "moe", // moe Interlink Co., Ltd. |
820 | 964 | "mom", // mom Uniregistry, Corp. |
821 | 965 | "monash", // monash Monash University |
822 | 966 | "money", // money Outer McCook, LLC |
967 | "monster", // monster Monster Worldwide, Inc. | |
823 | 968 | "montblanc", // montblanc Richemont DNS Inc. |
969 | "mopar", // mopar FCA US LLC. | |
824 | 970 | "mormon", // mormon IRI Domain Management, LLC ("Applicant") |
825 | 971 | "mortgage", // mortgage United TLD Holdco, Ltd |
826 | 972 | "moscow", // moscow Foundation for Assistance for Internet Technologies and Infrastructure Development (FAITID) |
973 | "moto", // moto Motorola Trademark Holdings, LLC | |
827 | 974 | "motorcycles", // motorcycles DERMotorcycles, LLC |
828 | 975 | "mov", // mov Charleston Road Registry Inc. |
829 | 976 | "movie", // movie New Frostbite, LLC |
830 | 977 | "movistar", // movistar Telefónica S.A. |
978 | "msd", // msd MSD Registry Holdings, Inc. | |
831 | 979 | "mtn", // mtn MTN Dubai Limited |
832 | 980 | "mtpc", // mtpc Mitsubishi Tanabe Pharma Corporation |
833 | 981 | "mtr", // mtr MTR Corporation Limited |
834 | 982 | "museum", // museum Museum Domain Management Association |
835 | 983 | "mutual", // mutual Northwestern Mutual MU TLD Registry, LLC |
836 | "mutuelle", // mutuelle Fédération Nationale de la Mutualité Française | |
984 | // "mutuelle", // mutuelle Fédération Nationale de la Mutualité Française (Retired) | |
985 | "nab", // nab National Australia Bank Limited | |
837 | 986 | "nadex", // nadex Nadex Domains, Inc |
838 | 987 | "nagoya", // nagoya GMO Registry, Inc. |
839 | 988 | "name", // name VeriSign Information Services, Inc. |
989 | "nationwide", // nationwide Nationwide Mutual Insurance Company | |
840 | 990 | "natura", // natura NATURA COSMÉTICOS S.A. |
841 | 991 | "navy", // navy United TLD Holdco Ltd. |
992 | "nba", // nba NBA REGISTRY, LLC | |
842 | 993 | "nec", // nec NEC Corporation |
843 | 994 | "net", // net VeriSign Global Registry Services |
844 | 995 | "netbank", // netbank COMMONWEALTH BANK OF AUSTRALIA |
996 | "netflix", // netflix Netflix, Inc. | |
845 | 997 | "network", // network Trixy Manor, LLC |
846 | 998 | "neustar", // neustar NeuStar, Inc. |
847 | 999 | "new", // new Charleston Road Registry Inc. |
1000 | "newholland", // newholland CNH Industrial N.V. | |
848 | 1001 | "news", // news United TLD Holdco Ltd. |
1002 | "next", // next Next plc | |
1003 | "nextdirect", // nextdirect Next plc | |
849 | 1004 | "nexus", // nexus Charleston Road Registry Inc. |
1005 | "nfl", // nfl NFL Reg Ops LLC | |
850 | 1006 | "ngo", // ngo Public Interest Registry |
851 | 1007 | "nhk", // nhk Japan Broadcasting Corporation (NHK) |
852 | 1008 | "nico", // nico DWANGO Co., Ltd. |
1009 | "nike", // nike NIKE, Inc. | |
853 | 1010 | "nikon", // nikon NIKON CORPORATION |
854 | 1011 | "ninja", // ninja United TLD Holdco Ltd. |
855 | 1012 | "nissan", // nissan NISSAN MOTOR CO., LTD. |
857 | 1014 | "nokia", // nokia Nokia Corporation |
858 | 1015 | "northwesternmutual", // northwesternmutual Northwestern Mutual Registry, LLC |
859 | 1016 | "norton", // norton Symantec Corporation |
1017 | "now", // now Amazon Registry Services, Inc. | |
860 | 1018 | "nowruz", // nowruz Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti. |
1019 | "nowtv", // nowtv Starbucks (HK) Limited | |
861 | 1020 | "nra", // nra NRA Holdings Company, INC. |
862 | 1021 | "nrw", // nrw Minds + Machines GmbH |
863 | 1022 | "ntt", // ntt NIPPON TELEGRAPH AND TELEPHONE CORPORATION |
864 | 1023 | "nyc", // nyc The City of New York by and through the New York City Department of Information Technology & Telecommunications |
865 | 1024 | "obi", // obi OBI Group Holding SE & Co. KGaA |
1025 | "observer", // observer Top Level Spectrum, Inc. | |
1026 | "off", // off Johnson Shareholdings, Inc. | |
866 | 1027 | "office", // office Microsoft Corporation |
867 | 1028 | "okinawa", // okinawa BusinessRalliart inc. |
1029 | "olayan", // olayan Crescent Holding GmbH | |
1030 | "olayangroup", // olayangroup Crescent Holding GmbH | |
1031 | "oldnavy", // oldnavy The Gap, Inc. | |
1032 | "ollo", // ollo Dish DBS Corporation | |
868 | 1033 | "omega", // omega The Swatch Group Ltd |
869 | 1034 | "one", // one One.com A/S |
870 | 1035 | "ong", // ong Public Interest Registry |
871 | 1036 | "onl", // onl I-REGISTRY Ltd., Niederlassung Deutschland |
872 | 1037 | "online", // online DotOnline Inc. |
1038 | "onyourside", // onyourside Nationwide Mutual Insurance Company | |
873 | 1039 | "ooo", // ooo INFIBEAM INCORPORATION LIMITED |
1040 | "open", // open American Express Travel Related Services Company, Inc. | |
874 | 1041 | "oracle", // oracle Oracle Corporation |
875 | 1042 | "orange", // orange Orange Brand Services Limited |
876 | 1043 | "org", // org Public Interest Registry (PIR) |
877 | 1044 | "organic", // organic Afilias Limited |
1045 | "orientexpress", // orientexpress Orient Express | |
878 | 1046 | "origins", // origins The Estée Lauder Companies Inc. |
879 | 1047 | "osaka", // osaka Interlink Co., Ltd. |
880 | 1048 | "otsuka", // otsuka Otsuka Holdings Co., Ltd. |
1049 | "ott", // ott Dish DBS Corporation | |
881 | 1050 | "ovh", // ovh OVH SAS |
882 | 1051 | "page", // page Charleston Road Registry Inc. |
883 | 1052 | "pamperedchef", // pamperedchef The Pampered Chef, Ltd. |
1053 | "panasonic", // panasonic Panasonic Corporation | |
884 | 1054 | "panerai", // panerai Richemont DNS Inc. |
885 | 1055 | "paris", // paris City of Paris |
886 | 1056 | "pars", // pars Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti. |
888 | 1058 | "parts", // parts Sea Goodbye, LLC |
889 | 1059 | "party", // party Blue Sky Registry Limited |
890 | 1060 | "passagens", // passagens Travel Reservations SRL |
1061 | "pay", // pay Amazon Registry Services, Inc. | |
1062 | "pccw", // pccw PCCW Enterprises Limited | |
891 | 1063 | "pet", // pet Afilias plc |
1064 | "pfizer", // pfizer Pfizer Inc. | |
892 | 1065 | "pharmacy", // pharmacy National Association of Boards of Pharmacy |
893 | 1066 | "philips", // philips Koninklijke Philips N.V. |
1067 | "phone", // phone Dish DBS Corporation | |
894 | 1068 | "photo", // photo Uniregistry, Corp. |
895 | 1069 | "photography", // photography Sugar Glen, LLC |
896 | 1070 | "photos", // photos Sea Corner, LLC |
903 | 1077 | "pin", // pin Amazon Registry Services, Inc. |
904 | 1078 | "ping", // ping Ping Registry Provider, Inc. |
905 | 1079 | "pink", // pink Afilias Limited |
1080 | "pioneer", // pioneer Pioneer Corporation | |
906 | 1081 | "pizza", // pizza Foggy Moon, LLC |
907 | 1082 | "place", // place Snow Galley, LLC |
908 | 1083 | "play", // play Charleston Road Registry Inc. |
909 | 1084 | "playstation", // playstation Sony Computer Entertainment Inc. |
910 | 1085 | "plumbing", // plumbing Spring Tigers, LLC |
911 | 1086 | "plus", // plus Sugar Mill, LLC |
1087 | "pnc", // pnc PNC Domain Co., LLC | |
912 | 1088 | "pohl", // pohl Deutsche Vermögensberatung Aktiengesellschaft DVAG |
913 | 1089 | "poker", // poker Afilias Domains No. 5 Limited |
1090 | "politie", // politie Politie Nederland | |
914 | 1091 | "porn", // porn ICM Registry PN LLC |
915 | 1092 | "post", // post Universal Postal Union |
1093 | "pramerica", // pramerica Prudential Financial, Inc. | |
916 | 1094 | "praxi", // praxi Praxi S.p.A. |
917 | 1095 | "press", // press DotPress Inc. |
1096 | "prime", // prime Amazon Registry Services, Inc. | |
918 | 1097 | "pro", // pro Registry Services Corporation dba RegistryPro |
919 | 1098 | "prod", // prod Charleston Road Registry Inc. |
920 | 1099 | "productions", // productions Magic Birch, LLC |
924 | 1103 | "properties", // properties Big Pass, LLC |
925 | 1104 | "property", // property Uniregistry, Corp. |
926 | 1105 | "protection", // protection XYZ.COM LLC |
1106 | "pru", // pru Prudential Financial, Inc. | |
1107 | "prudential", // prudential Prudential Financial, Inc. | |
927 | 1108 | "pub", // pub United TLD Holdco Ltd. |
928 | 1109 | "pwc", // pwc PricewaterhouseCoopers LLP |
929 | 1110 | "qpon", // qpon dotCOOL, Inc. |
930 | 1111 | "quebec", // quebec PointQuébec Inc |
931 | 1112 | "quest", // quest Quest ION Limited |
1113 | "qvc", // qvc QVC, Inc. | |
932 | 1114 | "racing", // racing Premier Registry Limited |
1115 | "radio", // radio European Broadcasting Union (EBU) | |
1116 | "raid", // raid Johnson Shareholdings, Inc. | |
933 | 1117 | "read", // read Amazon Registry Services, Inc. |
1118 | "realestate", // realestate dotRealEstate LLC | |
934 | 1119 | "realtor", // realtor Real Estate Domains LLC |
935 | 1120 | "realty", // realty Fegistry, LLC |
936 | 1121 | "recipes", // recipes Grand Island, LLC |
941 | 1126 | "reise", // reise Foggy Way, LLC |
942 | 1127 | "reisen", // reisen New Cypress, LLC |
943 | 1128 | "reit", // reit National Association of Real Estate Investment Trusts, Inc. |
1129 | "reliance", // reliance Reliance Industries Limited | |
944 | 1130 | "ren", // ren Beijing Qianxiang Wangjing Technology Development Co., Ltd. |
945 | 1131 | "rent", // rent XYZ.COM LLC |
946 | 1132 | "rentals", // rentals Big Hollow,LLC |
953 | 1139 | "reviews", // reviews United TLD Holdco, Ltd. |
954 | 1140 | "rexroth", // rexroth Robert Bosch GMBH |
955 | 1141 | "rich", // rich I-REGISTRY Ltd., Niederlassung Deutschland |
1142 | "richardli", // richardli Pacific Century Asset Management (HK) Limited | |
956 | 1143 | "ricoh", // ricoh Ricoh Company, Ltd. |
1144 | "rightathome", // rightathome Johnson Shareholdings, Inc. | |
1145 | "ril", // ril Reliance Industries Limited | |
957 | 1146 | "rio", // rio Empresa Municipal de Informática SA - IPLANRIO |
958 | 1147 | "rip", // rip United TLD Holdco Ltd. |
1148 | "rmit", // rmit Royal Melbourne Institute of Technology | |
959 | 1149 | "rocher", // rocher Ferrero Trading Lux S.A. |
960 | 1150 | "rocks", // rocks United TLD Holdco, LTD. |
961 | 1151 | "rodeo", // rodeo Top Level Domain Holdings Limited |
1152 | "rogers", // rogers Rogers Communications Canada Inc. | |
962 | 1153 | "room", // room Amazon Registry Services, Inc. |
963 | 1154 | "rsvp", // rsvp Charleston Road Registry Inc. |
964 | 1155 | "ruhr", // ruhr regiodot GmbH & Co. KG |
971 | 1162 | "sakura", // sakura SAKURA Internet Inc. |
972 | 1163 | "sale", // sale United TLD Holdco, Ltd |
973 | 1164 | "salon", // salon Outer Orchard, LLC |
1165 | "samsclub", // samsclub Wal-Mart Stores, Inc. | |
974 | 1166 | "samsung", // samsung SAMSUNG SDS CO., LTD |
975 | 1167 | "sandvik", // sandvik Sandvik AB |
976 | 1168 | "sandvikcoromant", // sandvikcoromant Sandvik AB |
979 | 1171 | "sapo", // sapo PT Comunicacoes S.A. |
980 | 1172 | "sarl", // sarl Delta Orchard, LLC |
981 | 1173 | "sas", // sas Research IP LLC |
1174 | "save", // save Amazon Registry Services, Inc. | |
982 | 1175 | "saxo", // saxo Saxo Bank A/S |
983 | 1176 | "sbi", // sbi STATE BANK OF INDIA |
984 | 1177 | "sbs", // sbs SPECIAL BROADCASTING SERVICE CORPORATION |
991 | 1184 | "schule", // schule Outer Moon, LLC |
992 | 1185 | "schwarz", // schwarz Schwarz Domains und Services GmbH & Co. KG |
993 | 1186 | "science", // science dot Science Limited |
1187 | "scjohnson", // scjohnson Johnson Shareholdings, Inc. | |
994 | 1188 | "scor", // scor SCOR SE |
995 | 1189 | "scot", // scot Dot Scot Registry Limited |
996 | 1190 | "seat", // seat SEAT, S.A. (Sociedad Unipersonal) |
1191 | "secure", // secure Amazon Registry Services, Inc. | |
997 | 1192 | "security", // security XYZ.COM LLC |
998 | 1193 | "seek", // seek Seek Limited |
999 | 1194 | "select", // select iSelect Ltd |
1000 | 1195 | "sener", // sener Sener Ingeniería y Sistemas, S.A. |
1001 | 1196 | "services", // services Fox Castle, LLC |
1197 | "ses", // ses SES | |
1002 | 1198 | "seven", // seven Seven West Media Ltd |
1003 | 1199 | "sew", // sew SEW-EURODRIVE GmbH & Co KG |
1004 | 1200 | "sex", // sex ICM Registry SX LLC |
1005 | 1201 | "sexy", // sexy Uniregistry, Corp. |
1006 | 1202 | "sfr", // sfr Societe Francaise du Radiotelephone - SFR |
1203 | "shangrila", // shangrila Shangri‐La International Hotel Management Limited | |
1007 | 1204 | "sharp", // sharp Sharp Corporation |
1008 | 1205 | "shaw", // shaw Shaw Cablesystems G.P. |
1009 | 1206 | "shell", // shell Shell Information Technology International Inc |
1010 | 1207 | "shia", // shia Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti. |
1011 | 1208 | "shiksha", // shiksha Afilias Limited |
1012 | 1209 | "shoes", // shoes Binky Galley, LLC |
1210 | "shop", // shop GMO Registry, Inc. | |
1211 | "shopping", // shopping Over Keep, LLC | |
1013 | 1212 | "shouji", // shouji QIHOO 360 TECHNOLOGY CO. LTD. |
1014 | 1213 | "show", // show Snow Beach, LLC |
1214 | "showtime", // showtime CBS Domains Inc. | |
1015 | 1215 | "shriram", // shriram Shriram Capital Ltd. |
1216 | "silk", // silk Amazon Registry Services, Inc. | |
1016 | 1217 | "sina", // sina Sina Corporation |
1017 | 1218 | "singles", // singles Fern Madison, LLC |
1018 | 1219 | "site", // site DotSite Inc. |
1020 | 1221 | "skin", // skin L'Oréal |
1021 | 1222 | "sky", // sky Sky International AG |
1022 | 1223 | "skype", // skype Microsoft Corporation |
1224 | "sling", // sling Hughes Satellite Systems Corporation | |
1225 | "smart", // smart Smart Communications, Inc. (SMART) | |
1023 | 1226 | "smile", // smile Amazon Registry Services, Inc. |
1024 | 1227 | "sncf", // sncf SNCF (Société Nationale des Chemins de fer Francais) |
1025 | 1228 | "soccer", // soccer Foggy Shadow, LLC |
1037 | 1240 | "spot", // spot Amazon Registry Services, Inc. |
1038 | 1241 | "spreadbetting", // spreadbetting DOTSPREADBETTING REGISTRY LTD |
1039 | 1242 | "srl", // srl InterNetX Corp. |
1243 | "srt", // srt FCA US LLC. | |
1040 | 1244 | "stada", // stada STADA Arzneimittel AG |
1245 | "staples", // staples Staples, Inc. | |
1041 | 1246 | "star", // star Star India Private Limited |
1042 | 1247 | "starhub", // starhub StarHub Limited |
1043 | 1248 | "statebank", // statebank STATE BANK OF INDIA |
1060 | 1265 | "surgery", // surgery Tin Avenue, LLC |
1061 | 1266 | "suzuki", // suzuki SUZUKI MOTOR CORPORATION |
1062 | 1267 | "swatch", // swatch The Swatch Group Ltd |
1268 | "swiftcover", // swiftcover Swiftcover Insurance Services Limited | |
1063 | 1269 | "swiss", // swiss Swiss Confederation |
1064 | 1270 | "sydney", // sydney State of New South Wales, Department of Premier and Cabinet |
1065 | 1271 | "symantec", // symantec Symantec Corporation |
1068 | 1274 | "taipei", // taipei Taipei City Government |
1069 | 1275 | "talk", // talk Amazon Registry Services, Inc. |
1070 | 1276 | "taobao", // taobao Alibaba Group Holding Limited |
1277 | "target", // target Target Domain Holdings, LLC | |
1071 | 1278 | "tatamotors", // tatamotors Tata Motors Ltd |
1072 | 1279 | "tatar", // tatar Limited Liability Company "Coordination Center of Regional Domain of Tatarstan Republic" |
1073 | 1280 | "tattoo", // tattoo Uniregistry, Corp. |
1074 | 1281 | "tax", // tax Storm Orchard, LLC |
1075 | 1282 | "taxi", // taxi Pine Falls, LLC |
1076 | 1283 | "tci", // tci Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti. |
1284 | "tdk", // tdk TDK Corporation | |
1077 | 1285 | "team", // team Atomic Lake, LLC |
1078 | 1286 | "tech", // tech Dot Tech LLC |
1079 | 1287 | "technology", // technology Auburn Falls, LLC |
1086 | 1294 | "thd", // thd Homer TLC, Inc. |
1087 | 1295 | "theater", // theater Blue Tigers, LLC |
1088 | 1296 | "theatre", // theatre XYZ.COM LLC |
1297 | "tiaa", // tiaa Teachers Insurance and Annuity Association of America | |
1089 | 1298 | "tickets", // tickets Accent Media Limited |
1090 | 1299 | "tienda", // tienda Victor Manor, LLC |
1091 | 1300 | "tiffany", // tiffany Tiffany and Company |
1092 | 1301 | "tips", // tips Corn Willow, LLC |
1093 | 1302 | "tires", // tires Dog Edge, LLC |
1094 | 1303 | "tirol", // tirol punkt Tirol GmbH |
1304 | "tjmaxx", // tjmaxx The TJX Companies, Inc. | |
1305 | "tjx", // tjx The TJX Companies, Inc. | |
1306 | "tkmaxx", // tkmaxx The TJX Companies, Inc. | |
1095 | 1307 | "tmall", // tmall Alibaba Group Holding Limited |
1096 | 1308 | "today", // today Pearl Woods, LLC |
1097 | 1309 | "tokyo", // tokyo GMO Registry, Inc. |
1108 | 1320 | "trading", // trading DOTTRADING REGISTRY LTD |
1109 | 1321 | "training", // training Wild Willow, LLC |
1110 | 1322 | "travel", // travel Tralliance Registry Management Company, LLC. |
1323 | "travelchannel", // travelchannel Lifestyle Domain Holdings, Inc. | |
1111 | 1324 | "travelers", // travelers Travelers TLD, LLC |
1112 | 1325 | "travelersinsurance", // travelersinsurance Travelers TLD, LLC |
1113 | 1326 | "trust", // trust Artemis Internet Inc |
1117 | 1330 | "tunes", // tunes Amazon Registry Services, Inc. |
1118 | 1331 | "tushu", // tushu Amazon Registry Services, Inc. |
1119 | 1332 | "tvs", // tvs T V SUNDRAM IYENGAR & SONS PRIVATE LIMITED |
1333 | "ubank", // ubank National Australia Bank Limited | |
1120 | 1334 | "ubs", // ubs UBS AG |
1335 | "uconnect", // uconnect FCA US LLC. | |
1121 | 1336 | "unicom", // unicom China United Network Communications Corporation Limited |
1122 | 1337 | "university", // university Little Station, LLC |
1123 | 1338 | "uno", // uno Dot Latin LLC |
1124 | 1339 | "uol", // uol UBN INTERNET LTDA. |
1340 | "ups", // ups UPS Market Driver, Inc. | |
1125 | 1341 | "vacations", // vacations Atomic Tigers, LLC |
1126 | 1342 | "vana", // vana Lifestyle Domain Holdings, Inc. |
1343 | "vanguard", // vanguard The Vanguard Group, Inc. | |
1127 | 1344 | "vegas", // vegas Dot Vegas, Inc. |
1128 | 1345 | "ventures", // ventures Binky Lake, LLC |
1129 | 1346 | "verisign", // verisign VeriSign, Inc. |
1137 | 1354 | "vin", // vin Holly Shadow, LLC |
1138 | 1355 | "vip", // vip Minds + Machines Group Limited |
1139 | 1356 | "virgin", // virgin Virgin Enterprises Limited |
1357 | "visa", // visa Visa Worldwide Pte. Limited | |
1140 | 1358 | "vision", // vision Koko Station, LLC |
1141 | 1359 | "vista", // vista Vistaprint Limited |
1142 | 1360 | "vistaprint", // vistaprint Vistaprint Limited |
1143 | 1361 | "viva", // viva Saudi Telecom Company |
1362 | "vivo", // vivo Telefonica Brasil S.A. | |
1144 | 1363 | "vlaanderen", // vlaanderen DNS.be vzw |
1145 | 1364 | "vodka", // vodka Top Level Domain Holdings Limited |
1146 | 1365 | "volkswagen", // volkswagen Volkswagen Group of America Inc. |
1366 | "volvo", // volvo Volvo Holding Sverige Aktiebolag | |
1147 | 1367 | "vote", // vote Monolith Registry LLC |
1148 | 1368 | "voting", // voting Valuetainment Corp. |
1149 | 1369 | "voto", // voto Monolith Registry LLC |
1150 | 1370 | "voyage", // voyage Ruby House, LLC |
1151 | 1371 | "vuelos", // vuelos Travel Reservations SRL |
1152 | 1372 | "wales", // wales Nominet UK |
1373 | "walmart", // walmart Wal-Mart Stores, Inc. | |
1153 | 1374 | "walter", // walter Sandvik AB |
1154 | 1375 | "wang", // wang Zodiac Registry Limited |
1155 | 1376 | "wanggou", // wanggou Amazon Registry Services, Inc. |
1377 | "warman", // warman Weir Group IP Limited | |
1156 | 1378 | "watch", // watch Sand Shadow, LLC |
1157 | 1379 | "watches", // watches Richemont DNS Inc. |
1158 | 1380 | "weather", // weather The Weather Channel, LLC |
1171 | 1393 | "win", // win First Registry Limited |
1172 | 1394 | "windows", // windows Microsoft Corporation |
1173 | 1395 | "wine", // wine June Station, LLC |
1396 | "winners", // winners The TJX Companies, Inc. | |
1174 | 1397 | "wme", // wme William Morris Endeavor Entertainment, LLC |
1175 | 1398 | "wolterskluwer", // wolterskluwer Wolters Kluwer N.V. |
1399 | "woodside", // woodside Woodside Petroleum Limited | |
1176 | 1400 | "work", // work Top Level Domain Holdings Limited |
1177 | 1401 | "works", // works Little Dynamite, LLC |
1178 | 1402 | "world", // world Bitter Fields, LLC |
1403 | "wow", // wow Amazon Registry Services, Inc. | |
1179 | 1404 | "wtc", // wtc World Trade Centers Association, Inc. |
1180 | 1405 | "wtf", // wtf Hidden Way, LLC |
1181 | 1406 | "xbox", // xbox Microsoft Corporation |
1182 | 1407 | "xerox", // xerox Xerox DNHC LLC |
1408 | "xfinity", // xfinity Comcast IP Holdings I, LLC | |
1183 | 1409 | "xihuan", // xihuan QIHOO 360 TECHNOLOGY CO. LTD. |
1184 | 1410 | "xin", // xin Elegant Leader Limited |
1185 | 1411 | "xn--11b4c3d", // कॉम VeriSign Sarl |
1188 | 1414 | "xn--30rr7y", // 慈善 Excellent First Limited |
1189 | 1415 | "xn--3bst00m", // 集团 Eagle Horizon Limited |
1190 | 1416 | "xn--3ds443g", // 在线 TLD REGISTRY LIMITED |
1417 | "xn--3oq18vl8pn36a", // 大众汽车 Volkswagen (China) Investment Co., Ltd. | |
1191 | 1418 | "xn--3pxu8k", // 点看 VeriSign Sarl |
1192 | 1419 | "xn--42c2d9a", // คอม VeriSign Sarl |
1193 | 1420 | "xn--45q11c", // 八卦 Zodiac Scorpio Limited |
1194 | 1421 | "xn--4gbrim", // موقع Suhub Electronic Establishment |
1195 | 1422 | "xn--55qw42g", // 公益 China Organizational Name Administration Center |
1196 | 1423 | "xn--55qx5d", // 公司 Computer Network Information Center of Chinese Academy of Sciences (China Internet Network Information Center) |
1424 | "xn--5su34j936bgsg", // 香格里拉 Shangri‐La International Hotel Management Limited | |
1197 | 1425 | "xn--5tzm5g", // 网站 Global Website TLD Asia Limited |
1198 | 1426 | "xn--6frz82g", // 移动 Afilias Limited |
1199 | 1427 | "xn--6qq986b3xl", // 我爱你 Tycoon Treasure Limited |
1200 | 1428 | "xn--80adxhks", // москва Foundation for Assistance for Internet Technologies and Infrastructure Development (FAITID) |
1429 | "xn--80aqecdr1a", // католик Pontificium Consilium de Comunicationibus Socialibus (PCCS) (Pontifical Council for Social Communication) | |
1201 | 1430 | "xn--80asehdb", // онлайн CORE Association |
1202 | 1431 | "xn--80aswg", // сайт CORE Association |
1203 | 1432 | "xn--8y0a063a", // 联通 China United Network Communications Corporation Limited |
1433 | "xn--90ae", // бг Imena.BG Plc (NAMES.BG Plc) | |
1204 | 1434 | "xn--9dbq2a", // קום VeriSign Sarl |
1205 | 1435 | "xn--9et52u", // 时尚 RISE VICTORY LIMITED |
1206 | 1436 | "xn--9krt00a", // 微博 Sina Corporation |
1223 | 1453 | "xn--fiq64b", // 中信 CITIC Group Corporation |
1224 | 1454 | "xn--fjq720a", // 娱乐 Will Bloom, LLC |
1225 | 1455 | "xn--flw351e", // 谷歌 Charleston Road Registry Inc. |
1456 | "xn--fzys8d69uvgm", // 電訊盈科 PCCW Enterprises Limited | |
1226 | 1457 | "xn--g2xx48c", // 购物 Minds + Machines Group Limited |
1227 | 1458 | "xn--gckr3f0f", // クラウド Amazon Registry Services, Inc. |
1459 | "xn--gk3at1e", // 通販 Amazon Registry Services, Inc. | |
1228 | 1460 | "xn--hxt814e", // 网店 Zodiac Libra Limited |
1229 | 1461 | "xn--i1b6b1a6a2e", // संगठन Public Interest Registry |
1230 | 1462 | "xn--imr513n", // 餐厅 HU YI GLOBAL INFORMATION RESOURCES (HOLDING) COMPANY. HONGKONG LIMITED |
1236 | 1468 | "xn--kpu716f", // 手表 Richemont DNS Inc. |
1237 | 1469 | "xn--kput3i", // 手机 Beijing RITT-Net Technology Development Co., Ltd |
1238 | 1470 | "xn--mgba3a3ejt", // ارامكو Aramco Services Company |
1471 | "xn--mgba7c0bbn0a", // العليان Crescent Holding GmbH | |
1239 | 1472 | "xn--mgbab2bd", // بازار CORE Association |
1240 | 1473 | "xn--mgbb9fbpob", // موبايلي GreenTech Consultancy Company W.L.L. |
1241 | 1474 | "xn--mgbca7dzdo", // ابوظبي Abu Dhabi Systems and Information Centre |
1475 | "xn--mgbi4ecexp", // كاثوليك Pontificium Consilium de Comunicationibus Socialibus (PCCS) (Pontifical Council for Social Communication) | |
1242 | 1476 | "xn--mgbt3dhd", // همراه Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti. |
1243 | 1477 | "xn--mk1bu44c", // 닷컴 VeriSign Sarl |
1244 | 1478 | "xn--mxtq1m", // 政府 Net-Chinese Co., Ltd. |
1257 | 1491 | "xn--ses554g", // 网址 KNET Co., Ltd |
1258 | 1492 | "xn--t60b56a", // 닷넷 VeriSign Sarl |
1259 | 1493 | "xn--tckwe", // コム VeriSign Sarl |
1494 | "xn--tiq49xqyj", // 天主教 Pontificium Consilium de Comunicationibus Socialibus (PCCS) (Pontifical Council for Social Communication) | |
1260 | 1495 | "xn--unup4y", // 游戏 Spring Fields, LLC |
1261 | 1496 | "xn--vermgensberater-ctb", // VERMöGENSBERATER Deutsche Vermögensberatung Aktiengesellschaft DVAG |
1262 | 1497 | "xn--vermgensberatung-pwb", // VERMöGENSBERATUNG Deutsche Vermögensberatung Aktiengesellschaft DVAG |
1263 | 1498 | "xn--vhquv", // 企业 Dash McCook, LLC |
1264 | 1499 | "xn--vuq861b", // 信息 Beijing Tele-info Network Technology Co., Ltd. |
1265 | 1500 | "xn--w4r85el8fhu5dnra", // 嘉里大酒店 Kerry Trading Co. Limited |
1501 | "xn--w4rs40l", // 嘉里 Kerry Trading Co. Limited | |
1266 | 1502 | "xn--xhq521b", // 广东 Guangzhou YU Wei Information Technology Co., Ltd. |
1267 | 1503 | "xn--zfr164b", // 政务 China Organizational Name Administration Center |
1268 | 1504 | "xperia", // xperia Sony Mobile Communications AB |
1278 | 1514 | "you", // you Amazon Registry Services, Inc. |
1279 | 1515 | "youtube", // youtube Charleston Road Registry Inc. |
1280 | 1516 | "yun", // yun QIHOO 360 TECHNOLOGY CO. LTD. |
1517 | "zappos", // zappos Amazon Registry Services, Inc. | |
1281 | 1518 | "zara", // zara Industria de Diseño Textil, S.A. (INDITEX, S.A.) |
1282 | 1519 | "zero", // zero Amazon Registry Services, Inc. |
1283 | 1520 | "zip", // zip Charleston Road Registry Inc. |
1521 | "zippo", // zippo Zadco Company | |
1284 | 1522 | "zone", // zone Outer Falls, LLC |
1285 | 1523 | "zuerich", // zuerich Kanton Zürich (Canton of Zurich) |
1286 | 1524 | }; |
1533 | 1771 | "ws", // Samoa (formerly Western Samoa) |
1534 | 1772 | "xn--3e0b707e", // 한국 KISA (Korea Internet & Security Agency) |
1535 | 1773 | "xn--45brj9c", // ভারত National Internet Exchange of India |
1774 | "xn--54b7fta0cc", // বাংলা Posts and Telecommunications Division | |
1536 | 1775 | "xn--80ao21a", // қаз Association of IT Companies of Kazakhstan |
1537 | 1776 | "xn--90a3ac", // срб Serbian National Internet Domain Registry (RNIDS) |
1538 | 1777 | "xn--90ais", // ??? Reliable Software Inc. |
93 | 93 | */ |
94 | 94 | |
95 | 95 | private static final Validator[] DEFAULT_FORMATS = { |
96 | new Validator("AD", 24, "AD\\d{10}[A-Z0-9]{12}" ), // Andorra | |
97 | new Validator("AE", 23, "AE\\d{21}" ), // United Arab Emirates | |
96 | 98 | new Validator("AL", 28, "AL\\d{10}[A-Z0-9]{16}" ), // Albania |
97 | new Validator("AD", 24, "AD\\d{10}[A-Z0-9]{12}" ), // Andorra | |
98 | 99 | new Validator("AT", 20, "AT\\d{18}" ), // Austria |
99 | 100 | new Validator("AZ", 28, "AZ\\d{2}[A-Z]{4}[A-Z0-9]{20}" ), // Republic of Azerbaijan |
101 | new Validator("BA", 20, "BA\\d{18}" ), // Bosnia and Herzegovina | |
102 | new Validator("BE", 16, "BE\\d{14}" ), // Belgium | |
103 | new Validator("BG", 22, "BG\\d{2}[A-Z]{4}\\d{6}[A-Z0-9]{8}" ), // Bulgaria | |
100 | 104 | new Validator("BH", 22, "BH\\d{2}[A-Z]{4}[A-Z0-9]{14}" ), // Bahrain (Kingdom of) |
101 | new Validator("BE", 16, "BE\\d{14}" ), // Belgium | |
102 | new Validator("BA", 20, "BA\\d{18}" ), // Bosnia and Herzegovina | |
103 | 105 | new Validator("BR", 29, "BR\\d{25}[A-Z]{1}[A-Z0-9]{1}" ), // Brazil |
104 | new Validator("BG", 22, "BG\\d{2}[A-Z]{4}\\d{6}[A-Z0-9]{8}" ), // Bulgaria | |
105 | new Validator("CR", 21, "CR\\d{19}" ), // Costa Rica | |
106 | new Validator("HR", 21, "HR\\d{19}" ), // Croatia | |
106 | new Validator("BY", 28, "BY\\d{2}[A-Z0-9]{4}\\d{4}[A-Z0-9]{16}" ), // Republic of Belarus | |
107 | new Validator("CH", 21, "CH\\d{7}[A-Z0-9]{12}" ), // Switzerland | |
108 | new Validator("CR", 22, "CR\\d{20}" ), // Costa Rica | |
107 | 109 | new Validator("CY", 28, "CY\\d{10}[A-Z0-9]{16}" ), // Cyprus |
108 | 110 | new Validator("CZ", 24, "CZ\\d{22}" ), // Czech Republic |
111 | new Validator("DE", 22, "DE\\d{20}" ), // Germany | |
109 | 112 | new Validator("DK", 18, "DK\\d{16}" ), // Denmark |
110 | new Validator("FO", 18, "FO\\d{16}" ), // Denmark (Faroes) | |
111 | new Validator("GL", 18, "GL\\d{16}" ), // Denmark (Greenland) | |
112 | 113 | new Validator("DO", 28, "DO\\d{2}[A-Z0-9]{4}\\d{20}" ), // Dominican Republic |
113 | 114 | new Validator("EE", 20, "EE\\d{18}" ), // Estonia |
115 | new Validator("ES", 24, "ES\\d{22}" ), // Spain | |
114 | 116 | new Validator("FI", 18, "FI\\d{16}" ), // Finland |
117 | new Validator("FO", 18, "FO\\d{16}" ), // Denmark (Faroes) | |
115 | 118 | new Validator("FR", 27, "FR\\d{12}[A-Z0-9]{11}\\d{2}" ), // France |
119 | new Validator("GB", 22, "GB\\d{2}[A-Z]{4}\\d{14}" ), // United Kingdom | |
116 | 120 | new Validator("GE", 22, "GE\\d{2}[A-Z]{2}\\d{16}" ), // Georgia |
117 | new Validator("DE", 22, "DE\\d{20}" ), // Germany | |
118 | 121 | new Validator("GI", 23, "GI\\d{2}[A-Z]{4}[A-Z0-9]{15}" ), // Gibraltar |
122 | new Validator("GL", 18, "GL\\d{16}" ), // Denmark (Greenland) | |
119 | 123 | new Validator("GR", 27, "GR\\d{9}[A-Z0-9]{16}" ), // Greece |
120 | 124 | new Validator("GT", 28, "GT\\d{2}[A-Z0-9]{24}" ), // Guatemala |
125 | new Validator("HR", 21, "HR\\d{19}" ), // Croatia | |
121 | 126 | new Validator("HU", 28, "HU\\d{26}" ), // Hungary |
122 | new Validator("IS", 26, "IS\\d{24}" ), // Iceland | |
123 | 127 | new Validator("IE", 22, "IE\\d{2}[A-Z]{4}\\d{14}" ), // Ireland |
124 | 128 | new Validator("IL", 23, "IL\\d{21}" ), // Israel |
129 | new Validator("IS", 26, "IS\\d{24}" ), // Iceland | |
125 | 130 | new Validator("IT", 27, "IT\\d{2}[A-Z]{1}\\d{10}[A-Z0-9]{12}" ), // Italy |
131 | new Validator("IQ", 23, "IQ\\d{2}[A-Z]{4}\\d{15}" ), // Iraq | |
126 | 132 | new Validator("JO", 30, "JO\\d{2}[A-Z]{4}\\d{4}[A-Z0-9]{18}" ), // Jordan |
133 | new Validator("KW", 30, "KW\\d{2}[A-Z]{4}[A-Z0-9]{22}" ), // Kuwait | |
127 | 134 | new Validator("KZ", 20, "KZ\\d{5}[A-Z0-9]{13}" ), // Kazakhstan |
128 | new Validator("XK", 20, "XK\\d{18}" ), // Republic of Kosovo | |
129 | new Validator("KW", 30, "KW\\d{2}[A-Z]{4}[A-Z0-9]{22}" ), // Kuwait | |
130 | new Validator("LV", 21, "LV\\d{2}[A-Z]{4}[A-Z0-9]{13}" ), // Latvia | |
131 | 135 | new Validator("LB", 28, "LB\\d{6}[A-Z0-9]{20}" ), // Lebanon |
136 | new Validator("LC", 32, "LC\\d{2}[A-Z]{4}[A-Z0-9]{24}" ), // Saint Lucia | |
132 | 137 | new Validator("LI", 21, "LI\\d{7}[A-Z0-9]{12}" ), // Liechtenstein (Principality of) |
133 | 138 | new Validator("LT", 20, "LT\\d{18}" ), // Lithuania |
134 | 139 | new Validator("LU", 20, "LU\\d{5}[A-Z0-9]{13}" ), // Luxembourg |
140 | new Validator("LV", 21, "LV\\d{2}[A-Z]{4}[A-Z0-9]{13}" ), // Latvia | |
141 | new Validator("MC", 27, "MC\\d{12}[A-Z0-9]{11}\\d{2}" ), // Monaco | |
142 | new Validator("MD", 24, "MD\\d{2}[A-Z0-9]{20}" ), // Moldova | |
143 | new Validator("ME", 22, "ME\\d{20}" ), // Montenegro | |
135 | 144 | new Validator("MK", 19, "MK\\d{5}[A-Z0-9]{10}\\d{2}" ), // Macedonia, Former Yugoslav Republic of |
145 | new Validator("MR", 27, "MR\\d{25}" ), // Mauritania | |
136 | 146 | new Validator("MT", 31, "MT\\d{2}[A-Z]{4}\\d{5}[A-Z0-9]{18}" ), // Malta |
137 | new Validator("MR", 27, "MR13\\d{23}" ), // Mauritania | |
138 | 147 | new Validator("MU", 30, "MU\\d{2}[A-Z]{4}\\d{19}[A-Z]{3}" ), // Mauritius |
139 | new Validator("MD", 24, "MD\\d{2}[A-Z0-9]{20}" ), // Moldova | |
140 | new Validator("MC", 27, "MC\\d{12}[A-Z0-9]{11}\\d{2}" ), // Monaco | |
141 | new Validator("ME", 22, "ME\\d{20}" ), // Montenegro | |
142 | 148 | new Validator("NL", 18, "NL\\d{2}[A-Z]{4}\\d{10}" ), // The Netherlands |
143 | 149 | new Validator("NO", 15, "NO\\d{13}" ), // Norway |
144 | 150 | new Validator("PK", 24, "PK\\d{2}[A-Z]{4}[A-Z0-9]{16}" ), // Pakistan |
151 | new Validator("PL", 28, "PL\\d{26}" ), // Poland | |
145 | 152 | new Validator("PS", 29, "PS\\d{2}[A-Z]{4}[A-Z0-9]{21}" ), // Palestine, State of |
146 | new Validator("PL", 28, "PL\\d{26}" ), // Poland | |
147 | 153 | new Validator("PT", 25, "PT\\d{23}" ), // Portugal |
148 | 154 | new Validator("QA", 29, "QA\\d{2}[A-Z]{4}[A-Z0-9]{21}" ), // Qatar |
149 | 155 | new Validator("RO", 24, "RO\\d{2}[A-Z]{4}[A-Z0-9]{16}" ), // Romania |
150 | new Validator("LC", 32, "LC\\d{2}[A-Z]{4}\\d{24}" ), // Saint Lucia | |
156 | new Validator("RS", 22, "RS\\d{20}" ), // Serbia | |
157 | new Validator("SA", 24, "SA\\d{4}[A-Z0-9]{18}" ), // Saudi Arabia | |
158 | new Validator("SC", 31, "SC\\d{2}[A-Z]{4}\\d{20}[A-Z]{3}" ), // Seychelles | |
159 | new Validator("SE", 24, "SE\\d{22}" ), // Sweden | |
160 | new Validator("SI", 19, "SI\\d{17}" ), // Slovenia | |
161 | new Validator("SK", 24, "SK\\d{22}" ), // Slovak Republic | |
151 | 162 | new Validator("SM", 27, "SM\\d{2}[A-Z]{1}\\d{10}[A-Z0-9]{12}" ), // San Marino |
152 | new Validator("ST", 25, "ST\\d{23}" ), // Sao Tome And Principe | |
153 | new Validator("SA", 24, "SA\\d{4}[A-Z0-9]{18}" ), // Saudi Arabia | |
154 | new Validator("RS", 22, "RS\\d{20}" ), // Serbia | |
155 | new Validator("SK", 24, "SK\\d{22}" ), // Slovak Republic | |
156 | new Validator("SI", 19, "SI\\d{17}" ), // Slovenia | |
157 | new Validator("ES", 24, "ES\\d{22}" ), // Spain | |
158 | new Validator("SE", 24, "SE\\d{22}" ), // Sweden | |
159 | new Validator("CH", 21, "CH\\d{7}[A-Z0-9]{12}" ), // Switzerland | |
163 | new Validator("ST", 25, "ST\\d{23}" ), // Sao Tome and Principe | |
160 | 164 | new Validator("TL", 23, "TL\\d{21}" ), // Timor-Leste |
161 | new Validator("TN", 24, "TN59\\d{20}" ), // Tunisia | |
165 | new Validator("TN", 24, "TN\\d{22}" ), // Tunisia | |
162 | 166 | new Validator("TR", 26, "TR\\d{8}[A-Z0-9]{16}" ), // Turkey |
163 | new Validator("AE", 23, "AE\\d{21}" ), // United Arab Emirates | |
164 | new Validator("GB", 22, "GB\\d{2}[A-Z]{4}\\d{14}" ), // United Kingdom | |
167 | new Validator("UA", 29, "UA\\d{8}[A-Z0-9]{19}" ), // Ukraine | |
165 | 168 | new Validator("VG", 24, "VG\\d{2}[A-Z]{4}\\d{16}" ), // Virgin Islands, British |
169 | new Validator("XK", 20, "XK\\d{18}" ), // Republic of Kosovo | |
166 | 170 | }; |
167 | 171 | |
168 | 172 | /** The singleton instance which uses the default formats */ |
47 | 47 | * |
48 | 48 | * </pre> |
49 | 49 | * <p> |
50 | * Note: the {@link #isValid(String)} and {@link } methods strip off any leading | |
50 | * Note: the {@link #isValid(String)} and {@link #validate(String)} methods strip off any leading | |
51 | 51 | * or trailing spaces before doing the validation. |
52 | 52 | * To ensure that only a valid code (without 'ISSN ' prefix) is passed to a method, |
53 | 53 | * use the following code: |
30 | 30 | * This class is a Singleton; you can retrieve the instance via the {@link #getInstance()} method. |
31 | 31 | * </p> |
32 | 32 | * |
33 | * @version $Revision: 1739361 $ | |
33 | * @version $Revision: 1783032 $ | |
34 | 34 | * @since Validator 1.4 |
35 | 35 | */ |
36 | 36 | public class InetAddressValidator implements Serializable { |
148 | 148 | return false; |
149 | 149 | } |
150 | 150 | int validOctets = 0; |
151 | int emptyOctets = 0; | |
151 | int emptyOctets = 0; // consecutive empty chunks | |
152 | 152 | for (int index = 0; index < octets.length; index++) { |
153 | 153 | String octet = octets[index]; |
154 | 154 | if (octet.length() == 0) { |
158 | 158 | } |
159 | 159 | } else { |
160 | 160 | emptyOctets = 0; |
161 | if (octet.contains(".")) { // contains is Java 1.5+ | |
162 | if (!inet6Address.endsWith(octet)) { | |
163 | return false; | |
164 | } | |
165 | if (index > octets.length - 1 || index > 6) { // CHECKSTYLE IGNORE MagicNumber | |
166 | // IPV4 occupies last two octets | |
167 | return false; | |
168 | } | |
161 | // Is last chunk an IPv4 address? | |
162 | if (index == octets.length - 1 && octet.contains(".")) { | |
169 | 163 | if (!isValidInet4Address(octet)) { |
170 | 164 | return false; |
171 | 165 | } |
177 | 171 | } |
178 | 172 | int octetInt = 0; |
179 | 173 | try { |
180 | octetInt = Integer.valueOf(octet, BASE_16).intValue(); | |
174 | octetInt = Integer.parseInt(octet, BASE_16); | |
181 | 175 | } catch (NumberFormatException e) { |
182 | 176 | return false; |
183 | 177 | } |
187 | 181 | } |
188 | 182 | validOctets++; |
189 | 183 | } |
190 | if (validOctets < IPV6_MAX_HEX_GROUPS && !containsCompressedZeroes) { | |
184 | if (validOctets > IPV6_MAX_HEX_GROUPS || (validOctets < IPV6_MAX_HEX_GROUPS && !containsCompressedZeroes)) { | |
191 | 185 | return false; |
192 | 186 | } |
193 | 187 | return true; |
58 | 58 | * <li>using a specified pattern with a specified <code>Locale</code></li> |
59 | 59 | * </ul> |
60 | 60 | * |
61 | * @version $Revision: 1739356 $ | |
61 | * @version $Revision: 1782756 $ | |
62 | 62 | * @since Validator 1.3.0 |
63 | 63 | */ |
64 | 64 | public class IntegerValidator extends AbstractNumberValidator { |
249 | 249 | longValue > Integer.MAX_VALUE) { |
250 | 250 | return null; |
251 | 251 | } |
252 | return new Integer((int)longValue); | |
252 | return Integer.valueOf((int)longValue); | |
253 | 253 | } |
254 | 254 | } |
70 | 70 | * Uniform Resource Identifiers (URI): Generic Syntax |
71 | 71 | * </a> |
72 | 72 | * |
73 | * @version $Revision: 1715435 $ | |
73 | * @version $Revision: 1783203 $ | |
74 | 74 | * @since Validator 1.4 |
75 | 75 | */ |
76 | 76 | public class UrlValidator implements Serializable { |
77 | 77 | |
78 | 78 | private static final long serialVersionUID = 7557161713937335013L; |
79 | ||
80 | private static final int MAX_UNSIGNED_16_BIT_INT = 0xFFFF; // port max | |
79 | 81 | |
80 | 82 | /** |
81 | 83 | * Allows all validly formatted schemes to pass validation instead of |
144 | 146 | private static final String USERINFO_CHARS_REGEX = "[a-zA-Z0-9%-._~!$&'()*+,;=]"; |
145 | 147 | // since neither ':' nor '@' are allowed chars, we don't need to use non-greedy matching |
146 | 148 | private static final String USERINFO_FIELD_REGEX = |
147 | USERINFO_CHARS_REGEX + "+:" + // At least one character for the name | |
148 | USERINFO_CHARS_REGEX + "*@"; // password may be absent | |
149 | USERINFO_CHARS_REGEX + "+" + // At least one character for the name | |
150 | "(?::" + USERINFO_CHARS_REGEX + "*)?@"; // colon and password may be absent | |
149 | 151 | private static final String AUTHORITY_REGEX = |
150 | "(?:\\[("+IPV6_REGEX+")\\]|(?:(?:"+USERINFO_FIELD_REGEX+")?([" + AUTHORITY_CHARS_REGEX + "]*)))(:\\d*)?(.*)?"; | |
151 | // 1 e.g. user:pass@ 2 3 4 | |
152 | "(?:\\[("+IPV6_REGEX+")\\]|(?:(?:"+USERINFO_FIELD_REGEX+")?([" + AUTHORITY_CHARS_REGEX + "]*)))(?::(\\d*))?(.*)?"; | |
153 | // 1 e.g. user:pass@ 2 3 4 | |
152 | 154 | private static final Pattern AUTHORITY_PATTERN = Pattern.compile(AUTHORITY_REGEX); |
153 | 155 | |
154 | 156 | private static final int PARSE_AUTHORITY_IPV6 = 1; |
155 | 157 | |
156 | 158 | private static final int PARSE_AUTHORITY_HOST_IP = 2; // excludes userinfo, if present |
157 | 159 | |
158 | // Not needed, because it is validated by AUTHORITY_REGEX | |
159 | // private static final int PARSE_AUTHORITY_PORT = 3; | |
160 | private static final int PARSE_AUTHORITY_PORT = 3; // excludes leading colon | |
160 | 161 | |
161 | 162 | /** |
162 | 163 | * Should always be empty. The code currently allows spaces. |
166 | 167 | private static final String PATH_REGEX = "^(/[-\\w:@&?=+,.!/~*'%$_;\\(\\)]*)?$"; |
167 | 168 | private static final Pattern PATH_PATTERN = Pattern.compile(PATH_REGEX); |
168 | 169 | |
169 | private static final String QUERY_REGEX = "^(.*)$"; | |
170 | private static final String QUERY_REGEX = "^(\\S*)$"; | |
170 | 171 | private static final Pattern QUERY_PATTERN = Pattern.compile(QUERY_REGEX); |
171 | 172 | |
172 | 173 | /** |
311 | 312 | |
312 | 313 | String authority = urlMatcher.group(PARSE_URL_AUTHORITY); |
313 | 314 | if ("file".equals(scheme)) {// Special case - file: allows an empty authority |
314 | if (!"".equals(authority)) { | |
315 | if (authority != null) { | |
315 | 316 | if (authority.contains(":")) { // but cannot allow trailing : |
316 | 317 | return false; |
317 | 318 | } |
412 | 413 | return false; |
413 | 414 | } |
414 | 415 | } |
416 | String port = authorityMatcher.group(PARSE_AUTHORITY_PORT); | |
417 | if (port != null && port.length() > 0) { | |
418 | try { | |
419 | int iPort = Integer.parseInt(port); | |
420 | if (iPort < 0 || iPort > MAX_UNSIGNED_16_BIT_INT) { | |
421 | return false; | |
422 | } | |
423 | } catch (NumberFormatException nfe) { | |
424 | return false; // this can happen for big numbers | |
425 | } | |
426 | } | |
415 | 427 | } |
416 | 428 | |
417 | 429 | String extra = authorityMatcher.group(PARSE_AUTHORITY_EXTRA); |
+243
-0
0 | /* | |
1 | * Licensed to the Apache Software Foundation (ASF) under one or more | |
2 | * contributor license agreements. See the NOTICE file distributed with | |
3 | * this work for additional information regarding copyright ownership. | |
4 | * The ASF licenses this file to You under the Apache License, Version 2.0 | |
5 | * (the "License"); you may not use this file except in compliance with | |
6 | * the License. You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
15 | */ | |
16 | package org.apache.commons.validator.routines.checkdigit; | |
17 | ||
18 | import java.util.Arrays; | |
19 | ||
20 | import org.apache.commons.validator.routines.CodeValidator; | |
21 | ||
22 | /** | |
23 | * General Modulus 10 Check Digit calculation/validation. | |
24 | * | |
25 | * <h3>How if Works</h3> | |
26 | * <p> | |
27 | * This implementation calculates/validates the check digit in the following | |
28 | * way: | |
29 | * <ul> | |
30 | * <li>Converting each character to an integer value using | |
31 | * <code>Character.getNumericValue(char)</code> - negative integer values from | |
32 | * that method are invalid.</li> | |
33 | * <li>Calculating a <i>weighted value</i> by multiplying the character's | |
34 | * integer value by a <i>weighting factor</i>. The <i>weighting factor</i> is | |
35 | * selected from the configured <code>postitionWeight</code> array based on its | |
36 | * position. The <code>postitionWeight</code> values are used either | |
37 | * left-to-right (when <code>useRightPos=false</code>) or right-to-left (when | |
38 | * <code>useRightPos=true</code>).</li> | |
39 | * <li>If <code>sumWeightedDigits=true</code>, the <i>weighted value</i> is | |
40 | * re-calculated by summing its digits.</li> | |
41 | * <li>The <i>weighted values</i> of each character are totalled.</li> | |
42 | * <li>The total modulo 10 will be zero for a code with a valid Check Digit.</li> | |
43 | * </ul> | |
44 | * <h3>Limitations</h3> | |
45 | * <p> | |
46 | * This implementation has the following limitations: | |
47 | * <ul> | |
48 | * <li>It assumes the last character in the code is the Check Digit and | |
49 | * validates that it is a numeric character.</li> | |
50 | * <li>The only limitation on valid characters are those that | |
51 | * <code>Character.getNumericValue(char)</code> returns a positive value. If, | |
52 | * for example, the code should only contain numbers, this implementation does | |
53 | * not check that.</li> | |
54 | * <li>There are no checks on code length.</li> | |
55 | * </ul> | |
56 | * <p> | |
57 | * <b>Note:</b> This implementation can be combined with the | |
58 | * {@link CodeValidator} in order to ensure the length and characters are valid. | |
59 | * | |
60 | * <h3>Example Usage</h3> | |
61 | * <p> | |
62 | * This implementation was added after a number of Modulus 10 routines and these | |
63 | * are shown re-implemented using this routine below: | |
64 | * | |
65 | * <p> | |
66 | * <b>ABA Number</b> Check Digit Routine (equivalent of | |
67 | * {@link ABANumberCheckDigit}). Weighting factors are <code>[1, 7, 3]</code> | |
68 | * applied from right to left. | |
69 | * | |
70 | * <pre> | |
71 | * CheckDigit routine = new ModulusTenCheckDigit(new int[] { 1, 7, 3 }, true); | |
72 | * </pre> | |
73 | * | |
74 | * <p> | |
75 | * <b>CUSIP</b> Check Digit Routine (equivalent of {@link CUSIPCheckDigit}). | |
76 | * Weighting factors are <code>[1, 2]</code> applied from right to left and the | |
77 | * digits of the <i>weighted value</i> are summed. | |
78 | * | |
79 | * <pre> | |
80 | * CheckDigit routine = new ModulusTenCheckDigit(new int[] { 1, 2 }, true, true); | |
81 | * </pre> | |
82 | * | |
83 | * <p> | |
84 | * <b>EAN-13 / UPC</b> Check Digit Routine (equivalent of | |
85 | * {@link EAN13CheckDigit}). Weighting factors are <code>[1, 3]</code> applied | |
86 | * from right to left. | |
87 | * | |
88 | * <pre> | |
89 | * CheckDigit routine = new ModulusTenCheckDigit(new int[] { 1, 3 }, true); | |
90 | * </pre> | |
91 | * | |
92 | * <p> | |
93 | * <b>Luhn</b> Check Digit Routine (equivalent of {@link LuhnCheckDigit}). | |
94 | * Weighting factors are <code>[1, 2]</code> applied from right to left and the | |
95 | * digits of the <i>weighted value</i> are summed. | |
96 | * | |
97 | * <pre> | |
98 | * CheckDigit routine = new ModulusTenCheckDigit(new int[] { 1, 2 }, true, true); | |
99 | * </pre> | |
100 | * | |
101 | * <p> | |
102 | * <b>SEDOL</b> Check Digit Routine (equivalent of {@link SedolCheckDigit}). | |
103 | * Weighting factors are <code>[1, 3, 1, 7, 3, 9, 1]</code> applied from left to | |
104 | * right. | |
105 | * | |
106 | * <pre> | |
107 | * CheckDigit routine = new ModulusTenCheckDigit(new int[] { 1, 3, 1, 7, 3, 9, 1 }); | |
108 | * </pre> | |
109 | * | |
110 | * @since Validator 1.6 | |
111 | * @version $Revision: 1739356 $ | |
112 | */ | |
113 | public final class ModulusTenCheckDigit extends ModulusCheckDigit { | |
114 | ||
115 | private static final long serialVersionUID = -3752929983453368497L; | |
116 | ||
117 | private final int[] postitionWeight; | |
118 | private final boolean useRightPos; | |
119 | private final boolean sumWeightedDigits; | |
120 | ||
121 | /** | |
122 | * Construct a modulus 10 Check Digit routine with the specified weighting | |
123 | * from left to right. | |
124 | * | |
125 | * @param postitionWeight the weighted values to apply based on the | |
126 | * character position | |
127 | */ | |
128 | public ModulusTenCheckDigit(int[] postitionWeight) { | |
129 | this(postitionWeight, false, false); | |
130 | } | |
131 | ||
132 | /** | |
133 | * Construct a modulus 10 Check Digit routine with the specified weighting, | |
134 | * indicating whether its from the left or right. | |
135 | * | |
136 | * @param postitionWeight the weighted values to apply based on the | |
137 | * character position | |
138 | * @param useRightPos <code>true</code> if use positionWeights from right to | |
139 | * left | |
140 | */ | |
141 | public ModulusTenCheckDigit(int[] postitionWeight, boolean useRightPos) { | |
142 | this(postitionWeight, useRightPos, false); | |
143 | } | |
144 | ||
145 | /** | |
146 | * Construct a modulus 10 Check Digit routine with the specified weighting, | |
147 | * indicating whether its from the left or right and whether the weighted | |
148 | * digits should be summed. | |
149 | * | |
150 | * @param postitionWeight the weighted values to apply based on the | |
151 | * character position | |
152 | * @param useRightPos <code>true</code> if use positionWeights from right to | |
153 | * left | |
154 | * @param sumWeightedDigits <code>true</code> if sum the digits of the | |
155 | * weighted value | |
156 | */ | |
157 | public ModulusTenCheckDigit(int[] postitionWeight, boolean useRightPos, boolean sumWeightedDigits) { | |
158 | super(10); // CHECKSTYLE IGNORE MagicNumber | |
159 | this.postitionWeight = Arrays.copyOf(postitionWeight, postitionWeight.length); | |
160 | this.useRightPos = useRightPos; | |
161 | this.sumWeightedDigits = sumWeightedDigits; | |
162 | } | |
163 | ||
164 | /** | |
165 | * Validate a modulus check digit for a code. | |
166 | * <p> | |
167 | * Note: assumes last digit is the check digit | |
168 | * | |
169 | * @param code The code to validate | |
170 | * @return <code>true</code> if the check digit is valid, otherwise | |
171 | * <code>false</code> | |
172 | */ | |
173 | @Override | |
174 | public boolean isValid(String code) { | |
175 | if (code == null || code.length() == 0) { | |
176 | return false; | |
177 | } | |
178 | if (!Character.isDigit(code.charAt(code.length() - 1))) { | |
179 | return false; | |
180 | } | |
181 | ||
182 | return super.isValid(code); | |
183 | } | |
184 | ||
185 | /** | |
186 | * Convert a character at a specified position to an integer value. | |
187 | * <p> | |
188 | * <b>Note:</b> this implementation only handlers values that | |
189 | * Character.getNumericValue(char) returns a non-negative number. | |
190 | * | |
191 | * @param character The character to convert | |
192 | * @param leftPos The position of the character in the code, counting from | |
193 | * left to right (for identifying the position in the string) | |
194 | * @param rightPos The position of the character in the code, counting from | |
195 | * right to left (not used here) | |
196 | * @return The integer value of the character | |
197 | * @throws CheckDigitException if Character.getNumericValue(char) returns a | |
198 | * negative number | |
199 | */ | |
200 | @Override | |
201 | protected int toInt(char character, int leftPos, int rightPos) throws CheckDigitException { | |
202 | int num = Character.getNumericValue(character); | |
203 | if (num < 0) { | |
204 | throw new CheckDigitException("Invalid Character[" + leftPos + "] = '" + character + "'"); | |
205 | } | |
206 | return num; | |
207 | } | |
208 | ||
209 | /** | |
210 | * Calculates the <i>weighted</i> value of a character in the code at a | |
211 | * specified position. | |
212 | * | |
213 | * @param charValue The numeric value of the character. | |
214 | * @param leftPos The position of the character in the code, counting from | |
215 | * left to right | |
216 | * @param rightPos The position of the character in the code, counting from | |
217 | * right to left | |
218 | * @return The weighted value of the character. | |
219 | */ | |
220 | @Override | |
221 | protected int weightedValue(int charValue, int leftPos, int rightPos) { | |
222 | int pos = useRightPos ? rightPos : leftPos; | |
223 | int weight = postitionWeight[(pos - 1) % postitionWeight.length]; | |
224 | int weightedValue = charValue * weight; | |
225 | if (sumWeightedDigits) { | |
226 | weightedValue = ModulusCheckDigit.sumDigits(weightedValue); | |
227 | } | |
228 | return weightedValue; | |
229 | } | |
230 | ||
231 | /** | |
232 | * Return a string representation of this implementation. | |
233 | * | |
234 | * @return a string representation | |
235 | */ | |
236 | @Override | |
237 | public String toString() { | |
238 | return getClass().getSimpleName() + "[postitionWeight=" + Arrays.toString(postitionWeight) + ", useRightPos=" | |
239 | + useRightPos + ", sumWeightedDigits=" + sumWeightedDigits + "]"; | |
240 | } | |
241 | ||
242 | } |
37 | 37 | <item name="Wiki" href="http://wiki.apache.org/commons/Validator"/> |
38 | 38 | </menu> |
39 | 39 | |
40 | <menu name="JavaDocs"> | |
41 | <item name="1.5.1 Release" href="javadocs/api-1.5.1/"/> | |
42 | <item name="1.5.0 Release" href="javadocs/api-1.5.0/"/> | |
43 | <item name="1.4.1 Release" href="javadocs/api-1.4.1/"/> | |
44 | <item name="1.4.0 Release" href="javadocs/api-1.4.0/"/> | |
45 | <item name="1.3.1 Release" href="javadocs/api-1.3.1/"/> | |
46 | <item name="1.3.0 Release" href="javadocs/api-1.3.0/"/> | |
47 | <item name="1.2.0 Release" href="javadocs/api-1.2.0/"/> | |
48 | <item name="1.1.4 Release" href="javadocs/api-1.1.4/"/> | |
49 | <item name="1.0.2 Release" href="javadocs/api-1.0.2/"/> | |
50 | </menu> | |
51 | ||
52 | 40 | <menu name="Development"> |
53 | 41 | <item name="JavaDocs" href="/apidocs/index.html"/> |
54 | 42 | <item name="Mailing Lists" href="/mail-lists.html"/> |
30 | 30 | | 2) Set the following properties in the component's pom: | |
31 | 31 | | - commons.componentid (required, alphabetic, lower case) | |
32 | 32 | | - commons.release.version (required) | |
33 | | - commons.binary.suffix (optional) | | |
33 | | - commons.release.name (required) | | |
34 | | - commons.binary.suffix (optional) | | |
34 | 35 | | (defaults to "-bin", set to "" for pre-maven2 releases) | |
36 | | - commons.release.desc (optional) | | |
37 | | - commons.release.subdir (optional) | | |
38 | | | | |
39 | | - commons.release.2/3.version (conditional) | | |
40 | | - commons.release.2/3.name (conditional) | | |
41 | | - commons.release.2/3.binary.suffix (optional) | | |
42 | | - commons.release.2/3.desc (optional) | | |
43 | | - commons.release.2/3.subdir (optional) | | |
35 | 44 | | | |
36 | 45 | | 3) Example Properties | |
46 | | (commons.release.name inherited by parent: | | |
47 | | ${project.artifactId}-${commons.release.version} | | |
37 | 48 | | | |
38 | 49 | | <properties> | |
39 | 50 | | <commons.componentid>math</commons.componentid> | |
45 | 56 | <document> |
46 | 57 | <properties> |
47 | 58 | <title>Download Apache Commons Validator</title> |
48 | <author email="dev@commons.apache.org">Commons Documentation Team</author> | |
59 | <author email="dev@commons.apache.org">Apache Commons Documentation Team</author> | |
49 | 60 | </properties> |
50 | 61 | <body> |
51 | 62 | <section name="Download Apache Commons Validator"> |
52 | 63 | <subsection name="Using a Mirror"> |
53 | 64 | <p> |
54 | 65 | We recommend you use a mirror to download our release |
55 | builds, but you <strong>must</strong> verify the integrity of | |
66 | builds, but you <strong>must</strong> <a href="http://www.apache.org/info/verification.html">verify the integrity</a> of | |
56 | 67 | the downloaded files using signatures downloaded from our main |
57 | 68 | distribution directories. Recent releases (48 hours) may not yet |
58 | be available from the mirrors. | |
69 | be available from all the mirrors. | |
59 | 70 | </p> |
60 | 71 | |
61 | 72 | <p> |
87 | 98 | </form> |
88 | 99 | |
89 | 100 | <p> |
90 | The <a href="http://www.apache.org/dist/commons/KEYS">KEYS</a> | |
91 | link links to the code signing keys used to sign the product. | |
92 | The <code>PGP</code> link downloads the OpenPGP compatible signature from our main site. | |
93 | The <code>MD5</code> link downloads the checksum from the main site. | |
101 | It is essential that you | |
102 | <a href="https://www.apache.org/info/verification.html">verify the integrity</a> | |
103 | of downloaded files, preferably using the <code>PGP</code> signature (<code>*.asc</code> files); | |
104 | failing that using the <code>MD5</code> hash (<code>*.md5</code> checksum files). | |
105 | </p> | |
106 | <p> | |
107 | The <a href="https://www.apache.org/dist/commons/KEYS">KEYS</a> | |
108 | file contains the public PGP keys used by Apache Commons developers | |
109 | to sign releases. | |
94 | 110 | </p> |
95 | 111 | </subsection> |
96 | 112 | </section> |
97 | <section name="Apache Commons Validator 1.5.1 (requires JDK 1.6)"> | |
113 | <section name="Apache Commons Validator 1.6 (requires JDK 1.6)"> | |
98 | 114 | <subsection name="Binaries"> |
99 | 115 | <table> |
100 | 116 | <tr> |
101 | <td><a href="[preferred]/commons/validator/binaries/commons-validator-1.5.1-bin.tar.gz">commons-validator-1.5.1-bin.tar.gz</a></td> | |
102 | <td><a href="http://www.apache.org/dist/commons/validator/binaries/commons-validator-1.5.1-bin.tar.gz.md5">md5</a></td> | |
103 | <td><a href="http://www.apache.org/dist/commons/validator/binaries/commons-validator-1.5.1-bin.tar.gz.asc">pgp</a></td> | |
117 | <td><a href="[preferred]/commons/validator/binaries/commons-validator-1.6-bin.tar.gz">commons-validator-1.6-bin.tar.gz</a></td> | |
118 | <td><a href="https://www.apache.org/dist/commons/validator/binaries/commons-validator-1.6-bin.tar.gz.md5">md5</a></td> | |
119 | <td><a href="https://www.apache.org/dist/commons/validator/binaries/commons-validator-1.6-bin.tar.gz.asc">pgp</a></td> | |
104 | 120 | </tr> |
105 | 121 | <tr> |
106 | <td><a href="[preferred]/commons/validator/binaries/commons-validator-1.5.1-bin.zip">commons-validator-1.5.1-bin.zip</a></td> | |
107 | <td><a href="http://www.apache.org/dist/commons/validator/binaries/commons-validator-1.5.1-bin.zip.md5">md5</a></td> | |
108 | <td><a href="http://www.apache.org/dist/commons/validator/binaries/commons-validator-1.5.1-bin.zip.asc">pgp</a></td> | |
122 | <td><a href="[preferred]/commons/validator/binaries/commons-validator-1.6-bin.zip">commons-validator-1.6-bin.zip</a></td> | |
123 | <td><a href="https://www.apache.org/dist/commons/validator/binaries/commons-validator-1.6-bin.zip.md5">md5</a></td> | |
124 | <td><a href="https://www.apache.org/dist/commons/validator/binaries/commons-validator-1.6-bin.zip.asc">pgp</a></td> | |
109 | 125 | </tr> |
110 | 126 | </table> |
111 | 127 | </subsection> |
112 | 128 | <subsection name="Source"> |
113 | 129 | <table> |
114 | 130 | <tr> |
115 | <td><a href="[preferred]/commons/validator/source/commons-validator-1.5.1-src.tar.gz">commons-validator-1.5.1-src.tar.gz</a></td> | |
116 | <td><a href="http://www.apache.org/dist/commons/validator/source/commons-validator-1.5.1-src.tar.gz.md5">md5</a></td> | |
117 | <td><a href="http://www.apache.org/dist/commons/validator/source/commons-validator-1.5.1-src.tar.gz.asc">pgp</a></td> | |
131 | <td><a href="[preferred]/commons/validator/source/commons-validator-1.6-src.tar.gz">commons-validator-1.6-src.tar.gz</a></td> | |
132 | <td><a href="https://www.apache.org/dist/commons/validator/source/commons-validator-1.6-src.tar.gz.md5">md5</a></td> | |
133 | <td><a href="https://www.apache.org/dist/commons/validator/source/commons-validator-1.6-src.tar.gz.asc">pgp</a></td> | |
118 | 134 | </tr> |
119 | 135 | <tr> |
120 | <td><a href="[preferred]/commons/validator/source/commons-validator-1.5.1-src.zip">commons-validator-1.5.1-src.zip</a></td> | |
121 | <td><a href="http://www.apache.org/dist/commons/validator/source/commons-validator-1.5.1-src.zip.md5">md5</a></td> | |
122 | <td><a href="http://www.apache.org/dist/commons/validator/source/commons-validator-1.5.1-src.zip.asc">pgp</a></td> | |
123 | </tr> | |
124 | </table> | |
125 | </subsection> | |
126 | </section> | |
127 | <section name="Apache Commons Validator 1.4.1 (requires JDK 1.4)"> | |
128 | <subsection name="Binaries"> | |
129 | <table> | |
130 | <tr> | |
131 | <td><a href="[preferred]/commons/validator/binaries/commons-validator-1.4.1.tar.gz">commons-validator-1.4.1.tar.gz</a></td> | |
132 | <td><a href="http://www.apache.org/dist/commons/validator/binaries/commons-validator-1.4.1.tar.gz.md5">md5</a></td> | |
133 | <td><a href="http://www.apache.org/dist/commons/validator/binaries/commons-validator-1.4.1.tar.gz.asc">pgp</a></td> | |
134 | </tr> | |
135 | <tr> | |
136 | <td><a href="[preferred]/commons/validator/binaries/commons-validator-1.4.1.zip">commons-validator-1.4.1.zip</a></td> | |
137 | <td><a href="http://www.apache.org/dist/commons/validator/binaries/commons-validator-1.4.1.zip.md5">md5</a></td> | |
138 | <td><a href="http://www.apache.org/dist/commons/validator/binaries/commons-validator-1.4.1.zip.asc">pgp</a></td> | |
139 | </tr> | |
140 | </table> | |
141 | </subsection> | |
142 | <subsection name="Source"> | |
143 | <table> | |
144 | <tr> | |
145 | <td><a href="[preferred]/commons/validator/source/commons-validator-1.4.1-src.tar.gz">commons-validator-1.4.1-src.tar.gz</a></td> | |
146 | <td><a href="http://www.apache.org/dist/commons/validator/source/commons-validator-1.4.1-src.tar.gz.md5">md5</a></td> | |
147 | <td><a href="http://www.apache.org/dist/commons/validator/source/commons-validator-1.4.1-src.tar.gz.asc">pgp</a></td> | |
148 | </tr> | |
149 | <tr> | |
150 | <td><a href="[preferred]/commons/validator/source/commons-validator-1.4.1-src.zip">commons-validator-1.4.1-src.zip</a></td> | |
151 | <td><a href="http://www.apache.org/dist/commons/validator/source/commons-validator-1.4.1-src.zip.md5">md5</a></td> | |
152 | <td><a href="http://www.apache.org/dist/commons/validator/source/commons-validator-1.4.1-src.zip.asc">pgp</a></td> | |
136 | <td><a href="[preferred]/commons/validator/source/commons-validator-1.6-src.zip">commons-validator-1.6-src.zip</a></td> | |
137 | <td><a href="https://www.apache.org/dist/commons/validator/source/commons-validator-1.6-src.zip.md5">md5</a></td> | |
138 | <td><a href="https://www.apache.org/dist/commons/validator/source/commons-validator-1.6-src.zip.asc">pgp</a></td> | |
153 | 139 | </tr> |
154 | 140 | </table> |
155 | 141 | </subsection> |
160 | 146 | </p> |
161 | 147 | <ul> |
162 | 148 | <li class="download"><a href="[preferred]/commons/validator/">browse download area</a></li> |
163 | <li><a href="http://archive.apache.org/dist/commons/validator/">archives...</a></li> | |
149 | <li><a href="https://archive.apache.org/dist/commons/validator/">archives...</a></li> | |
164 | 150 | </ul> |
165 | 151 | </section> |
166 | 152 | </body> |
23 | 23 | /** |
24 | 24 | * Performs Validation Test for locale validations. |
25 | 25 | * |
26 | * @version $Revision: 1739356 $ | |
26 | * @version $Revision: 1747121 $ | |
27 | 27 | */ |
28 | 28 | public class LocaleTest extends AbstractCommonTest { |
29 | 29 | |
47 | 47 | /** |
48 | 48 | * Load <code>ValidatorResources</code> from validator-locale.xml. |
49 | 49 | * |
50 | * @exception IOException If something goes wrong | |
51 | * @exception SAXException If something goes wrong | |
50 | * @throws IOException If something goes wrong | |
51 | * @throws SAXException If something goes wrong | |
52 | 52 | */ |
53 | 53 | @Override |
54 | 54 | protected void setUp() |
66 | 66 | * See what happens when we try to validate with a Locale, Country and |
67 | 67 | * variant. Also check if the added locale validation field is getting used. |
68 | 68 | * |
69 | * @exception ValidatorException If something goes wrong | |
69 | * @throws ValidatorException If something goes wrong | |
70 | 70 | */ |
71 | 71 | public void testLocale1() |
72 | 72 | throws ValidatorException { |
82 | 82 | * See what happens when we try to validate with a Locale, Country and |
83 | 83 | * variant |
84 | 84 | * |
85 | * @exception ValidatorException If something goes wrong | |
85 | * @throws ValidatorException If something goes wrong | |
86 | 86 | */ |
87 | 87 | public void testLocale2() |
88 | 88 | throws ValidatorException { |
98 | 98 | * See what happens when we try to validate with a Locale, Country and |
99 | 99 | * variant |
100 | 100 | * |
101 | * @exception ValidatorException If something goes wrong | |
101 | * @throws ValidatorException If something goes wrong | |
102 | 102 | */ |
103 | 103 | public void testLocale3() |
104 | 104 | throws ValidatorException { |
115 | 115 | * set. Bug #16920 states that this isn't happening, even though it is |
116 | 116 | * passing this test. see #16920. |
117 | 117 | * |
118 | * @exception ValidatorException If something goes wrong | |
118 | * @throws ValidatorException If something goes wrong | |
119 | 119 | */ |
120 | 120 | public void testLocale4() |
121 | 121 | throws ValidatorException { |
130 | 130 | /** |
131 | 131 | * See if a locale of language=en falls back to default form set. |
132 | 132 | * |
133 | * @exception ValidatorException If something goes wrong | |
133 | * @throws ValidatorException If something goes wrong | |
134 | 134 | */ |
135 | 135 | public void testLocale5() |
136 | 136 | throws ValidatorException { |
150 | 150 | * @param firstGood param |
151 | 151 | * @param lastGood param |
152 | 152 | * @param middleGood param |
153 | * @exception ValidatorException If something goes wrong | |
153 | * @throws ValidatorException If something goes wrong | |
154 | 154 | */ |
155 | 155 | private void valueTest(Object name, Locale loc, boolean firstGood, boolean lastGood, boolean middleGood) |
156 | 156 | throws ValidatorException { |
17 | 17 | |
18 | 18 | import junit.framework.TestCase; |
19 | 19 | import org.apache.commons.validator.routines.checkdigit.LuhnCheckDigit; |
20 | import org.apache.commons.validator.routines.CreditCardValidator.CreditCardRange; | |
20 | 21 | |
21 | 22 | /** |
22 | 23 | * Test the CreditCardValidator class. |
23 | 24 | * |
24 | * @version $Revision: 1739207 $ | |
25 | * @version $Revision: 1782740 $ | |
25 | 26 | */ |
26 | 27 | public class CreditCardValidatorTest extends TestCase { |
27 | 28 | |
28 | private static final String VALID_VISA = "4417123456789113"; | |
29 | private static final String ERROR_VISA = "4417123456789112"; | |
30 | private static final String VALID_SHORT_VISA = "4222222222222"; | |
29 | private static final String VALID_VISA = "4417123456789113"; // 16 | |
30 | private static final String ERROR_VISA = "4417123456789112"; | |
31 | private static final String VALID_SHORT_VISA = "4222222222222"; // 13 | |
31 | 32 | private static final String ERROR_SHORT_VISA = "4222222222229"; |
32 | private static final String VALID_AMEX = "378282246310005"; | |
33 | private static final String ERROR_AMEX = "378282246310001"; | |
33 | private static final String VALID_AMEX = "378282246310005"; // 15 | |
34 | private static final String ERROR_AMEX = "378282246310001"; | |
34 | 35 | private static final String VALID_MASTERCARD = "5105105105105100"; |
35 | 36 | private static final String ERROR_MASTERCARD = "5105105105105105"; |
36 | private static final String VALID_DISCOVER = "6011000990139424"; | |
37 | private static final String ERROR_DISCOVER = "6011000990139421"; | |
37 | private static final String VALID_DISCOVER = "6011000990139424"; | |
38 | private static final String ERROR_DISCOVER = "6011000990139421"; | |
38 | 39 | private static final String VALID_DISCOVER65 = "6534567890123458"; // FIXME need verified test data for Discover with "65" prefix |
39 | 40 | private static final String ERROR_DISCOVER65 = "6534567890123450"; // FIXME need verified test data for Discover with "65" prefix |
40 | private static final String VALID_DINERS = "30569309025904"; | |
41 | private static final String ERROR_DINERS = "30569309025901"; | |
42 | private static final String VALID_VPAY = "4370000000000061"; | |
43 | private static final String VALID_VPAY2 = "4370000000000012"; | |
44 | private static final String ERROR_VPAY = "4370000000000069"; | |
41 | private static final String VALID_DINERS = "30569309025904"; // 14 | |
42 | private static final String ERROR_DINERS = "30569309025901"; | |
43 | private static final String VALID_VPAY = "4370000000000061"; // 16 | |
44 | private static final String VALID_VPAY2 = "4370000000000012"; | |
45 | private static final String ERROR_VPAY = "4370000000000069"; | |
46 | ||
47 | private static final String [] VALID_CARDS = { | |
48 | VALID_VISA, | |
49 | VALID_SHORT_VISA, | |
50 | VALID_AMEX, | |
51 | VALID_MASTERCARD, | |
52 | VALID_DISCOVER, | |
53 | VALID_DISCOVER65, | |
54 | VALID_DINERS, | |
55 | VALID_VPAY, | |
56 | VALID_VPAY2, | |
57 | }; | |
58 | ||
59 | private static final String [] ERROR_CARDS = { | |
60 | ERROR_VISA, | |
61 | ERROR_SHORT_VISA, | |
62 | ERROR_AMEX, | |
63 | ERROR_MASTERCARD, | |
64 | ERROR_DISCOVER, | |
65 | ERROR_DISCOVER65, | |
66 | ERROR_DINERS, | |
67 | ERROR_VPAY, | |
68 | // ERROR_VPAY2, | |
69 | "", | |
70 | "12345678901", // too short (11) | |
71 | "12345678901234567890", // too long (20) | |
72 | "4417123456789112", // invalid check digit | |
73 | }; | |
45 | 74 | |
46 | 75 | /** |
47 | 76 | * Constructor for CreditCardValidatorTest. |
521 | 550 | assertEquals("Valid-D", "5123456789012346", validator.validate("5123456789012346")); |
522 | 551 | } |
523 | 552 | |
553 | public void testGeneric() { | |
554 | CreditCardValidator ccv = CreditCardValidator.genericCreditCardValidator(); | |
555 | for(String s : VALID_CARDS) { | |
556 | assertTrue(s, ccv.isValid(s)); | |
557 | } | |
558 | for(String s : ERROR_CARDS) { | |
559 | assertFalse(s, ccv.isValid(s)); | |
560 | } | |
561 | } | |
562 | ||
563 | public void testRangeGeneratorNoLuhn() { | |
564 | CodeValidator cv = CreditCardValidator.createRangeValidator( | |
565 | new CreditCardRange[]{ | |
566 | new CreditCardRange("1",null,6,7), | |
567 | new CreditCardRange("644","65", 8, 8) | |
568 | }, | |
569 | null); | |
570 | assertTrue(cv.isValid("1990000")); | |
571 | assertTrue(cv.isValid("199000")); | |
572 | assertFalse(cv.isValid("000000")); | |
573 | assertFalse(cv.isValid("099999")); | |
574 | assertFalse(cv.isValid("200000")); | |
575 | ||
576 | assertFalse(cv.isValid("64399999")); | |
577 | assertTrue(cv.isValid("64400000")); | |
578 | assertTrue(cv.isValid("64900000")); | |
579 | assertTrue(cv.isValid("65000000")); | |
580 | assertTrue(cv.isValid("65999999")); | |
581 | assertFalse(cv.isValid("66000000")); | |
582 | } | |
583 | ||
584 | public void testRangeGenerator() { | |
585 | CreditCardValidator ccv = new CreditCardValidator( | |
586 | new CodeValidator[] { | |
587 | CreditCardValidator.AMEX_VALIDATOR, | |
588 | CreditCardValidator.VISA_VALIDATOR, | |
589 | CreditCardValidator.MASTERCARD_VALIDATOR, | |
590 | CreditCardValidator.DISCOVER_VALIDATOR, | |
591 | }, | |
592 | // Add missing validator | |
593 | new CreditCardRange[]{ | |
594 | new CreditCardRange("300", "305", 14, 14), // Diners | |
595 | new CreditCardRange("3095", null, 14, 14), // Diners | |
596 | new CreditCardRange("36", null, 14, 14), // Diners | |
597 | new CreditCardRange("38", "39", 14, 14), // Diners | |
598 | } | |
599 | // we don't have any VPAY examples yet that aren't handled by VISA | |
600 | ); | |
601 | for(String s : VALID_CARDS) { | |
602 | assertTrue(s, ccv.isValid(s)); | |
603 | } | |
604 | for(String s : ERROR_CARDS) { | |
605 | assertFalse(s, ccv.isValid(s)); | |
606 | } | |
607 | } | |
608 | ||
609 | public void testValidLength() { | |
610 | assertTrue(CreditCardValidator.validLength(14, new CreditCardRange("", "", 14, 14))); | |
611 | assertFalse(CreditCardValidator.validLength(15, new CreditCardRange("", "", 14, 14))); | |
612 | assertFalse(CreditCardValidator.validLength(13, new CreditCardRange("", "", 14, 14))); | |
613 | ||
614 | assertFalse(CreditCardValidator.validLength(14, new CreditCardRange("", "", 15, 17))); | |
615 | assertTrue(CreditCardValidator.validLength(15, new CreditCardRange("", "", 15, 17))); | |
616 | assertTrue(CreditCardValidator.validLength(16, new CreditCardRange("", "", 15, 17))); | |
617 | assertTrue(CreditCardValidator.validLength(17, new CreditCardRange("", "", 15, 17))); | |
618 | assertFalse(CreditCardValidator.validLength(18, new CreditCardRange("", "", 15, 17))); | |
619 | ||
620 | assertFalse(CreditCardValidator.validLength(14, new CreditCardRange("", "", new int[]{15, 17}))); | |
621 | assertTrue(CreditCardValidator.validLength(15, new CreditCardRange("", "", new int[]{15, 17}))); | |
622 | assertFalse(CreditCardValidator.validLength(16, new CreditCardRange("", "", new int[]{15, 17}))); | |
623 | assertTrue(CreditCardValidator.validLength(17, new CreditCardRange("", "", new int[]{15, 17}))); | |
624 | assertFalse(CreditCardValidator.validLength(18, new CreditCardRange("", "", new int[]{15, 17}))); | |
625 | } | |
626 | ||
627 | public void testDisjointRange() { | |
628 | CreditCardValidator ccv = new CreditCardValidator( | |
629 | new CreditCardRange[]{ | |
630 | new CreditCardRange("305", "4", new int[]{13, 16}), | |
631 | } | |
632 | ); | |
633 | assertEquals(13, VALID_SHORT_VISA.length()); | |
634 | assertEquals(16, VALID_VISA.length()); | |
635 | assertEquals(14, VALID_DINERS.length()); | |
636 | assertTrue(ccv.isValid(VALID_SHORT_VISA)); | |
637 | assertTrue(ccv.isValid(VALID_VISA)); | |
638 | assertFalse(ccv.isValid(ERROR_SHORT_VISA)); | |
639 | assertFalse(ccv.isValid(ERROR_VISA)); | |
640 | assertFalse(ccv.isValid(VALID_DINERS)); | |
641 | ccv = new CreditCardValidator( | |
642 | new CreditCardRange[]{ | |
643 | // add 14 as a valid length | |
644 | new CreditCardRange("305", "4", new int[]{13, 14, 16}), | |
645 | } | |
646 | ); | |
647 | assertTrue(ccv.isValid(VALID_DINERS)); | |
648 | } | |
524 | 649 | } |
46 | 46 | /** |
47 | 47 | * Tests for the DomainValidator. |
48 | 48 | * |
49 | * @version $Revision: 1739361 $ | |
49 | * @version $Revision: 1781829 $ | |
50 | 50 | */ |
51 | 51 | public class DomainValidatorTest extends TestCase { |
52 | 52 | |
367 | 367 | assertTrue(validator.isValidGenericTld("com")); |
368 | 368 | } |
369 | 369 | |
370 | public void testVALIDATOR_412() { | |
371 | assertFalse(validator.isValidGenericTld("local")); | |
372 | assertFalse(validator.isValid("abc.local")); | |
373 | assertFalse(validator.isValidGenericTld("pvt")); | |
374 | assertFalse(validator.isValid("abc.pvt")); | |
375 | DomainValidator.updateTLDOverride(ArrayType.GENERIC_PLUS, new String[]{"local", "pvt"}); | |
376 | assertTrue(validator.isValidGenericTld("local")); | |
377 | assertTrue(validator.isValid("abc.local")); | |
378 | assertTrue(validator.isValidGenericTld("pvt")); | |
379 | assertTrue(validator.isValid("abc.pvt")); | |
380 | } | |
381 | ||
370 | 382 | public void testCannotUpdate() { |
371 | 383 | DomainValidator.updateTLDOverride(ArrayType.GENERIC_PLUS, new String[]{"ch"}); // OK |
372 | 384 | DomainValidator dv = DomainValidator.getInstance(); |
395 | 407 | Set<String> ianaTlds = new HashSet<String>(); // keep for comparison with array contents |
396 | 408 | DomainValidator dv = DomainValidator.getInstance(); |
397 | 409 | File txtFile = new File("target/tlds-alpha-by-domain.txt"); |
398 | long timestamp = download(txtFile, "http://data.iana.org/TLD/tlds-alpha-by-domain.txt", 0L); | |
410 | long timestamp = download(txtFile, "https://data.iana.org/TLD/tlds-alpha-by-domain.txt", 0L); | |
399 | 411 | final File htmlFile = new File("target/tlds-alpha-by-domain.html"); |
400 | 412 | // N.B. sometimes the html file may be updated a day or so after the txt file |
401 | 413 | // if the txt file contains entries not found in the html file, try again in a day or two |
402 | download(htmlFile,"http://www.iana.org/domains/root/db", timestamp); | |
414 | download(htmlFile,"https://www.iana.org/domains/root/db", timestamp); | |
403 | 415 | |
404 | 416 | BufferedReader br = new BufferedReader(new FileReader(txtFile)); |
405 | 417 | String line; |
33 | 33 | // so we test for both where possible |
34 | 34 | // Note that the BIC near the start of the code is always upper case or digits |
35 | 35 | private final String[] validIBANFormat = new String[] { |
36 | "AD1200012030200359100100", | |
37 | "AE070331234567890123456", | |
36 | 38 | "AL47212110090000000235698741", |
37 | "AD1200012030200359100100", | |
38 | 39 | "AT611904300234573201", |
39 | 40 | "AZ21NABZ00000000137010001944", |
41 | "BA391290079401028494", | |
42 | "BE68539007547034", | |
43 | "BG80BNBG96611020345678", | |
40 | 44 | "BH67BMAG00001299123456", |
41 | "BE68539007547034", | |
42 | "BA391290079401028494", | |
45 | "BR1800000000141455123924100C2", | |
46 | "BR1800360305000010009795493C1", | |
43 | 47 | "BR9700360305000010009795493P1", |
44 | "BR1800000000141455123924100C2", | |
45 | "BG80BNBG96611020345678", | |
46 | "CR0515202001026284066", | |
47 | "HR1210010051863000160", | |
48 | // TODO add BY valid example | |
49 | "CH9300762011623852957", | |
50 | "CR05015202001026284066", | |
48 | 51 | "CY17002001280000001200527600", |
49 | 52 | "CZ6508000000192000145399", |
50 | 53 | "CZ9455000000001011038930", |
54 | "DE89370400440532013000", | |
51 | 55 | "DK5000400440116243", |
52 | "FO6264600001631634", | |
53 | "GL8964710001000206", | |
54 | 56 | "DO28BAGR00000001212453611324", |
55 | 57 | "EE382200221020145685", |
58 | "ES9121000418450200051332", | |
56 | 59 | "FI2112345600000785", |
57 | 60 | "FI5542345670000081", |
61 | "FO6264600001631634", | |
58 | 62 | "FR1420041010050500013M02606", |
63 | "GB29NWBK60161331926819", | |
59 | 64 | "GE29NB0000000101904917", |
60 | "DE89370400440532013000", | |
61 | 65 | "GI75NWBK000000007099453", |
66 | "GL8964710001000206", | |
62 | 67 | "GR1601101250000000012300695", |
63 | 68 | "GT82TRAJ01020000001210029690", |
69 | "HR1210010051863000160", | |
64 | 70 | "HU42117730161111101800000000", |
65 | "IS140159260076545510730339", | |
66 | 71 | "IE29AIBK93115212345678", |
67 | 72 | "IL620108000000099999999", |
73 | "IQ98NBIQ850123456789012", | |
74 | "IS140159260076545510730339", | |
68 | 75 | "IT60X0542811101000000123456", |
69 | 76 | "JO94CBJO0010000000000131000302", |
77 | "KW81CBKU0000000000001234560101", | |
70 | 78 | "KZ86125KZT5004100100", |
71 | "XK051212012345678906", | |
72 | "KW81CBKU0000000000001234560101", | |
73 | "LV80BANK0000435195001", | |
74 | 79 | "LB62099900000001001901229114", |
80 | "LC55HEMM000100010012001200023015", | |
75 | 81 | "LI21088100002324013AA", |
76 | 82 | "LT121000011101001000", |
77 | 83 | "LU280019400644750000", |
84 | "LV80BANK0000435195001", | |
85 | "MC5811222000010123456789030", | |
86 | "MD24AG000225100013104168", | |
87 | "ME25505000012345678951", | |
78 | 88 | "MK07250120000058984", |
89 | "MR1300020001010000123456753", | |
79 | 90 | "MT84MALT011000012345MTLCAST001S", |
80 | "MR1300020001010000123456753", | |
81 | 91 | "MU17BOMM0101101030300200000MUR", |
82 | "MD24AG000225100013104168", | |
83 | "MC5811222000010123456789030", | |
84 | "ME25505000012345678951", | |
85 | 92 | "NL91ABNA0417164300", |
86 | 93 | "NO9386011117947", |
87 | 94 | "PK36SCBL0000001123456702", |
95 | "PL61109010140000071219812874", | |
88 | 96 | "PS92PALS000000000400123456702", |
89 | "PL61109010140000071219812874", | |
90 | 97 | "PT50000201231234567890154", |
91 | 98 | "QA58DOHB00001234567890ABCDEFG", |
92 | 99 | "RO49AAAA1B31007593840000", |
93 | "LC55HEMM000100010012001200023015", // the SWIFT docs have LC62... | |
100 | "RS35260005601001611379", | |
101 | "SA0380000000608010167519", | |
102 | "SC18SSCB11010000000000001497USD", | |
103 | "SE4550000000058398257466", | |
104 | "SI56191000000123438", | |
105 | "SI56263300012039086", | |
106 | "SK3112000000198742637541", | |
94 | 107 | "SM86U0322509800000000270100", |
95 | 108 | "ST68000100010051845310112", |
96 | "SA0380000000608010167519", | |
97 | "RS35260005601001611379", | |
98 | "SK3112000000198742637541", | |
99 | "SI56191000000123438", | |
100 | "ES9121000418450200051332", | |
101 | "SE4550000000058398257466", | |
102 | "CH9300762011623852957", | |
103 | 109 | "TL380080012345678910157", |
104 | 110 | "TN5910006035183598478831", |
105 | 111 | "TR330006100519786457841326", |
106 | "AE070331234567890123456", | |
107 | "GB29NWBK60161331926819", | |
112 | "UA213223130000026007233566001", | |
113 | "UA213996220000026007233566001", | |
108 | 114 | "VG96VPVG0000012345678901", |
109 | }; | |
115 | "XK051212012345678906", | |
116 | }; | |
110 | 117 | |
111 | 118 | private final String[] invalidIBANFormat = new String[] { |
112 | 119 | "", // empty |
119 | 126 | "QA58DOHB00001234567890abcdefg", // lowercase version |
120 | 127 | "RO49AAAA1b31007593840000", // lowercase version |
121 | 128 | "LC62HEMM000100010012001200023015", // wrong in SWIFT |
129 | "BY00NBRB3600000000000Z00AB00", // Wrong in SWIFT v73 | |
130 | "ST68000200010192194210112", // ditto | |
131 | "SV62CENR0000000000000700025", // ditto | |
122 | 132 | }; |
123 | 133 | |
124 | 134 | private static final IBANValidator VALIDATOR = IBANValidator.getInstance(); |
21 | 21 | /** |
22 | 22 | * Test cases for InetAddressValidator. |
23 | 23 | * |
24 | * @version $Revision: 1739356 $ | |
24 | * @version $Revision: 1783032 $ | |
25 | 25 | */ |
26 | 26 | public class InetAddressValidatorTest extends TestCase { |
27 | 27 | |
54 | 54 | assertTrue("2001:0438:FFFE:0000:0000:0000:0000:0A35 should be valid", validator.isValid("2001:0438:FFFE:0000:0000:0000:0000:0A35")); |
55 | 55 | } |
56 | 56 | |
57 | public void testVALIDATOR_419() { | |
58 | String addr; | |
59 | addr = "0:0:0:0:0:0:13.1.68.3"; | |
60 | assertTrue(addr, validator.isValid(addr)); | |
61 | addr = "0:0:0:0:0:FFFF:129.144.52.38"; | |
62 | assertTrue(addr, validator.isValid(addr)); | |
63 | addr = "::13.1.68.3"; | |
64 | assertTrue(addr, validator.isValid(addr)); | |
65 | addr = "::FFFF:129.144.52.38"; | |
66 | assertTrue(addr, validator.isValid(addr)); | |
67 | ||
68 | addr = "::ffff:192.168.1.1:192.168.1.1"; | |
69 | assertFalse(addr, validator.isValid(addr)); | |
70 | addr = "::192.168.1.1:192.168.1.1"; | |
71 | assertFalse(addr, validator.isValid(addr)); | |
72 | } | |
73 | ||
57 | 74 | /** |
58 | 75 | * Test valid and invalid IPs from each address class. |
59 | 76 | */ |
87 | 104 | */ |
88 | 105 | public void testBrokenInetAddresses() { |
89 | 106 | assertFalse("IP with characters should be invalid", validator.isValid("124.14.32.abc")); |
90 | assertFalse("IP with leading zeroes should be invalid", validator.isValid("124.14.32.01")); | |
107 | // assertFalse("IP with leading zeroes should be invalid", validator.isValid("124.14.32.01")); | |
91 | 108 | assertFalse("IP with three groups should be invalid", validator.isValid("23.64.12")); |
92 | 109 | assertFalse("IP with five groups should be invalid", validator.isValid("26.34.23.77.234")); |
93 | 110 | } |
101 | 118 | public void testIPv6() { |
102 | 119 | // The original Perl script contained a lot of duplicate tests. |
103 | 120 | // I removed the duplicates I noticed, but there may be more. |
104 | assertFalse("IPV6 empty string should be invalid", validator.isValidInet6Address(""));// empty string | |
121 | // assertFalse("IPV6 empty string should be invalid", validator.isValidInet6Address(""));// empty string | |
105 | 122 | assertTrue("IPV6 ::1 should be valid", validator.isValidInet6Address("::1"));// loopback, compressed, non-routable |
106 | 123 | assertTrue("IPV6 :: should be valid", validator.isValidInet6Address("::"));// unspecified, compressed, non-routable |
107 | 124 | assertTrue("IPV6 0:0:0:0:0:0:0:1 should be valid", validator.isValidInet6Address("0:0:0:0:0:0:0:1"));// loopback, full |
22 | 22 | /** |
23 | 23 | * Performs Validation Test for url validations. |
24 | 24 | * |
25 | * @version $Revision: 1739356 $ | |
25 | * @version $Revision: 1783203 $ | |
26 | 26 | */ |
27 | 27 | public class UrlValidatorTest extends TestCase { |
28 | 28 | |
176 | 176 | |
177 | 177 | // Now check using options |
178 | 178 | validator = new UrlValidator(UrlValidator.ALLOW_LOCAL_URLS); |
179 | ||
179 | ||
180 | 180 | assertTrue("localhost URL should validate", |
181 | 181 | validator.isValid("http://localhost/test/index.html")); |
182 | ||
182 | ||
183 | 183 | assertTrue("machinename URL should validate", |
184 | 184 | validator.isValid("http://machinename/test/index.html")); |
185 | ||
185 | ||
186 | 186 | assertTrue("www.apache.org should still validate", |
187 | 187 | validator.isValid("http://www.apache.org/test/index.html")); |
188 | 188 | } |
195 | 195 | |
196 | 196 | assertTrue("hostname with path should validate", |
197 | 197 | validator.isValid("http://hostname/test/index.html")); |
198 | ||
198 | ||
199 | 199 | assertTrue("localhost URL should validate", |
200 | 200 | validator.isValid("http://localhost/test/index.html")); |
201 | ||
201 | ||
202 | 202 | assertFalse("first.my-testing should not validate", |
203 | 203 | validator.isValid("http://first.my-testing/test/index.html")); |
204 | 204 | |
216 | 216 | |
217 | 217 | assertFalse("localhost URL should no longer validate", |
218 | 218 | validator.isValid("http://localhost/test/index.html")); |
219 | ||
219 | ||
220 | 220 | assertTrue("www.apache.org should still validate", |
221 | 221 | validator.isValid("http://www.apache.org/test/index.html")); |
222 | 222 | } |
223 | ||
223 | ||
224 | 224 | public void testValidator276() { |
225 | 225 | // file:// isn't allowed by default |
226 | 226 | UrlValidator validator = new UrlValidator(); |
227 | ||
227 | ||
228 | 228 | assertTrue("http://apache.org/ should be allowed by default", |
229 | 229 | validator.isValid("http://www.apache.org/test/index.html")); |
230 | ||
230 | ||
231 | 231 | assertFalse("file:///c:/ shouldn't be allowed by default", |
232 | 232 | validator.isValid("file:///C:/some.file")); |
233 | ||
233 | ||
234 | 234 | assertFalse("file:///c:\\ shouldn't be allowed by default", |
235 | 235 | validator.isValid("file:///C:\\some.file")); |
236 | ||
236 | ||
237 | 237 | assertFalse("file:///etc/ shouldn't be allowed by default", |
238 | 238 | validator.isValid("file:///etc/hosts")); |
239 | ||
239 | ||
240 | 240 | assertFalse("file://localhost/etc/ shouldn't be allowed by default", |
241 | 241 | validator.isValid("file://localhost/etc/hosts")); |
242 | ||
242 | ||
243 | 243 | assertFalse("file://localhost/c:/ shouldn't be allowed by default", |
244 | 244 | validator.isValid("file://localhost/c:/some.file")); |
245 | ||
245 | ||
246 | 246 | // Turn it on, and check |
247 | 247 | // Note - we need to enable local urls when working with file: |
248 | 248 | validator = new UrlValidator(new String[] {"http","file"}, UrlValidator.ALLOW_LOCAL_URLS); |
249 | ||
249 | ||
250 | 250 | assertTrue("http://apache.org/ should be allowed by default", |
251 | 251 | validator.isValid("http://www.apache.org/test/index.html")); |
252 | ||
252 | ||
253 | 253 | assertTrue("file:///c:/ should now be allowed", |
254 | 254 | validator.isValid("file:///C:/some.file")); |
255 | ||
255 | ||
256 | 256 | // Currently, we don't support the c:\ form |
257 | 257 | assertFalse("file:///c:\\ shouldn't be allowed", |
258 | 258 | validator.isValid("file:///C:\\some.file")); |
259 | ||
259 | ||
260 | 260 | assertTrue("file:///etc/ should now be allowed", |
261 | 261 | validator.isValid("file:///etc/hosts")); |
262 | ||
262 | ||
263 | 263 | assertTrue("file://localhost/etc/ should now be allowed", |
264 | 264 | validator.isValid("file://localhost/etc/hosts")); |
265 | ||
265 | ||
266 | 266 | assertTrue("file://localhost/c:/ should now be allowed", |
267 | 267 | validator.isValid("file://localhost/c:/some.file")); |
268 | ||
268 | ||
269 | 269 | // These are never valid |
270 | 270 | assertFalse("file://c:/ shouldn't ever be allowed, needs file:///c:/", |
271 | 271 | validator.isValid("file://C:/some.file")); |
272 | ||
272 | ||
273 | 273 | assertFalse("file://c:\\ shouldn't ever be allowed, needs file:///c:/", |
274 | 274 | validator.isValid("file://C:\\some.file")); |
275 | 275 | } |
276 | 276 | |
277 | ||
277 | public void testValidator391OK() { | |
278 | String[] schemes = {"file"}; | |
279 | UrlValidator urlValidator = new UrlValidator(schemes); | |
280 | assertTrue(urlValidator.isValid("file:///C:/path/to/dir/")); | |
281 | } | |
282 | ||
283 | public void testValidator391FAILS() { | |
284 | String[] schemes = {"file"}; | |
285 | UrlValidator urlValidator = new UrlValidator(schemes); | |
286 | assertTrue(urlValidator.isValid("file:/C:/path/to/dir/")); | |
287 | } | |
288 | ||
278 | 289 | public void testValidator309() { |
279 | 290 | UrlValidator urlValidator = new UrlValidator(); |
280 | 291 | assertTrue(urlValidator.isValid("http://sample.ondemand.com/")); |
310 | 321 | assertTrue(urlValidator.isValid("http://example.rocks")); |
311 | 322 | } |
312 | 323 | |
324 | public void testValidator411(){ | |
325 | UrlValidator urlValidator = new UrlValidator(); | |
326 | assertTrue(urlValidator.isValid("http://example.rocks:/")); | |
327 | assertTrue(urlValidator.isValid("http://example.rocks:0/")); | |
328 | assertTrue(urlValidator.isValid("http://example.rocks:65535/")); | |
329 | assertFalse(urlValidator.isValid("http://example.rocks:65536/")); | |
330 | assertFalse(urlValidator.isValid("http://example.rocks:100000/")); | |
331 | } | |
332 | ||
313 | 333 | static boolean incrementTestPartsIndex(int[] testPartsIndex, Object[] testParts) { |
314 | 334 | boolean carry = true; //add 1 to lowest order part. |
315 | 335 | boolean maxIndex = true; |
316 | 336 | for (int testPartsIndexIndex = testPartsIndex.length - 1; testPartsIndexIndex >= 0; --testPartsIndexIndex) { |
317 | 337 | int index = testPartsIndex[testPartsIndexIndex]; |
318 | 338 | ResultPair[] part = (ResultPair[]) testParts[testPartsIndexIndex]; |
339 | maxIndex &= (index == (part.length - 1)); | |
319 | 340 | if (carry) { |
320 | 341 | if (index < part.length - 1) { |
321 | 342 | index++; |
326 | 347 | carry = true; |
327 | 348 | } |
328 | 349 | } |
329 | maxIndex &= (index == (part.length - 1)); | |
330 | 350 | } |
331 | 351 | |
332 | 352 | |
450 | 470 | assertTrue(validator.isValid("http://www.apache.org:80/path")); |
451 | 471 | assertTrue(validator.isValid("http://user:pass@www.apache.org:80/path")); |
452 | 472 | assertTrue(validator.isValid("http://user:@www.apache.org:80/path")); |
473 | assertTrue(validator.isValid("http://user@www.apache.org:80/path")); | |
453 | 474 | assertTrue(validator.isValid("http://us%00er:-._~!$&'()*+,;=@www.apache.org:80/path")); |
454 | 475 | assertFalse(validator.isValid("http://:pass@www.apache.org:80/path")); |
455 | 476 | assertFalse(validator.isValid("http://:@www.apache.org:80/path")); |
464 | 485 | |
465 | 486 | public void testValidator380() { |
466 | 487 | UrlValidator validator = new UrlValidator(); |
467 | assertTrue(validator.isValid("http://www.apache.org:80/path")); | |
468 | assertTrue(validator.isValid("http://www.apache.org:8/path")); | |
488 | assertTrue(validator.isValid("http://www.apache.org:80/path")); | |
489 | assertTrue(validator.isValid("http://www.apache.org:8/path")); | |
469 | 490 | assertTrue(validator.isValid("http://www.apache.org:/path")); |
470 | 491 | } |
471 | 492 | |
472 | /** | |
473 | * Only used to debug the unit tests. | |
474 | * @param argv | |
475 | */ | |
476 | public static void main(String[] argv) { | |
477 | ||
478 | UrlValidatorTest fct = new UrlValidatorTest("url test"); | |
479 | fct.setUp(); | |
480 | fct.testIsValid(); | |
481 | fct.testIsValidScheme(); | |
482 | } | |
493 | public void testValidator420() { | |
494 | UrlValidator validator = new UrlValidator(); | |
495 | assertFalse(validator.isValid("http://example.com/serach?address=Main Avenue")); | |
496 | assertTrue(validator.isValid("http://example.com/serach?address=Main%20Avenue")); | |
497 | assertTrue(validator.isValid("http://example.com/serach?address=Main+Avenue")); | |
498 | } | |
499 | ||
483 | 500 | //-------------------- Test data for creating a composite URL |
484 | 501 | /** |
485 | 502 | * The data given below approximates the 4 parts of a URL |
496 | 513 | new ResultPair("http:/", false), |
497 | 514 | new ResultPair("http:", false), |
498 | 515 | new ResultPair("http/", false), |
499 | new ResultPair("://", false), | |
500 | new ResultPair("", true)}; | |
516 | new ResultPair("://", false)}; | |
501 | 517 | |
502 | 518 | ResultPair[] testUrlAuthority = {new ResultPair("www.google.com", true), |
519 | new ResultPair("www.google.com.", true), | |
503 | 520 | new ResultPair("go.com", true), |
504 | 521 | new ResultPair("go.au", true), |
505 | 522 | new ResultPair("0.0.0.0", true), |
520 | 537 | new ResultPair("", false) |
521 | 538 | }; |
522 | 539 | ResultPair[] testUrlPort = {new ResultPair(":80", true), |
523 | new ResultPair(":65535", true), | |
540 | new ResultPair(":65535", true), // max possible | |
541 | new ResultPair(":65536", false), // max possible +1 | |
524 | 542 | new ResultPair(":0", true), |
525 | 543 | new ResultPair("", true), |
526 | 544 | new ResultPair(":-1", false), |
527 | new ResultPair(":65636", true), | |
545 | new ResultPair(":65636", false), | |
546 | new ResultPair(":999999999999999999", false), | |
528 | 547 | new ResultPair(":65a", false) |
529 | 548 | }; |
530 | 549 | ResultPair[] testPath = {new ResultPair("/test1", true), |
+52
-0
0 | /* | |
1 | * Licensed to the Apache Software Foundation (ASF) under one or more | |
2 | * contributor license agreements. See the NOTICE file distributed with | |
3 | * this work for additional information regarding copyright ownership. | |
4 | * The ASF licenses this file to You under the Apache License, Version 2.0 | |
5 | * (the "License"); you may not use this file except in compliance with | |
6 | * the License. You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
15 | */ | |
16 | package org.apache.commons.validator.routines.checkdigit; | |
17 | ||
18 | ||
19 | /** | |
20 | * ModulusTenCheckDigit ABA Number Check Digit Test. | |
21 | * | |
22 | * @version $Revision: 1748035 $ | |
23 | */ | |
24 | public class ModulusTenABACheckDigitTest extends AbstractCheckDigitTest { | |
25 | ||
26 | /** | |
27 | * Constructor | |
28 | * @param name test name | |
29 | */ | |
30 | public ModulusTenABACheckDigitTest(String name) { | |
31 | super(name); | |
32 | } | |
33 | ||
34 | /** | |
35 | * Set up routine & valid codes. | |
36 | */ | |
37 | @Override | |
38 | protected void setUp() throws Exception { | |
39 | super.setUp(); | |
40 | routine = new ModulusTenCheckDigit(new int[] { 1, 7, 3 }, true); | |
41 | valid = new String[] { | |
42 | "123456780", | |
43 | "123123123", | |
44 | "011000015", | |
45 | "111000038", | |
46 | "231381116", | |
47 | "121181976" | |
48 | }; | |
49 | } | |
50 | ||
51 | } |
+74
-0
0 | /* | |
1 | * Licensed to the Apache Software Foundation (ASF) under one or more | |
2 | * contributor license agreements. See the NOTICE file distributed with | |
3 | * this work for additional information regarding copyright ownership. | |
4 | * The ASF licenses this file to You under the Apache License, Version 2.0 | |
5 | * (the "License"); you may not use this file except in compliance with | |
6 | * the License. You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
15 | */ | |
16 | package org.apache.commons.validator.routines.checkdigit; | |
17 | ||
18 | ||
19 | /** | |
20 | * ModulusTenCheckDigit CUSIP Test. | |
21 | * | |
22 | * @version $Revision: 1748035 $ | |
23 | */ | |
24 | public class ModulusTenCUSIPCheckDigitTest extends AbstractCheckDigitTest { | |
25 | ||
26 | /** | |
27 | * Construct a new test. | |
28 | * @param name test name | |
29 | */ | |
30 | public ModulusTenCUSIPCheckDigitTest(String name) { | |
31 | super(name); | |
32 | } | |
33 | ||
34 | /** | |
35 | * Set up routine & valid codes. | |
36 | */ | |
37 | @Override | |
38 | protected void setUp() throws Exception { | |
39 | super.setUp(); | |
40 | routine = new ModulusTenCheckDigit(new int[] { 1, 2}, true, true); | |
41 | valid = new String[] {"037833100", | |
42 | "931142103", | |
43 | "837649128", | |
44 | "392690QT3", | |
45 | "594918104", | |
46 | "86770G101", | |
47 | "Y8295N109", | |
48 | "G8572F100" | |
49 | }; | |
50 | invalid = new String[] {"0378#3100"}; | |
51 | } | |
52 | ||
53 | private static String invalidCheckDigits[] = {"DUS0421CW", | |
54 | "DUS0421CN", | |
55 | "DUS0421CE" | |
56 | }; | |
57 | ||
58 | public void testVALIDATOR_336_InvalidCheckDigits() { | |
59 | for (int i = 0; i < invalidCheckDigits.length; i++) { | |
60 | String invalidCheckDigit = invalidCheckDigits[i]; | |
61 | assertFalse("Should fail: " + invalidCheckDigit, routine.isValid(invalidCheckDigit)); | |
62 | } | |
63 | } | |
64 | ||
65 | private static String validCheckDigits[] = {"DUS0421C5"}; | |
66 | ||
67 | public void testVALIDATOR_336_ValidCheckDigits() { | |
68 | for (int i = 0; i < validCheckDigits.length; i++) { | |
69 | String validCheckDigit = validCheckDigits[i]; | |
70 | assertTrue("Should fail: " + validCheckDigit, routine.isValid(validCheckDigit)); | |
71 | } | |
72 | } | |
73 | } |
+49
-0
0 | /* | |
1 | * Licensed to the Apache Software Foundation (ASF) under one or more | |
2 | * contributor license agreements. See the NOTICE file distributed with | |
3 | * this work for additional information regarding copyright ownership. | |
4 | * The ASF licenses this file to You under the Apache License, Version 2.0 | |
5 | * (the "License"); you may not use this file except in compliance with | |
6 | * the License. You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
15 | */ | |
16 | package org.apache.commons.validator.routines.checkdigit; | |
17 | ||
18 | ||
19 | /** | |
20 | * ModulusTenCheckDigit EAN-13 Test. | |
21 | * | |
22 | * @version $Revision: 1748035 $ | |
23 | */ | |
24 | public class ModulusTenEAN13CheckDigitTest extends AbstractCheckDigitTest { | |
25 | ||
26 | /** | |
27 | * Constructor | |
28 | * @param name test name | |
29 | */ | |
30 | public ModulusTenEAN13CheckDigitTest(String name) { | |
31 | super(name); | |
32 | } | |
33 | ||
34 | /** | |
35 | * Set up routine & valid codes. | |
36 | */ | |
37 | @Override | |
38 | protected void setUp() throws Exception { | |
39 | super.setUp(); | |
40 | routine = new ModulusTenCheckDigit(new int[] { 1, 3 }, true); | |
41 | valid = new String[] { | |
42 | "9780072129519", | |
43 | "9780764558313", | |
44 | "4025515373438", | |
45 | "0095673400332"}; | |
46 | } | |
47 | ||
48 | } |
+59
-0
0 | /* | |
1 | * Licensed to the Apache Software Foundation (ASF) under one or more | |
2 | * contributor license agreements. See the NOTICE file distributed with | |
3 | * this work for additional information regarding copyright ownership. | |
4 | * The ASF licenses this file to You under the Apache License, Version 2.0 | |
5 | * (the "License"); you may not use this file except in compliance with | |
6 | * the License. You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
15 | */ | |
16 | package org.apache.commons.validator.routines.checkdigit; | |
17 | ||
18 | ||
19 | /** | |
20 | * ModulusTenCheckDigit Luhn Test. | |
21 | * | |
22 | * @version $Revision: 1748035 $ | |
23 | */ | |
24 | public class ModulusTenLuhnCheckDigitTest extends AbstractCheckDigitTest { | |
25 | ||
26 | private static final String VALID_VISA = "4417123456789113"; | |
27 | private static final String VALID_SHORT_VISA = "4222222222222"; | |
28 | private static final String VALID_AMEX = "378282246310005"; | |
29 | private static final String VALID_MASTERCARD = "5105105105105100"; | |
30 | private static final String VALID_DISCOVER = "6011000990139424"; | |
31 | private static final String VALID_DINERS = "30569309025904"; | |
32 | ||
33 | /** | |
34 | * Constructor | |
35 | * @param name test name | |
36 | */ | |
37 | public ModulusTenLuhnCheckDigitTest(String name) { | |
38 | super(name); | |
39 | } | |
40 | ||
41 | /** | |
42 | * Set up routine & valid codes. | |
43 | */ | |
44 | @Override | |
45 | protected void setUp() throws Exception { | |
46 | super.setUp(); | |
47 | ||
48 | routine = new ModulusTenCheckDigit(new int[] {1, 2}, true, true); | |
49 | ||
50 | valid = new String[] { | |
51 | VALID_VISA, | |
52 | VALID_SHORT_VISA, | |
53 | VALID_AMEX, | |
54 | VALID_MASTERCARD, | |
55 | VALID_DISCOVER, | |
56 | VALID_DINERS}; | |
57 | } | |
58 | } |
+68
-0
0 | /* | |
1 | * Licensed to the Apache Software Foundation (ASF) under one or more | |
2 | * contributor license agreements. See the NOTICE file distributed with | |
3 | * this work for additional information regarding copyright ownership. | |
4 | * The ASF licenses this file to You under the Apache License, Version 2.0 | |
5 | * (the "License"); you may not use this file except in compliance with | |
6 | * the License. You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
15 | */ | |
16 | package org.apache.commons.validator.routines.checkdigit; | |
17 | ||
18 | ||
19 | /** | |
20 | * ModulusTenCheckDigit SEDOL Test. | |
21 | * | |
22 | * @version $Revision: 1748035 $ | |
23 | */ | |
24 | public class ModulusTenSedolCheckDigitTest extends AbstractCheckDigitTest { | |
25 | ||
26 | /** | |
27 | * Constructor | |
28 | * @param name test name | |
29 | */ | |
30 | public ModulusTenSedolCheckDigitTest(String name) { | |
31 | super(name); | |
32 | } | |
33 | ||
34 | /** | |
35 | * Set up routine & valid codes. | |
36 | */ | |
37 | @Override | |
38 | protected void setUp() throws Exception { | |
39 | super.setUp(); | |
40 | routine = new ModulusTenCheckDigit(new int[] { 1, 3, 1, 7, 3, 9, 1 }); | |
41 | valid = new String[] { | |
42 | "0263494", | |
43 | "0870612", | |
44 | "B06LQ97", | |
45 | "3437575", | |
46 | "B07LF55", | |
47 | }; | |
48 | invalid = new String[] {"123#567"}; | |
49 | zeroSum = "0000000"; | |
50 | } | |
51 | ||
52 | private static String invalidCheckDigits[] = { | |
53 | "026349E", // proper check digit is '4', see above | |
54 | "087061C", // proper check digit is '2', see above | |
55 | "B06LQ9H", // proper check digit is '7', see above | |
56 | "343757F", // proper check digit is '5', see above | |
57 | "B07LF5F", // proper check digit is '5', see above | |
58 | }; | |
59 | ||
60 | public void testVALIDATOR_346() { | |
61 | for (int i = 0; i < invalidCheckDigits.length; i++) { | |
62 | String invalidCheckDigit = invalidCheckDigits[i]; | |
63 | assertFalse("Should fail: " + invalidCheckDigit, routine.isValid(invalidCheckDigit)); | |
64 | } | |
65 | } | |
66 | ||
67 | } |