diff options
author | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-05-01 11:04:34 +0000 |
---|---|---|
committer | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-05-01 11:04:34 +0000 |
commit | 41d73bf90e2e94c91df8a865d54d5cb23b9101c9 (patch) | |
tree | 3c80345d9a699a8d60d2a03e37f69e0f98fac676 /EssentialsGeoIP | |
parent | ec18c0096d91f237a27e9aa88a96857403b2ed40 (diff) | |
download | Essentials-41d73bf90e2e94c91df8a865d54d5cb23b9101c9.tar Essentials-41d73bf90e2e94c91df8a865d54d5cb23b9101c9.tar.gz Essentials-41d73bf90e2e94c91df8a865d54d5cb23b9101c9.tar.lz Essentials-41d73bf90e2e94c91df8a865d54d5cb23b9101c9.tar.xz Essentials-41d73bf90e2e94c91df8a865d54d5cb23b9101c9.zip |
EssentialsGeoIP is now officially part of Essentials
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1292 e251c2fe-e539-e718-e476-b85c1f46cddb
Diffstat (limited to 'EssentialsGeoIP')
18 files changed, 18095 insertions, 0 deletions
diff --git a/EssentialsGeoIP/build.xml b/EssentialsGeoIP/build.xml new file mode 100644 index 000000000..f477a3e05 --- /dev/null +++ b/EssentialsGeoIP/build.xml @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- You may freely edit this file. See commented blocks below for --> +<!-- some examples of how to customize the build. --> +<!-- (If you delete it and reopen the project it will be recreated.) --> +<!-- By default, only the Clean and Build commands use this build script. --> +<!-- Commands such as Run, Debug, and Test only use this build script if --> +<!-- the Compile on Save feature is turned off for the project. --> +<!-- You can turn off the Compile on Save (or Deploy on Save) setting --> +<!-- in the project's Project Properties dialog box.--> +<project name="EssentialsGeoIP" default="default" basedir="."> + <description>Builds, tests, and runs the project EssentialsGeoIP.</description> + <import file="nbproject/build-impl.xml"/> + <!-- + + There exist several targets which are by default empty and which can be + used for execution of your tasks. These targets are usually executed + before and after some main targets. They are: + + -pre-init: called before initialization of project properties + -post-init: called after initialization of project properties + -pre-compile: called before javac compilation + -post-compile: called after javac compilation + -pre-compile-single: called before javac compilation of single file + -post-compile-single: called after javac compilation of single file + -pre-compile-test: called before javac compilation of JUnit tests + -post-compile-test: called after javac compilation of JUnit tests + -pre-compile-test-single: called before javac compilation of single JUnit test + -post-compile-test-single: called after javac compilation of single JUunit test + -pre-jar: called before JAR building + -post-jar: called after JAR building + -post-clean: called after cleaning build products + + (Targets beginning with '-' are not intended to be called on their own.) + + Example of inserting an obfuscator after compilation could look like this: + + <target name="-post-compile"> + <obfuscate> + <fileset dir="${build.classes.dir}"/> + </obfuscate> + </target> + + For list of available properties check the imported + nbproject/build-impl.xml file. + + + Another way to customize the build is by overriding existing main targets. + The targets of interest are: + + -init-macrodef-javac: defines macro for javac compilation + -init-macrodef-junit: defines macro for junit execution + -init-macrodef-debug: defines macro for class debugging + -init-macrodef-java: defines macro for class execution + -do-jar-with-manifest: JAR building (if you are using a manifest) + -do-jar-without-manifest: JAR building (if you are not using a manifest) + run: execution of project + -javadoc-build: Javadoc generation + test-report: JUnit report generation + + An example of overriding the target for project execution could look like this: + + <target name="run" depends="EssentialsGeoIP-impl.jar"> + <exec dir="bin" executable="launcher.exe"> + <arg file="${dist.jar}"/> + </exec> + </target> + + Notice that the overridden target depends on the jar target and not only on + the compile target as the regular run target does. Again, for a list of available + properties which you can use, check the target you are overriding in the + nbproject/build-impl.xml file. + + --> +</project> diff --git a/EssentialsGeoIP/manifest.mf b/EssentialsGeoIP/manifest.mf new file mode 100644 index 000000000..328e8e5bc --- /dev/null +++ b/EssentialsGeoIP/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/EssentialsGeoIP/nbproject/build-impl.xml b/EssentialsGeoIP/nbproject/build-impl.xml new file mode 100644 index 000000000..b32699fc0 --- /dev/null +++ b/EssentialsGeoIP/nbproject/build-impl.xml @@ -0,0 +1,1080 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +*** GENERATED FROM project.xml - DO NOT EDIT *** +*** EDIT ../build.xml INSTEAD *** + +For the purpose of easier reading the script +is divided into following sections: + + - initialization + - compilation + - jar + - execution + - debugging + - javadoc + - junit compilation + - junit execution + - junit debugging + - applet + - cleanup + + --> +<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="EssentialsGeoIP-impl"> + <fail message="Please build using Ant 1.7.1 or higher."> + <condition> + <not> + <antversion atleast="1.7.1"/> + </not> + </condition> + </fail> + <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/> + <!-- + ====================== + INITIALIZATION SECTION + ====================== + --> + <target name="-pre-init"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="-pre-init" name="-init-private"> + <property file="nbproject/private/config.properties"/> + <property file="nbproject/private/configs/${config}.properties"/> + <property file="nbproject/private/private.properties"/> + </target> + <target name="-pre-init-libraries"> + <property location="../lib/nblibraries.properties" name="libraries.path"/> + <dirname file="${libraries.path}" property="libraries.dir.nativedirsep"/> + <pathconvert dirsep="/" property="libraries.dir"> + <path path="${libraries.dir.nativedirsep}"/> + </pathconvert> + <basename file="${libraries.path}" property="libraries.basename" suffix=".properties"/> + <available file="${libraries.dir}/${libraries.basename}-private.properties" property="private.properties.available"/> + </target> + <target depends="-pre-init-libraries" if="private.properties.available" name="-init-private-libraries"> + <loadproperties encoding="ISO-8859-1" srcfile="${libraries.dir}/${libraries.basename}-private.properties"> + <filterchain> + <replacestring from="$${base}" to="${libraries.dir}"/> + <escapeunicode/> + </filterchain> + </loadproperties> + </target> + <target depends="-pre-init,-init-private,-init-private-libraries" name="-init-libraries"> + <loadproperties encoding="ISO-8859-1" srcfile="${libraries.path}"> + <filterchain> + <replacestring from="$${base}" to="${libraries.dir}"/> + <escapeunicode/> + </filterchain> + </loadproperties> + </target> + <target depends="-pre-init,-init-private,-init-libraries" name="-init-user"> + <property file="${user.properties.file}"/> + <!-- The two properties below are usually overridden --> + <!-- by the active platform. Just a fallback. --> + <property name="default.javac.source" value="1.4"/> + <property name="default.javac.target" value="1.4"/> + </target> + <target depends="-pre-init,-init-private,-init-libraries,-init-user" name="-init-project"> + <property file="nbproject/configs/${config}.properties"/> + <property file="nbproject/project.properties"/> + </target> + <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-init-macrodef-property" name="-do-init"> + <available file="${manifest.file}" property="manifest.available"/> + <condition property="splashscreen.available"> + <and> + <not> + <equals arg1="${application.splash}" arg2="" trim="true"/> + </not> + <available file="${application.splash}"/> + </and> + </condition> + <condition property="main.class.available"> + <and> + <isset property="main.class"/> + <not> + <equals arg1="${main.class}" arg2="" trim="true"/> + </not> + </and> + </condition> + <condition property="manifest.available+main.class"> + <and> + <isset property="manifest.available"/> + <isset property="main.class.available"/> + </and> + </condition> + <condition property="do.archive"> + <not> + <istrue value="${jar.archive.disabled}"/> + </not> + </condition> + <condition property="do.mkdist"> + <and> + <isset property="do.archive"/> + <isset property="libs.CopyLibs.classpath"/> + <not> + <istrue value="${mkdist.disabled}"/> + </not> + </and> + </condition> + <condition property="manifest.available+main.class+mkdist.available"> + <and> + <istrue value="${manifest.available+main.class}"/> + <isset property="do.mkdist"/> + </and> + </condition> + <condition property="do.archive+manifest.available"> + <and> + <isset property="manifest.available"/> + <istrue value="${do.archive}"/> + </and> + </condition> + <condition property="do.archive+main.class.available"> + <and> + <isset property="main.class.available"/> + <istrue value="${do.archive}"/> + </and> + </condition> + <condition property="do.archive+splashscreen.available"> + <and> + <isset property="splashscreen.available"/> + <istrue value="${do.archive}"/> + </and> + </condition> + <condition property="do.archive+manifest.available+main.class"> + <and> + <istrue value="${manifest.available+main.class}"/> + <istrue value="${do.archive}"/> + </and> + </condition> + <condition property="manifest.available-mkdist.available"> + <or> + <istrue value="${manifest.available}"/> + <isset property="do.mkdist"/> + </or> + </condition> + <condition property="manifest.available+main.class-mkdist.available"> + <or> + <istrue value="${manifest.available+main.class}"/> + <isset property="do.mkdist"/> + </or> + </condition> + <condition property="have.tests"> + <or> + <available file="${test.src.dir}"/> + </or> + </condition> + <condition property="have.sources"> + <or> + <available file="${src.dir}"/> + </or> + </condition> + <condition property="netbeans.home+have.tests"> + <and> + <isset property="netbeans.home"/> + <isset property="have.tests"/> + </and> + </condition> + <condition property="no.javadoc.preview"> + <and> + <isset property="javadoc.preview"/> + <isfalse value="${javadoc.preview}"/> + </and> + </condition> + <property name="run.jvmargs" value=""/> + <property name="javac.compilerargs" value=""/> + <property name="work.dir" value="${basedir}"/> + <condition property="no.deps"> + <and> + <istrue value="${no.dependencies}"/> + </and> + </condition> + <property name="javac.debug" value="true"/> + <property name="javadoc.preview" value="true"/> + <property name="application.args" value=""/> + <property name="source.encoding" value="${file.encoding}"/> + <property name="runtime.encoding" value="${source.encoding}"/> + <condition property="javadoc.encoding.used" value="${javadoc.encoding}"> + <and> + <isset property="javadoc.encoding"/> + <not> + <equals arg1="${javadoc.encoding}" arg2=""/> + </not> + </and> + </condition> + <property name="javadoc.encoding.used" value="${source.encoding}"/> + <property name="includes" value="**"/> + <property name="excludes" value=""/> + <property name="do.depend" value="false"/> + <condition property="do.depend.true"> + <istrue value="${do.depend}"/> + </condition> + <path id="endorsed.classpath.path" path="${endorsed.classpath}"/> + <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'"> + <length length="0" string="${endorsed.classpath}" when="greater"/> + </condition> + <condition else="false" property="jdkBug6558476"> + <and> + <matches pattern="1\.[56]" string="${java.specification.version}"/> + <not> + <os family="unix"/> + </not> + </and> + </condition> + <property name="javac.fork" value="${jdkBug6558476}"/> + <property name="jar.index" value="false"/> + <property name="jar.index.metainf" value="${jar.index}"/> + <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/> + </target> + <target name="-post-init"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init" name="-init-check"> + <fail unless="src.dir">Must set src.dir</fail> + <fail unless="test.src.dir">Must set test.src.dir</fail> + <fail unless="build.dir">Must set build.dir</fail> + <fail unless="dist.dir">Must set dist.dir</fail> + <fail unless="build.classes.dir">Must set build.classes.dir</fail> + <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail> + <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail> + <fail unless="build.test.results.dir">Must set build.test.results.dir</fail> + <fail unless="build.classes.excludes">Must set build.classes.excludes</fail> + <fail unless="dist.jar">Must set dist.jar</fail> + </target> + <target name="-init-macrodef-property"> + <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1"> + <attribute name="name"/> + <attribute name="value"/> + <sequential> + <property name="@{name}" value="${@{value}}"/> + </sequential> + </macrodef> + </target> + <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors"> + <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${src.dir}" name="srcdir"/> + <attribute default="${build.classes.dir}" name="destdir"/> + <attribute default="${javac.classpath}" name="classpath"/> + <attribute default="${javac.processorpath}" name="processorpath"/> + <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/> + <attribute default="${includes}" name="includes"/> + <attribute default="${excludes}" name="excludes"/> + <attribute default="${javac.debug}" name="debug"/> + <attribute default="${empty.dir}" name="sourcepath"/> + <attribute default="${empty.dir}" name="gensrcdir"/> + <element name="customize" optional="true"/> + <sequential> + <property location="${build.dir}/empty" name="empty.dir"/> + <mkdir dir="${empty.dir}"/> + <mkdir dir="@{apgeneratedsrcdir}"/> + <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}"> + <src> + <dirset dir="@{gensrcdir}" erroronmissingdir="false"> + <include name="*"/> + </dirset> + </src> + <classpath> + <path path="@{classpath}"/> + </classpath> + <compilerarg line="${endorsed.classpath.cmd.line.arg}"/> + <compilerarg line="${javac.compilerargs}"/> + <compilerarg value="-processorpath"/> + <compilerarg path="@{processorpath}:${empty.dir}"/> + <compilerarg line="${ap.processors.internal}"/> + <compilerarg line="${annotation.processing.processor.options}"/> + <compilerarg value="-s"/> + <compilerarg path="@{apgeneratedsrcdir}"/> + <compilerarg line="${ap.proc.none.internal}"/> + <customize/> + </javac> + </sequential> + </macrodef> + </target> + <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal"> + <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${src.dir}" name="srcdir"/> + <attribute default="${build.classes.dir}" name="destdir"/> + <attribute default="${javac.classpath}" name="classpath"/> + <attribute default="${javac.processorpath}" name="processorpath"/> + <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/> + <attribute default="${includes}" name="includes"/> + <attribute default="${excludes}" name="excludes"/> + <attribute default="${javac.debug}" name="debug"/> + <attribute default="${empty.dir}" name="sourcepath"/> + <attribute default="${empty.dir}" name="gensrcdir"/> + <element name="customize" optional="true"/> + <sequential> + <property location="${build.dir}/empty" name="empty.dir"/> + <mkdir dir="${empty.dir}"/> + <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}"> + <src> + <dirset dir="@{gensrcdir}" erroronmissingdir="false"> + <include name="*"/> + </dirset> + </src> + <classpath> + <path path="@{classpath}"/> + </classpath> + <compilerarg line="${endorsed.classpath.cmd.line.arg}"/> + <compilerarg line="${javac.compilerargs}"/> + <customize/> + </javac> + </sequential> + </macrodef> + </target> + <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac"> + <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${src.dir}" name="srcdir"/> + <attribute default="${build.classes.dir}" name="destdir"/> + <attribute default="${javac.classpath}" name="classpath"/> + <sequential> + <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}"> + <classpath> + <path path="@{classpath}"/> + </classpath> + </depend> + </sequential> + </macrodef> + <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${build.classes.dir}" name="destdir"/> + <sequential> + <fail unless="javac.includes">Must set javac.includes</fail> + <pathconvert pathsep="${line.separator}" property="javac.includes.binary"> + <path> + <filelist dir="@{destdir}" files="${javac.includes}"/> + </path> + <globmapper from="*.java" to="*.class"/> + </pathconvert> + <tempfile deleteonexit="true" property="javac.includesfile.binary"/> + <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/> + <delete> + <files includesfile="${javac.includesfile.binary}"/> + </delete> + <delete> + <fileset file="${javac.includesfile.binary}"/> + </delete> + </sequential> + </macrodef> + </target> + <target name="-init-macrodef-junit"> + <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${includes}" name="includes"/> + <attribute default="${excludes}" name="excludes"/> + <attribute default="**" name="testincludes"/> + <sequential> + <property name="junit.forkmode" value="perTest"/> + <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}"> + <batchtest todir="${build.test.results.dir}"> + <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}"> + <filename name="@{testincludes}"/> + </fileset> + </batchtest> + <classpath> + <path path="${run.test.classpath}"/> + </classpath> + <syspropertyset> + <propertyref prefix="test-sys-prop."/> + <mapper from="test-sys-prop.*" to="*" type="glob"/> + </syspropertyset> + <formatter type="brief" usefile="false"/> + <formatter type="xml"/> + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/> + <jvmarg value="-ea"/> + <jvmarg line="${run.jvmargs}"/> + </junit> + </sequential> + </macrodef> + </target> + <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" name="profile-init"/> + <target name="-profile-pre-init"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target name="-profile-post-init"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target name="-profile-init-macrodef-profile"> + <macrodef name="resolve"> + <attribute name="name"/> + <attribute name="value"/> + <sequential> + <property name="@{name}" value="${env.@{value}}"/> + </sequential> + </macrodef> + <macrodef name="profile"> + <attribute default="${main.class}" name="classname"/> + <element name="customize" optional="true"/> + <sequential> + <property environment="env"/> + <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/> + <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}"> + <jvmarg value="${profiler.info.jvmargs.agent}"/> + <jvmarg line="${profiler.info.jvmargs}"/> + <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/> + <arg line="${application.args}"/> + <classpath> + <path path="${run.classpath}"/> + </classpath> + <syspropertyset> + <propertyref prefix="run-sys-prop."/> + <mapper from="run-sys-prop.*" to="*" type="glob"/> + </syspropertyset> + <customize/> + </java> + </sequential> + </macrodef> + </target> + <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" name="-profile-init-check"> + <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail> + <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail> + </target> + <target depends="-init-debug-args" name="-init-macrodef-nbjpda"> + <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1"> + <attribute default="${main.class}" name="name"/> + <attribute default="${debug.classpath}" name="classpath"/> + <attribute default="" name="stopclassname"/> + <sequential> + <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}"> + <classpath> + <path path="@{classpath}"/> + </classpath> + </nbjpdastart> + </sequential> + </macrodef> + <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1"> + <attribute default="${build.classes.dir}" name="dir"/> + <sequential> + <nbjpdareload> + <fileset dir="@{dir}" includes="${fix.classes}"> + <include name="${fix.includes}*.class"/> + </fileset> + </nbjpdareload> + </sequential> + </macrodef> + </target> + <target name="-init-debug-args"> + <property name="version-output" value="java version "${ant.java.version}"/> + <condition property="have-jdk-older-than-1.4"> + <or> + <contains string="${version-output}" substring="java version "1.0"/> + <contains string="${version-output}" substring="java version "1.1"/> + <contains string="${version-output}" substring="java version "1.2"/> + <contains string="${version-output}" substring="java version "1.3"/> + </or> + </condition> + <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none"> + <istrue value="${have-jdk-older-than-1.4}"/> + </condition> + <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem"> + <os family="windows"/> + </condition> + <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}"> + <isset property="debug.transport"/> + </condition> + </target> + <target depends="-init-debug-args" name="-init-macrodef-debug"> + <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${main.class}" name="classname"/> + <attribute default="${debug.classpath}" name="classpath"/> + <element name="customize" optional="true"/> + <sequential> + <java classname="@{classname}" dir="${work.dir}" fork="true"> + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/> + <jvmarg line="${debug-args-line}"/> + <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/> + <jvmarg value="-Dfile.encoding=${runtime.encoding}"/> + <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/> + <jvmarg line="${run.jvmargs}"/> + <classpath> + <path path="@{classpath}"/> + </classpath> + <syspropertyset> + <propertyref prefix="run-sys-prop."/> + <mapper from="run-sys-prop.*" to="*" type="glob"/> + </syspropertyset> + <customize/> + </java> + </sequential> + </macrodef> + </target> + <target name="-init-macrodef-java"> + <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1"> + <attribute default="${main.class}" name="classname"/> + <attribute default="${run.classpath}" name="classpath"/> + <element name="customize" optional="true"/> + <sequential> + <java classname="@{classname}" dir="${work.dir}" fork="true"> + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/> + <jvmarg value="-Dfile.encoding=${runtime.encoding}"/> + <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/> + <jvmarg line="${run.jvmargs}"/> + <classpath> + <path path="@{classpath}"/> + </classpath> + <syspropertyset> + <propertyref prefix="run-sys-prop."/> + <mapper from="run-sys-prop.*" to="*" type="glob"/> + </syspropertyset> + <customize/> + </java> + </sequential> + </macrodef> + </target> + <target name="-init-macrodef-copylibs"> + <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${manifest.file}" name="manifest"/> + <element name="customize" optional="true"/> + <sequential> + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/> + <pathconvert property="run.classpath.without.build.classes.dir"> + <path path="${run.classpath}"/> + <map from="${build.classes.dir.resolved}" to=""/> + </pathconvert> + <pathconvert pathsep=" " property="jar.classpath"> + <path path="${run.classpath.without.build.classes.dir}"/> + <chainedmapper> + <flattenmapper/> + <globmapper from="*" to="lib/*"/> + </chainedmapper> + </pathconvert> + <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/> + <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" runtimeclasspath="${run.classpath.without.build.classes.dir}"> + <fileset dir="${build.classes.dir}"/> + <manifest> + <attribute name="Class-Path" value="${jar.classpath}"/> + <customize/> + </manifest> + </copylibs> + </sequential> + </macrodef> + </target> + <target name="-init-presetdef-jar"> + <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1"> + <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}"> + <j2seproject1:fileset dir="${build.classes.dir}"/> + </jar> + </presetdef> + </target> + <target name="-init-ap-cmdline-properties"> + <property name="annotation.processing.enabled" value="true"/> + <property name="annotation.processing.processors.list" value=""/> + <property name="annotation.processing.processor.options" value=""/> + <property name="annotation.processing.run.all.processors" value="true"/> + <property name="javac.processorpath" value="${javac.classpath}"/> + <property name="javac.test.processorpath" value="${javac.test.classpath}"/> + <condition property="ap.supported.internal" value="true"> + <not> + <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/> + </not> + </condition> + </target> + <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported"> + <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}"> + <isfalse value="${annotation.processing.run.all.processors}"/> + </condition> + <condition else="" property="ap.proc.none.internal" value="-proc:none"> + <isfalse value="${annotation.processing.enabled}"/> + </condition> + </target> + <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline"> + <property name="ap.cmd.line.internal" value=""/> + </target> + <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/> + <!-- + =================== + COMPILATION SECTION + =================== + --> + <target name="-deps-jar-init" unless="built-jar.properties"> + <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/> + <delete file="${built-jar.properties}" quiet="true"/> + </target> + <target if="already.built.jar.${basedir}" name="-warn-already-built-jar"> + <echo level="warn" message="Cycle detected: EssentialsGeoIP was already built"/> + </target> + <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps"> + <mkdir dir="${build.dir}"/> + <touch file="${built-jar.properties}" verbose="false"/> + <property file="${built-jar.properties}" prefix="already.built.jar."/> + <antcall target="-warn-already-built-jar"/> + <propertyfile file="${built-jar.properties}"> + <entry key="${basedir}" value=""/> + </propertyfile> + <antcall target="-maybe-call-dep"> + <param name="call.built.properties" value="${built-jar.properties}"/> + <param location="${project.Essentials}" name="call.subproject"/> + <param location="${project.Essentials}/build.xml" name="call.script"/> + <param name="call.target" value="jar"/> + <param name="transfer.built-jar.properties" value="${built-jar.properties}"/> + </antcall> + </target> + <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/> + <target depends="init" name="-check-automatic-build"> + <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/> + </target> + <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build"> + <antcall target="clean"/> + </target> + <target depends="init,deps-jar" name="-pre-pre-compile"> + <mkdir dir="${build.classes.dir}"/> + </target> + <target name="-pre-compile"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target if="do.depend.true" name="-compile-depend"> + <pathconvert property="build.generated.subdirs"> + <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false"> + <include name="*"/> + </dirset> + </pathconvert> + <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/> + </target> + <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile"> + <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/> + <copy todir="${build.classes.dir}"> + <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/> + </copy> + </target> + <target if="has.persistence.xml" name="-copy-persistence-xml"> + <mkdir dir="${build.classes.dir}/META-INF"/> + <copy todir="${build.classes.dir}/META-INF"> + <fileset dir="${meta.inf.dir}" includes="persistence.xml"/> + </copy> + </target> + <target name="-post-compile"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/> + <target name="-pre-compile-single"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single"> + <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail> + <j2seproject3:force-recompile/> + <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/> + </target> + <target name="-post-compile-single"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/> + <!-- + ==================== + JAR BUILDING SECTION + ==================== + --> + <target depends="init" name="-pre-pre-jar"> + <dirname file="${dist.jar}" property="dist.jar.dir"/> + <mkdir dir="${dist.jar.dir}"/> + </target> + <target name="-pre-jar"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available"> + <j2seproject1:jar/> + </target> + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available"> + <j2seproject1:jar manifest="${manifest.file}"/> + </target> + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available"> + <j2seproject1:jar manifest="${manifest.file}"> + <j2seproject1:manifest> + <j2seproject1:attribute name="Main-Class" value="${main.class}"/> + </j2seproject1:manifest> + </j2seproject1:jar> + <echo level="info">To run this application from the command line without Ant, try:</echo> + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/> + <property location="${dist.jar}" name="dist.jar.resolved"/> + <pathconvert property="run.classpath.with.dist.jar"> + <path path="${run.classpath}"/> + <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/> + </pathconvert> + <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo> + </target> + <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available"> + <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/> + <touch file="${tmp.manifest.file}" verbose="false"/> + </target> + <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest"> + <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/> + <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/> + </target> + <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+main.class.available" name="-do-jar-with-libraries-set-main"> + <manifest file="${tmp.manifest.file}" mode="update"> + <attribute name="Main-Class" value="${main.class}"/> + </manifest> + </target> + <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-with-libraries-set-splashscreen"> + <basename file="${application.splash}" property="splashscreen.basename"/> + <mkdir dir="${build.classes.dir}/META-INF"/> + <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/> + <manifest file="${tmp.manifest.file}" mode="update"> + <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/> + </manifest> + </target> + <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen" if="do.mkdist" name="-do-jar-with-libraries-pack"> + <j2seproject3:copylibs manifest="${tmp.manifest.file}"/> + <echo level="info">To run this application from the command line without Ant, try:</echo> + <property location="${dist.jar}" name="dist.jar.resolved"/> + <echo level="info">java -jar "${dist.jar.resolved}"</echo> + </target> + <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest"> + <delete> + <fileset file="${tmp.manifest.file}"/> + </delete> + </target> + <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen,-do-jar-with-libraries-pack,-do-jar-with-libraries-delete-manifest" name="-do-jar-with-libraries"/> + <target name="-post-jar"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/> + <!-- + ================= + EXECUTION SECTION + ================= + --> + <target depends="init,compile" description="Run a main class." name="run"> + <j2seproject1:java> + <customize> + <arg line="${application.args}"/> + </customize> + </j2seproject1:java> + </target> + <target name="-do-not-recompile"> + <property name="javac.includes.binary" value=""/> + </target> + <target depends="init,compile-single" name="run-single"> + <fail unless="run.class">Must select one file in the IDE or set run.class</fail> + <j2seproject1:java classname="${run.class}"/> + </target> + <target depends="init,compile-test-single" name="run-test-with-main"> + <fail unless="run.class">Must select one file in the IDE or set run.class</fail> + <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/> + </target> + <!-- + ================= + DEBUGGING SECTION + ================= + --> + <target depends="init" if="netbeans.home" name="-debug-start-debugger"> + <j2seproject1:nbjpdastart name="${debug.class}"/> + </target> + <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test"> + <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/> + </target> + <target depends="init,compile" name="-debug-start-debuggee"> + <j2seproject3:debug> + <customize> + <arg line="${application.args}"/> + </customize> + </j2seproject3:debug> + </target> + <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/> + <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto"> + <j2seproject1:nbjpdastart stopclassname="${main.class}"/> + </target> + <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/> + <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single"> + <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail> + <j2seproject3:debug classname="${debug.class}"/> + </target> + <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/> + <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test"> + <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail> + <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/> + </target> + <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/> + <target depends="init" name="-pre-debug-fix"> + <fail unless="fix.includes">Must set fix.includes</fail> + <property name="javac.includes" value="${fix.includes}.java"/> + </target> + <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix"> + <j2seproject1:nbjpdareload/> + </target> + <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/> + <!-- + ================= + PROFILING SECTION + ================= + --> + <target depends="profile-init,compile" description="Profile a project in the IDE." if="netbeans.home" name="profile"> + <nbprofiledirect> + <classpath> + <path path="${run.classpath}"/> + </classpath> + </nbprofiledirect> + <profile/> + </target> + <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="netbeans.home" name="profile-single"> + <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail> + <nbprofiledirect> + <classpath> + <path path="${run.classpath}"/> + </classpath> + </nbprofiledirect> + <profile classname="${profile.class}"/> + </target> + <!-- + ========================= + APPLET PROFILING SECTION + ========================= + --> + <target depends="profile-init,compile-single" if="netbeans.home" name="profile-applet"> + <nbprofiledirect> + <classpath> + <path path="${run.classpath}"/> + </classpath> + </nbprofiledirect> + <profile classname="sun.applet.AppletViewer"> + <customize> + <arg value="${applet.url}"/> + </customize> + </profile> + </target> + <!-- + ========================= + TESTS PROFILING SECTION + ========================= + --> + <target depends="profile-init,compile-test-single" if="netbeans.home" name="profile-test-single"> + <nbprofiledirect> + <classpath> + <path path="${run.test.classpath}"/> + </classpath> + </nbprofiledirect> + <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true"> + <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/> + <jvmarg value="${profiler.info.jvmargs.agent}"/> + <jvmarg line="${profiler.info.jvmargs}"/> + <test name="${profile.class}"/> + <classpath> + <path path="${run.test.classpath}"/> + </classpath> + <syspropertyset> + <propertyref prefix="test-sys-prop."/> + <mapper from="test-sys-prop.*" to="*" type="glob"/> + </syspropertyset> + <formatter type="brief" usefile="false"/> + <formatter type="xml"/> + </junit> + </target> + <!-- + =============== + JAVADOC SECTION + =============== + --> + <target depends="init" if="have.sources" name="-javadoc-build"> + <mkdir dir="${dist.javadoc.dir}"/> + <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}"> + <classpath> + <path path="${javac.classpath}"/> + </classpath> + <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}"> + <filename name="**/*.java"/> + </fileset> + <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false"> + <include name="**/*.java"/> + </fileset> + </javadoc> + <copy todir="${dist.javadoc.dir}"> + <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}"> + <filename name="**/doc-files/**"/> + </fileset> + <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false"> + <include name="**/doc-files/**"/> + </fileset> + </copy> + </target> + <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview"> + <nbbrowse file="${dist.javadoc.dir}/index.html"/> + </target> + <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/> + <!-- + ========================= + JUNIT COMPILATION SECTION + ========================= + --> + <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test"> + <mkdir dir="${build.test.classes.dir}"/> + </target> + <target name="-pre-compile-test"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target if="do.depend.true" name="-compile-test-depend"> + <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/> + </target> + <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test"> + <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.src.dir}"/> + <copy todir="${build.test.classes.dir}"> + <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/> + </copy> + </target> + <target name="-post-compile-test"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/> + <target name="-pre-compile-test-single"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single"> + <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail> + <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/> + <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/> + <copy todir="${build.test.classes.dir}"> + <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/> + </copy> + </target> + <target name="-post-compile-test-single"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/> + <!-- + ======================= + JUNIT EXECUTION SECTION + ======================= + --> + <target depends="init" if="have.tests" name="-pre-test-run"> + <mkdir dir="${build.test.results.dir}"/> + </target> + <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run"> + <j2seproject3:junit testincludes="**/*Test.java"/> + </target> + <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run"> + <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail> + </target> + <target depends="init" if="have.tests" name="test-report"/> + <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/> + <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/> + <target depends="init" if="have.tests" name="-pre-test-run-single"> + <mkdir dir="${build.test.results.dir}"/> + </target> + <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single"> + <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail> + <j2seproject3:junit excludes="" includes="${test.includes}"/> + </target> + <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single"> + <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail> + </target> + <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/> + <!-- + ======================= + JUNIT DEBUGGING SECTION + ======================= + --> + <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test"> + <fail unless="test.class">Must select one file in the IDE or set test.class</fail> + <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/> + <delete file="${test.report.file}"/> + <mkdir dir="${build.test.results.dir}"/> + <j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}"> + <customize> + <syspropertyset> + <propertyref prefix="test-sys-prop."/> + <mapper from="test-sys-prop.*" to="*" type="glob"/> + </syspropertyset> + <arg value="${test.class}"/> + <arg value="showoutput=true"/> + <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/> + <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/> + </customize> + </j2seproject3:debug> + </target> + <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test"> + <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/> + </target> + <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/> + <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test"> + <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/> + </target> + <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/> + <!-- + ========================= + APPLET EXECUTION SECTION + ========================= + --> + <target depends="init,compile-single" name="run-applet"> + <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail> + <j2seproject1:java classname="sun.applet.AppletViewer"> + <customize> + <arg value="${applet.url}"/> + </customize> + </j2seproject1:java> + </target> + <!-- + ========================= + APPLET DEBUGGING SECTION + ========================= + --> + <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet"> + <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail> + <j2seproject3:debug classname="sun.applet.AppletViewer"> + <customize> + <arg value="${applet.url}"/> + </customize> + </j2seproject3:debug> + </target> + <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/> + <!-- + =============== + CLEANUP SECTION + =============== + --> + <target name="-deps-clean-init" unless="built-clean.properties"> + <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/> + <delete file="${built-clean.properties}" quiet="true"/> + </target> + <target if="already.built.clean.${basedir}" name="-warn-already-built-clean"> + <echo level="warn" message="Cycle detected: EssentialsGeoIP was already built"/> + </target> + <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps"> + <mkdir dir="${build.dir}"/> + <touch file="${built-clean.properties}" verbose="false"/> + <property file="${built-clean.properties}" prefix="already.built.clean."/> + <antcall target="-warn-already-built-clean"/> + <propertyfile file="${built-clean.properties}"> + <entry key="${basedir}" value=""/> + </propertyfile> + <antcall target="-maybe-call-dep"> + <param name="call.built.properties" value="${built-clean.properties}"/> + <param location="${project.Essentials}" name="call.subproject"/> + <param location="${project.Essentials}/build.xml" name="call.script"/> + <param name="call.target" value="clean"/> + <param name="transfer.built-clean.properties" value="${built-clean.properties}"/> + </antcall> + </target> + <target depends="init" name="-do-clean"> + <delete dir="${build.dir}"/> + <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/> + </target> + <target name="-post-clean"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/> + <target name="-check-call-dep"> + <property file="${call.built.properties}" prefix="already.built."/> + <condition property="should.call.dep"> + <not> + <isset property="already.built.${call.subproject}"/> + </not> + </condition> + </target> + <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep"> + <ant antfile="${call.script}" inheritall="false" target="${call.target}"> + <propertyset> + <propertyref prefix="transfer."/> + <mapper from="transfer.*" to="*" type="glob"/> + </propertyset> + </ant> + </target> +</project> diff --git a/EssentialsGeoIP/nbproject/genfiles.properties b/EssentialsGeoIP/nbproject/genfiles.properties new file mode 100644 index 000000000..7a24e69c2 --- /dev/null +++ b/EssentialsGeoIP/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=cbf94f59 +build.xml.script.CRC32=c4b1bb0e +build.xml.stylesheet.CRC32=28e38971@1.42.1.45 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=cbf94f59 +nbproject/build-impl.xml.script.CRC32=a87d6c0a +nbproject/build-impl.xml.stylesheet.CRC32=0c01fd8e@1.43.1.45 diff --git a/EssentialsGeoIP/nbproject/project.properties b/EssentialsGeoIP/nbproject/project.properties new file mode 100644 index 000000000..ed96af206 --- /dev/null +++ b/EssentialsGeoIP/nbproject/project.properties @@ -0,0 +1,78 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processor.options= +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +# Uncomment to specify the preferred debugger connection transport: +#debug.transport=dt_socket +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/EssentialsGeoIP.jar +dist.javadoc.dir=${dist.dir}/javadoc +excludes= +file.reference.craftbukkit-0.0.1-SNAPSHOT.jar=../lib/craftbukkit-0.0.1-SNAPSHOT.jar +includes=** +jar.compress=false +javac.classpath=\ + ${reference.Essentials.jar}:\ + ${file.reference.craftbukkit-0.0.1-SNAPSHOT.jar} +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.processorpath=\ + ${javac.classpath} +javac.source=1.6 +javac.target=1.6 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir}:\ + ${libs.junit.classpath}:\ + ${libs.junit_4.classpath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +main.class= +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +mkdist.disabled=false +platform.active=default_platform +project.Essentials=../Essentials +reference.Essentials.jar=${project.Essentials}/dist/Essentials.jar +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/EssentialsGeoIP/nbproject/project.xml b/EssentialsGeoIP/nbproject/project.xml new file mode 100644 index 000000000..2c6cc9d84 --- /dev/null +++ b/EssentialsGeoIP/nbproject/project.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://www.netbeans.org/ns/project/1"> + <type>org.netbeans.modules.java.j2seproject</type> + <configuration> + <data xmlns="http://www.netbeans.org/ns/j2se-project/3"> + <name>EssentialsGeoIP</name> + <source-roots> + <root id="src.dir"/> + </source-roots> + <test-roots> + <root id="test.src.dir"/> + </test-roots> + </data> + <libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1"> + <definitions>../lib/nblibraries.properties</definitions> + </libraries> + <references xmlns="http://www.netbeans.org/ns/ant-project-references/1"> + <reference> + <foreign-project>Essentials</foreign-project> + <artifact-type>jar</artifact-type> + <script>build.xml</script> + <target>jar</target> + <clean-target>clean</clean-target> + <id>jar</id> + </reference> + </references> + </configuration> +</project> diff --git a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java new file mode 100644 index 000000000..1a01c7132 --- /dev/null +++ b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java @@ -0,0 +1,45 @@ +package com.earth2me.essentials.geoip; + +import com.earth2me.essentials.Essentials; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.bukkit.event.Event.Priority; +import org.bukkit.event.Event.Type; +import org.bukkit.plugin.Plugin; +import org.bukkit.plugin.PluginManager; +import org.bukkit.plugin.java.JavaPlugin; + + +public class EssentialsGeoIP extends JavaPlugin +{ + private static final Logger logger = Logger.getLogger("Minecraft"); + + public EssentialsGeoIP() + { + } + + @Override + public void onDisable() + { + } + + @Override + public void onEnable() + { + PluginManager pm = getServer().getPluginManager(); + Plugin ess = pm.getPlugin("Essentials"); + if (ess != null) + { + if (!pm.isPluginEnabled(ess)) + { + pm.enablePlugin(ess); + } + } + EssentialsGeoIPPlayerListener playerListener = new EssentialsGeoIPPlayerListener(getDataFolder()); + pm.registerEvent(Type.PLAYER_JOIN, playerListener, Priority.Monitor, this); + + logger.info("Loaded " + this.getDescription().getName() + " build " + this.getDescription().getVersion() + " by " + Essentials.AUTHORS); + + logger.log(Level.INFO, "This product includes GeoLite data created by MaxMind, available from http://www.maxmind.com/."); + } +} diff --git a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java new file mode 100644 index 000000000..2d9bd7749 --- /dev/null +++ b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java @@ -0,0 +1,162 @@ +package com.earth2me.essentials.geoip; + +import com.earth2me.essentials.EssentialsConf; +import com.earth2me.essentials.IConf; +import com.earth2me.essentials.User; +import com.maxmind.geoip.Location; +import com.maxmind.geoip.LookupService; +import com.maxmind.geoip.regionName; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.InetAddress; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLConnection; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.zip.GZIPInputStream; +import org.bukkit.event.player.PlayerJoinEvent; +import org.bukkit.event.player.PlayerListener; + + +public class EssentialsGeoIPPlayerListener extends PlayerListener implements IConf +{ + LookupService ls = null; + private static final Logger logger = Logger.getLogger("Minecraft"); + File databaseFile; + File dataFolder; + EssentialsConf config; + + public EssentialsGeoIPPlayerListener(File dataFolder) + { + this.dataFolder = dataFolder; + this.config = new EssentialsConf(new File(dataFolder, "config.yml")); + config.setTemplateName("/config.yml", EssentialsGeoIP.class); + reloadConfig(); + } + + @Override + public void onPlayerJoin(PlayerJoinEvent event) + { + InetAddress address = event.getPlayer().getAddress().getAddress(); + StringBuilder sb = new StringBuilder(); + if (config.getBoolean("database.show-cities", false)) + { + Location loc = ls.getLocation(address); + if (loc == null) + { + return; + } + if (loc.city != null) + { + sb.append(loc.city).append(", "); + } + String region = regionName.regionNameByCode(loc.countryCode, loc.region); + if (region != null) + { + sb.append(region).append(", "); + } + sb.append(loc.countryName); + } + else + { + sb.append(ls.getCountry(address).getName()); + } + if (config.getBoolean("show-on-whois", true)) + { + User.get(event.getPlayer()).setMetadata("location", sb.toString()); + } + if (config.getBoolean("show-on-login", true)) + { + event.getPlayer().getServer().broadcastMessage("Player " + event.getPlayer().getDisplayName() + " comes from " + sb.toString()); + } + } + + @Override + public final void reloadConfig() + { + config.load(); + + if (config.getBoolean("database.show-cities", false)) + { + databaseFile = new File(dataFolder, "GeoIPCity.dat"); + } + else + { + databaseFile = new File(dataFolder, "GeoIP.dat"); + } + if (!databaseFile.exists()) + { + if (config.getBoolean("database.download-if-missing", true)) + { + downloadDatabase(); + } + else + { + logger.log(Level.SEVERE, "Can't find GeoIP database!"); + return; + } + } + try + { + ls = new LookupService(databaseFile); + } + catch (IOException ex) + { + logger.log(Level.SEVERE, "Failed to read GeoIP database!", ex); + } + } + + private void downloadDatabase() + { + try + { + String url; + if (config.getBoolean("database.show-cities", false)) + { + url = config.getString("database.download-url-city"); + } + else + { + url = config.getString("database.download-url"); + } + if (url == null || url.isEmpty()) + { + logger.log(Level.SEVERE, "GeoIP download url is empty."); + return; + } + logger.log(Level.INFO, "Downloading GeoIP database ... this might take a while (country: 0.6 MB, city: 20MB)"); + URL downloadUrl = new URL(url); + URLConnection conn = downloadUrl.openConnection(); + conn.setConnectTimeout(10000); + conn.connect(); + InputStream input = conn.getInputStream(); + if (url.endsWith(".gz")) + { + input = new GZIPInputStream(input); + } + OutputStream output = new FileOutputStream(databaseFile); + byte[] buffer = new byte[2048]; + int length = input.read(buffer); + while (length >= 0) + { + output.write(buffer, 0, length); + length = input.read(buffer); + } + output.close(); + input.close(); + } + catch (MalformedURLException ex) + { + logger.log(Level.SEVERE, "GeoIP download url is invalid.", ex); + return; + } + catch (IOException ex) + { + logger.log(Level.SEVERE, "Failed to open connection.", ex); + } + } +} diff --git a/EssentialsGeoIP/src/com/maxmind/LICENSE b/EssentialsGeoIP/src/com/maxmind/LICENSE new file mode 100644 index 000000000..5ab7695ab --- /dev/null +++ b/EssentialsGeoIP/src/com/maxmind/LICENSE @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + <one line to give the library's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + <signature of Ty Coon>, 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/EssentialsGeoIP/src/com/maxmind/geoip/Country.java b/EssentialsGeoIP/src/com/maxmind/geoip/Country.java new file mode 100644 index 000000000..d250eb766 --- /dev/null +++ b/EssentialsGeoIP/src/com/maxmind/geoip/Country.java @@ -0,0 +1,61 @@ +/** + * Country.java + * + * Copyright (C) 2003 MaxMind LLC. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +package com.maxmind.geoip; + +/** + * Represents a country. + * + * @author Matt Tucker + */ +public class Country { + + private String code; + private String name; + + /** + * Creates a new Country. + * + * @param code the country code. + * @param name the country name. + */ + public Country(String code, String name) { + this.code = code; + this.name = name; + } + + /** + * Returns the ISO two-letter country code of this country. + * + * @return the country code. + */ + public String getCode() { + return code; + } + + /** + * Returns the name of this country. + * + * @return the country name. + */ + public String getName() { + return name; + } +} diff --git a/EssentialsGeoIP/src/com/maxmind/geoip/DatabaseInfo.java b/EssentialsGeoIP/src/com/maxmind/geoip/DatabaseInfo.java new file mode 100644 index 000000000..dfed516a5 --- /dev/null +++ b/EssentialsGeoIP/src/com/maxmind/geoip/DatabaseInfo.java @@ -0,0 +1,117 @@ +/** + * DatabaseInfo.java + * + * Copyright (C) 2003 MaxMind LLC. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +package com.maxmind.geoip; + +import java.util.Date; +import java.text.SimpleDateFormat; +import java.text.ParseException; + +/** + * Encapsulates metadata about the GeoIP database. The database has a date, is a premium or + * standard version, and is one of the following types: + * + * <ul> + * <li>Country edition -- this is the most common version of the database. It includes + * the name of the country and it's ISO country code given an IP address. + * <li>Region edition -- includes the country information as well as + * what U.S. state or Canadian province the IP address is from if the IP address + * is from the U.S. or Canada. + * <li>City edition -- includes country, region, city, postal code, latitude, and + * longitude information. + * <li>Org edition -- includes netblock owner. + * <li>ISP edition -- ISP information. + * </ul> + * + * @see com.maxmind.geoip.LookupService#getDatabaseInfo() + * @author Matt Tucker + */ +public class DatabaseInfo { + + public final static int COUNTRY_EDITION = 1; + public final static int REGION_EDITION_REV0 = 7; + public final static int REGION_EDITION_REV1 = 3; + public final static int CITY_EDITION_REV0 = 6; + public final static int CITY_EDITION_REV1 = 2; + public final static int ORG_EDITION = 5; + public final static int ISP_EDITION = 4; + public final static int PROXY_EDITION = 8; + public final static int ASNUM_EDITION = 9; + public final static int NETSPEED_EDITION = 10; + public final static int COUNTRY_EDITION_V6 = 12; + +private static SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd"); + + private String info; + + /** + * Creates a new DatabaseInfo object given the database info String. + * @param info + */ + public DatabaseInfo(String info) { + this.info = info; + } + + public int getType() { + if (info == null || info.equals("")) { + return COUNTRY_EDITION; + } + else { + // Get the type code from the database info string and then + // subtract 105 from the value to preserve compatability with + // databases from April 2003 and earlier. + return Integer.parseInt(info.substring(4, 7)) - 105; + } + } + + /** + * Returns true if the database is the premium version. + * + * @return true if the premium version of the database. + */ + public boolean isPremium() { + return info.indexOf("FREE") < 0; + } + + /** + * Returns the date of the database. + * + * @return the date of the database. + */ + public Date getDate() { + for (int i=0; i<info.length()-9; i++) { + if (Character.isWhitespace(info.charAt(i))) { + String dateString = info.substring(i+1, i+9); + try { + synchronized (formatter) { + return formatter.parse(dateString); + } + } + catch (ParseException pe) { } + break; + } + } + return null; + } + + public String toString() { + return info; + } +} diff --git a/EssentialsGeoIP/src/com/maxmind/geoip/Location.java b/EssentialsGeoIP/src/com/maxmind/geoip/Location.java new file mode 100644 index 000000000..040fcb6b1 --- /dev/null +++ b/EssentialsGeoIP/src/com/maxmind/geoip/Location.java @@ -0,0 +1,60 @@ +/** + * Location.java + * + * Copyright (C) 2004 MaxMind LLC. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Lesser Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +package com.maxmind.geoip; + +public class Location { + public String countryCode; + public String countryName; + public String region; + public String city; + public String postalCode; + public float latitude; + public float longitude; + public int dma_code; + public int area_code; + public int metro_code; + + private final static double EARTH_DIAMETER = 2 * 6378.2; + private final static double PI = 3.14159265; + private final static double RAD_CONVERT = PI / 180; + + public double distance (Location loc) { + double delta_lat, delta_lon; + double temp; + + float lat1 = latitude; + float lon1 = longitude; + float lat2 = loc.latitude; + float lon2 = loc.longitude; + + // convert degrees to radians + lat1 *= RAD_CONVERT; + lat2 *= RAD_CONVERT; + + // find the deltas + delta_lat = lat2 - lat1; + delta_lon = (lon2 - lon1) * RAD_CONVERT; + + // Find the great circle distance + temp = Math.pow(Math.sin(delta_lat/2),2) + Math.cos(lat1) * Math.cos(lat2) * Math.pow(Math.sin(delta_lon/2),2); + return EARTH_DIAMETER * Math.atan2(Math.sqrt(temp),Math.sqrt(1-temp)); + } +} diff --git a/EssentialsGeoIP/src/com/maxmind/geoip/LookupService.java b/EssentialsGeoIP/src/com/maxmind/geoip/LookupService.java new file mode 100644 index 000000000..406cda004 --- /dev/null +++ b/EssentialsGeoIP/src/com/maxmind/geoip/LookupService.java @@ -0,0 +1,1046 @@ +/** + * LookupService.java + * + * Copyright (C) 2003 MaxMind LLC. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +package com.maxmind.geoip; + +import java.io.File; +import java.io.IOException; +import java.io.RandomAccessFile; +import java.net.InetAddress; +import java.net.Inet6Address; +import java.net.UnknownHostException; +import java.util.HashMap; +import java.util.Hashtable; +import java.util.StringTokenizer; + +import javax.naming.NamingException; +import javax.naming.directory.Attributes; +import javax.naming.directory.DirContext; +import javax.naming.directory.InitialDirContext; + +/** + * Provides a lookup service for information based on an IP address. The location of + * a database file is supplied when creating a lookup service instance. The edition of + * the database determines what information is available about an IP address. See the + * DatabaseInfo class for further details.<p> + * + * The following code snippet demonstrates looking up the country that an IP + * address is from: + * <pre> + * // First, create a LookupService instance with the location of the database. + * LookupService lookupService = new LookupService("c:\\geoip.dat"); + * // Assume we have a String ipAddress (in dot-decimal form). + * Country country = lookupService.getCountry(ipAddress); + * System.out.println("The country is: " + country.getName()); + * System.out.println("The country code is: " + country.getCode()); + * </pre> + * + * In general, a single LookupService instance should be created and then reused + * repeatedly.<p> + * + * <i>Tip:</i> Those deploying the GeoIP API as part of a web application may find it + * difficult to pass in a File to create the lookup service, as the location of the + * database may vary per deployment or may even be part of the web-application. In this + * case, the database should be added to the classpath of the web-app. For example, by + * putting it into the WEB-INF/classes directory of the web application. The following code + * snippet demonstrates how to create a LookupService using a database that can be found + * on the classpath: + * + * <pre> + * String fileName = getClass().getResource("/GeoIP.dat").toExternalForm().substring(6); + * LookupService lookupService = new LookupService(fileName);</pre> + * + * @author Matt Tucker (matt@jivesoftware.com) + */ +public class LookupService { + + /** + * Database file. + */ + private RandomAccessFile file = null; + private File databaseFile = null; + + /** + * Information about the database. + */ + private DatabaseInfo databaseInfo = null; + + /** + * The database type. Default is the country edition. + */ + byte databaseType = DatabaseInfo.COUNTRY_EDITION; + + int databaseSegments[]; + int recordLength; + + String licenseKey; + int dnsService = 0; + int dboptions; + byte dbbuffer[]; + byte index_cache[]; + long mtime; + int last_netmask; + private final static int US_OFFSET = 1; + private final static int CANADA_OFFSET = 677; + private final static int WORLD_OFFSET = 1353; + private final static int FIPS_RANGE = 360; + private final static int COUNTRY_BEGIN = 16776960; + private final static int STATE_BEGIN_REV0 = 16700000; + private final static int STATE_BEGIN_REV1 = 16000000; + private final static int STRUCTURE_INFO_MAX_SIZE = 20; + private final static int DATABASE_INFO_MAX_SIZE = 100; + public final static int GEOIP_STANDARD = 0; + public final static int GEOIP_MEMORY_CACHE = 1; + public final static int GEOIP_CHECK_CACHE = 2; + public final static int GEOIP_INDEX_CACHE = 4; + public final static int GEOIP_UNKNOWN_SPEED = 0; + public final static int GEOIP_DIALUP_SPEED = 1; + public final static int GEOIP_CABLEDSL_SPEED = 2; + public final static int GEOIP_CORPORATE_SPEED = 3; + + + private final static int SEGMENT_RECORD_LENGTH = 3; + private final static int STANDARD_RECORD_LENGTH = 3; + private final static int ORG_RECORD_LENGTH = 4; + private final static int MAX_RECORD_LENGTH = 4; + + private final static int MAX_ORG_RECORD_LENGTH = 300; + private final static int FULL_RECORD_LENGTH = 60; + + private final Country UNKNOWN_COUNTRY = new Country("--", "N/A"); + + private static final HashMap hashmapcountryCodetoindex = new HashMap(512); + private static final HashMap hashmapcountryNametoindex = new HashMap(512); + private static final String[] countryCode = { + "--","AP","EU","AD","AE","AF","AG","AI","AL","AM","AN","AO","AQ","AR", + "AS","AT","AU","AW","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ", + "BM","BN","BO","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF", + "CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CX","CY","CZ", + "DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI", + "FJ","FK","FM","FO","FR","FX","GA","GB","GD","GE","GF","GH","GI","GL", + "GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR", + "HT","HU","ID","IE","IL","IN","IO","IQ","IR","IS","IT","JM","JO","JP", + "KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC", + "LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","MG","MH","MK", + "ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY", + "MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM", + "PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY", + "QA","RE","RO","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ", + "SK","SL","SM","SN","SO","SR","ST","SV","SY","SZ","TC","TD","TF","TG", + "TH","TJ","TK","TM","TN","TO","TL","TR","TT","TV","TW","TZ","UA","UG", + "UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE", + "YT","RS","ZA","ZM","ME","ZW","A1","A2","O1","AX","GG","IM","JE","BL", + "MF"}; + + private static final String[] countryName = { + "N/A","Asia/Pacific Region","Europe","Andorra","United Arab Emirates", + "Afghanistan","Antigua and Barbuda","Anguilla","Albania","Armenia", + "Netherlands Antilles","Angola","Antarctica","Argentina","American Samoa", + "Austria","Australia","Aruba","Azerbaijan","Bosnia and Herzegovina", + "Barbados","Bangladesh","Belgium","Burkina Faso","Bulgaria","Bahrain", + "Burundi","Benin","Bermuda","Brunei Darussalam","Bolivia","Brazil","Bahamas", + "Bhutan","Bouvet Island","Botswana","Belarus","Belize","Canada", + "Cocos (Keeling) Islands","Congo, The Democratic Republic of the", + "Central African Republic","Congo","Switzerland","Cote D'Ivoire", + "Cook Islands","Chile","Cameroon","China","Colombia","Costa Rica","Cuba", + "Cape Verde","Christmas Island","Cyprus","Czech Republic","Germany", + "Djibouti","Denmark","Dominica","Dominican Republic","Algeria","Ecuador", + "Estonia","Egypt","Western Sahara","Eritrea","Spain","Ethiopia","Finland", + "Fiji","Falkland Islands (Malvinas)","Micronesia, Federated States of", + "Faroe Islands","France","France, Metropolitan","Gabon","United Kingdom", + "Grenada","Georgia","French Guiana","Ghana","Gibraltar","Greenland","Gambia", + "Guinea","Guadeloupe","Equatorial Guinea","Greece", + "South Georgia and the South Sandwich Islands","Guatemala","Guam", + "Guinea-Bissau","Guyana","Hong Kong","Heard Island and McDonald Islands", + "Honduras","Croatia","Haiti","Hungary","Indonesia","Ireland","Israel","India", + "British Indian Ocean Territory","Iraq","Iran, Islamic Republic of", + "Iceland","Italy","Jamaica","Jordan","Japan","Kenya","Kyrgyzstan","Cambodia", + "Kiribati","Comoros","Saint Kitts and Nevis", + "Korea, Democratic People's Republic of","Korea, Republic of","Kuwait", + "Cayman Islands","Kazakhstan","Lao People's Democratic Republic","Lebanon", + "Saint Lucia","Liechtenstein","Sri Lanka","Liberia","Lesotho","Lithuania", + "Luxembourg","Latvia","Libyan Arab Jamahiriya","Morocco","Monaco", + "Moldova, Republic of","Madagascar","Marshall Islands", + "Macedonia","Mali","Myanmar","Mongolia", + "Macau","Northern Mariana Islands","Martinique","Mauritania","Montserrat", + "Malta","Mauritius","Maldives","Malawi","Mexico","Malaysia","Mozambique", + "Namibia","New Caledonia","Niger","Norfolk Island","Nigeria","Nicaragua", + "Netherlands","Norway","Nepal","Nauru","Niue","New Zealand","Oman","Panama", + "Peru","French Polynesia","Papua New Guinea","Philippines","Pakistan", + "Poland","Saint Pierre and Miquelon","Pitcairn Islands","Puerto Rico","" + + "Palestinian Territory","Portugal","Palau","Paraguay","Qatar", + "Reunion","Romania","Russian Federation","Rwanda","Saudi Arabia", + "Solomon Islands","Seychelles","Sudan","Sweden","Singapore","Saint Helena", + "Slovenia","Svalbard and Jan Mayen","Slovakia","Sierra Leone","San Marino", + "Senegal","Somalia","Suriname","Sao Tome and Principe","El Salvador", + "Syrian Arab Republic","Swaziland","Turks and Caicos Islands","Chad", + "French Southern Territories","Togo","Thailand","Tajikistan","Tokelau", + "Turkmenistan","Tunisia","Tonga","Timor-Leste","Turkey","Trinidad and Tobago", + "Tuvalu","Taiwan","Tanzania, United Republic of","Ukraine","Uganda", + "United States Minor Outlying Islands","United States","Uruguay","Uzbekistan", + "Holy See (Vatican City State)","Saint Vincent and the Grenadines", + "Venezuela","Virgin Islands, British","Virgin Islands, U.S.","Vietnam", + "Vanuatu","Wallis and Futuna","Samoa","Yemen","Mayotte","Serbia", + "South Africa","Zambia","Montenegro","Zimbabwe","Anonymous Proxy", + "Satellite Provider","Other","Aland Islands","Guernsey","Isle of Man","Jersey", + "Saint Barthelemy","Saint Martin"}; + + + /* init the hashmap once at startup time */ + static { + int i; + if(countryCode.length!=countryName.length) + throw new AssertionError("countryCode.length!=countryName.length"); + + // distributed service only + for (i = 0; i < countryCode.length ;i++){ + hashmapcountryCodetoindex.put(countryCode[i],Integer.valueOf(i)); + hashmapcountryNametoindex.put(countryName[i],Integer.valueOf(i)); + } + }; + + + /** + * Create a new distributed lookup service using the license key + * + * @param databaseFile String representation of the database file. + * @param licenseKey license key provided by Maxmind to access distributed service + */ + public LookupService(String databaseFile,String licenseKey) throws IOException { + this(new File(databaseFile)); + this.licenseKey = licenseKey; + dnsService = 1; + } + /** + * Create a new distributed lookup service using the license key + * + * @param databaseFile the database file. + * @param licenseKey license key provided by Maxmind to access distributed service + */ + public LookupService(File databaseFile,String licenseKey) throws IOException { + this(databaseFile); + this.licenseKey = licenseKey; + dnsService = 1; + } + /** + * Create a new distributed lookup service using the license key + * + * @param options Resevered for future use + * @param licenseKey license key provided by Maxmind to access distributed service + */ + public LookupService(int options,String licenseKey) throws IOException { + this.licenseKey = licenseKey; + dnsService = 1; + init(); + } + /** + * Create a new lookup service using the specified database file. + * + * @param databaseFile String representation of the database file. + * @throws java.io.IOException if an error occured creating the lookup service + * from the database file. + */ + public LookupService(String databaseFile) throws IOException { + this(new File(databaseFile)); + } + + /** + * Create a new lookup service using the specified database file. + * + * @param databaseFile the database file. + * @throws java.io.IOException if an error occured creating the lookup service + * from the database file. + */ + public LookupService(File databaseFile) throws IOException { + this.databaseFile = databaseFile; + this.file = new RandomAccessFile(databaseFile, "r"); + init(); + } + + /** + * Create a new lookup service using the specified database file. + * + * @param databaseFile String representation of the database file. + * @param options database flags to use when opening the database + * GEOIP_STANDARD read database from disk + * GEOIP_MEMORY_CACHE cache the database in RAM and read it from RAM + * @throws java.io.IOException if an error occured creating the lookup service + * from the database file. + */ + public LookupService(String databaseFile, int options) throws IOException{ + this(new File(databaseFile),options); + } + + /** + * Create a new lookup service using the specified database file. + * + * @param databaseFile the database file. + * @param options database flags to use when opening the database + * GEOIP_STANDARD read database from disk + * GEOIP_MEMORY_CACHE cache the database in RAM and read it from RAM + * @throws java.io.IOException if an error occured creating the lookup service + * from the database file. + */ + public LookupService(File databaseFile, int options) throws IOException{ + this.databaseFile = databaseFile; + this.file = new RandomAccessFile(databaseFile, "r"); + dboptions = options; + init(); + } + /** + * Reads meta-data from the database file. + * + * @throws java.io.IOException if an error occurs reading from the database file. + */ + private void init() throws IOException { + int i, j; + byte [] delim = new byte[3]; + byte [] buf = new byte[SEGMENT_RECORD_LENGTH]; + + if (file == null) { + return; + } + if ((dboptions & GEOIP_CHECK_CACHE) != 0) { + mtime = databaseFile.lastModified(); + } + file.seek(file.length() - 3); + for (i = 0; i < STRUCTURE_INFO_MAX_SIZE; i++) { + file.readFully(delim); + if (delim[0] == -1 && delim[1] == -1 && delim[2] == -1) { + databaseType = file.readByte(); + if (databaseType >= 106) { + // Backward compatibility with databases from April 2003 and earlier + databaseType -= 105; + } + // Determine the database type. + if (databaseType == DatabaseInfo.REGION_EDITION_REV0) { + databaseSegments = new int[1]; + databaseSegments[0] = STATE_BEGIN_REV0; + recordLength = STANDARD_RECORD_LENGTH; + }else if (databaseType == DatabaseInfo.REGION_EDITION_REV1){ + databaseSegments = new int[1]; + databaseSegments[0] = STATE_BEGIN_REV1; + recordLength = STANDARD_RECORD_LENGTH; + } + else if (databaseType == DatabaseInfo.CITY_EDITION_REV0 || + databaseType == DatabaseInfo.CITY_EDITION_REV1 || + databaseType == DatabaseInfo.ORG_EDITION || + databaseType == DatabaseInfo.ISP_EDITION || + databaseType == DatabaseInfo.ASNUM_EDITION) { + databaseSegments = new int[1]; + databaseSegments[0] = 0; + if (databaseType == DatabaseInfo.CITY_EDITION_REV0 || + databaseType == DatabaseInfo.CITY_EDITION_REV1 || + databaseType == DatabaseInfo.ASNUM_EDITION) { + recordLength = STANDARD_RECORD_LENGTH; + } + else { + recordLength = ORG_RECORD_LENGTH; + } + file.readFully(buf); + for (j = 0; j < SEGMENT_RECORD_LENGTH; j++) { + databaseSegments[0] += (unsignedByteToInt(buf[j]) << (j * 8)); + } + } + break; + } + else { + file.seek(file.getFilePointer() - 4); + } + } + if ((databaseType == DatabaseInfo.COUNTRY_EDITION) || + (databaseType == DatabaseInfo.COUNTRY_EDITION_V6) || + (databaseType == DatabaseInfo.PROXY_EDITION) || + (databaseType == DatabaseInfo.NETSPEED_EDITION)) { + databaseSegments = new int[1]; + databaseSegments[0] = COUNTRY_BEGIN; + recordLength = STANDARD_RECORD_LENGTH; + } + if ((dboptions & GEOIP_MEMORY_CACHE) == 1) { + int l = (int) file.length(); + dbbuffer = new byte[l]; + file.seek(0); + file.readFully(dbbuffer,0,l); + databaseInfo = this.getDatabaseInfo(); + file.close(); + } + if ((dboptions & GEOIP_INDEX_CACHE) != 0) { + int l = databaseSegments[0] * recordLength * 2; + index_cache = new byte[l]; + if (index_cache != null){ + file.seek(0); + file.readFully(index_cache,0,l); + } + } else { + index_cache = null; + } + } + + /** + * Closes the lookup service. + */ + public void close() { + try { + if (file != null){ + file.close(); + } + file = null; + } + catch (Exception e) { } + } + + /** + * Returns the country the IP address is in. + * + * @param ipAddress String version of an IPv6 address, i.e. "::127.0.0.1" + * @return the country the IP address is from. + */ + public Country getCountryV6(String ipAddress) { + InetAddress addr; + try { + addr = Inet6Address.getByName(ipAddress); + } + catch (UnknownHostException e) { + return UNKNOWN_COUNTRY; + } + return getCountryV6(addr); + } + + /** + * Returns the country the IP address is in. + * + * @param ipAddress String version of an IP address, i.e. "127.0.0.1" + * @return the country the IP address is from. + */ + public Country getCountry(String ipAddress) { + InetAddress addr; + try { + addr = InetAddress.getByName(ipAddress); + } + catch (UnknownHostException e) { + return UNKNOWN_COUNTRY; + } + return getCountry(bytesToLong(addr.getAddress())); + } + + /** + * Returns the country the IP address is in. + * + * @param ipAddress the IP address. + * @return the country the IP address is from. + */ + public synchronized Country getCountry(InetAddress ipAddress) { + return getCountry(bytesToLong(ipAddress.getAddress())); + } + + /** + * Returns the country the IP address is in. + * + * @param addr the IP address as Inet6Address. + * @return the country the IP address is from. + */ + public Country getCountryV6(InetAddress addr) { + if (file == null && (dboptions & GEOIP_MEMORY_CACHE) == 0) { + throw new IllegalStateException("Database has been closed."); + } + int ret = seekCountryV6(addr) - COUNTRY_BEGIN; + if (ret == 0) { + return UNKNOWN_COUNTRY; + } + else { + return new Country(countryCode[ret], countryName[ret]); + } + } + + /** + * Returns the country the IP address is in. + * + * @param ipAddress the IP address in long format. + * @return the country the IP address is from. + */ + public Country getCountry(long ipAddress) { + if (file == null && (dboptions & GEOIP_MEMORY_CACHE) == 0) { + throw new IllegalStateException("Database has been closed."); + } + int ret = seekCountry(ipAddress) - COUNTRY_BEGIN; + if (ret == 0) { + return UNKNOWN_COUNTRY; + } + else { + return new Country(countryCode[ret], countryName[ret]); + } + } + + public int getID(String ipAddress) { + InetAddress addr; + try { + addr = InetAddress.getByName(ipAddress); + } + catch (UnknownHostException e) { + return 0; + } + return getID(bytesToLong(addr.getAddress())); + } + + public int getID(InetAddress ipAddress) { + return getID(bytesToLong(ipAddress.getAddress())); + } + + public synchronized int getID(long ipAddress) { + if (file == null && (dboptions & GEOIP_MEMORY_CACHE) == 0) { + throw new IllegalStateException("Database has been closed."); + } + int ret = seekCountry(ipAddress) - databaseSegments[0]; + return ret; + } + + public int last_netmask() { + return this.last_netmask; + } + + public void netmask(int nm){ + this.last_netmask = nm; + } + + /** + * Returns information about the database. + * + * @return database info. + */ + public synchronized DatabaseInfo getDatabaseInfo() { + if (databaseInfo != null) { + return databaseInfo; + } + try { + _check_mtime(); + boolean hasStructureInfo = false; + byte [] delim = new byte[3]; + // Advance to part of file where database info is stored. + file.seek(file.length() - 3); + for (int i=0; i<STRUCTURE_INFO_MAX_SIZE; i++) { + int read = file.read( delim ); + if( read==3 && (delim[0]&0xFF)==255 && (delim[1]&0xFF) == 255 && (delim[2]&0xFF)==255 ){ + hasStructureInfo = true; + break; + } + file.seek(file.getFilePointer() - 4); + + } + if (hasStructureInfo) { + file.seek(file.getFilePointer() - 6); + } + else { + // No structure info, must be pre Sep 2002 database, go back to end. + file.seek(file.length() - 3); + } + // Find the database info string. + for (int i=0; i<DATABASE_INFO_MAX_SIZE; i++) { + file.readFully(delim); + if (delim[0]==0 && delim[1]==0 && delim[2]==0) { + byte[] dbInfo = new byte[i]; + file.readFully(dbInfo); + // Create the database info object using the string. + this.databaseInfo = new DatabaseInfo(new String(dbInfo)); + return databaseInfo; + } + file.seek(file.getFilePointer() -4); + } + } + catch (Exception e) { + e.printStackTrace(); + } + return new DatabaseInfo(""); + } + + synchronized void _check_mtime(){ + try { + if ((dboptions & GEOIP_CHECK_CACHE) != 0){ + long t = databaseFile.lastModified(); + if (t != mtime){ + /* GeoIP Database file updated */ + /* refresh filehandle */ + file.close(); + file = new RandomAccessFile(databaseFile,"r"); + databaseInfo = null; + init(); + } + } + } catch (IOException e) { + System.out.println("file not found"); + } + } + + // for GeoIP City only + public Location getLocation(InetAddress addr) { + return getLocation(bytesToLong(addr.getAddress())); + } + + // for GeoIP City only + public Location getLocation(String str) { + if (dnsService == 0) { + InetAddress addr; + try { + addr = InetAddress.getByName(str); + } + catch (UnknownHostException e) { + return null; + } + + return getLocation(addr); + } else { + String str2 = getDnsAttributes(str); + return getLocationwithdnsservice(str2); + // TODO if DNS is not available, go to local file as backup + } + } + + String getDnsAttributes(String ip) { + try { + Hashtable env = new Hashtable(); + env.put("java.naming.factory.initial", "com.sun.jndi.dns.DnsContextFactory"); + // TODO don't specify ws1, instead use ns servers for s.maxmind.com + env.put("java.naming.provider.url","dns://ws1.maxmind.com/"); + + DirContext ictx = new InitialDirContext(env); + Attributes attrs = ictx.getAttributes(licenseKey + "." + ip + ".s.maxmind.com", new String[] {"txt"}); + //System.out.println(attrs.get("txt").get()); + String str = attrs.get("txt").get().toString(); + return str; + } + catch(NamingException e) { + // TODO fix this to handle exceptions + System.out.println("DNS error"); + return null; + } + + } + + public Location getLocationwithdnsservice(String str) { + Location record = new Location(); + String key; + String value; + StringTokenizer st = new StringTokenizer(str,";=\""); + while (st.hasMoreTokens()) { + key = st.nextToken(); + if (st.hasMoreTokens()) { + value = st.nextToken(); + } else { + value = "";} + if (key.equals("co")) { + Integer i = (Integer)hashmapcountryCodetoindex.get(value); + record.countryCode = value; + record.countryName = countryName[i.intValue()]; + } + if (key.equals("ci")) { + record.city = value; + } + if (key.equals("re")) { + record.region = value; + } + if (key.equals("zi")) { + record.postalCode = value; + } + // TODO, ISP and Organization + //if (key.equals("or")) { + //record.org = value; + //} + //if (key.equals("is")) { + //record.isp = value; + //} + if (key.equals("la")) { + try{ + record.latitude = Float.parseFloat(value); + } catch(NumberFormatException e) { + record.latitude = 0; + } + } + if (key.equals("lo")) { + try{ + record.longitude = Float.parseFloat(value); + } catch(NumberFormatException e) { + record.latitude = 0; + } + } + // dm depreciated use me ( metro_code ) instead + if (key.equals("dm") || key.equals("me")) { + try{ + record.metro_code = record.dma_code = Integer.parseInt(value); + } catch(NumberFormatException e) { + record.metro_code = record.dma_code = 0; + } + } + if (key.equals("ac")) { + try{ + record.area_code = Integer.parseInt(value); + } catch(NumberFormatException e) { + record.area_code = 0; + } + } + } + return record; + } + + public synchronized Region getRegion(String str) { + InetAddress addr; + try { + addr = InetAddress.getByName(str); + } + catch (UnknownHostException e) { + return null; + } + + return getRegion(bytesToLong(addr.getAddress())); + } + + public synchronized Region getRegion(long ipnum) { + Region record = new Region(); + int seek_region = 0; + if (databaseType == DatabaseInfo.REGION_EDITION_REV0) { + seek_region = seekCountry(ipnum) - STATE_BEGIN_REV0; + char ch[] = new char[2]; + if (seek_region >= 1000) { + record.countryCode = "US"; + record.countryName = "United States"; + ch[0] = (char)(((seek_region - 1000)/26) + 65); + ch[1] = (char)(((seek_region - 1000)%26) + 65); + record.region = new String(ch); + } else { + record.countryCode = countryCode[seek_region]; + record.countryName = countryName[seek_region]; + record.region = ""; + } + } else if (databaseType == DatabaseInfo.REGION_EDITION_REV1) { + seek_region = seekCountry(ipnum) - STATE_BEGIN_REV1; + char ch[] = new char[2]; + if (seek_region < US_OFFSET) { + record.countryCode = ""; + record.countryName = ""; + record.region = ""; + } else if (seek_region < CANADA_OFFSET) { + record.countryCode = "US"; + record.countryName = "United States"; + ch[0] = (char)(((seek_region - US_OFFSET)/26) + 65); + ch[1] = (char)(((seek_region - US_OFFSET)%26) + 65); + record.region = new String(ch); + } else if (seek_region < WORLD_OFFSET) { + record.countryCode = "CA"; + record.countryName = "Canada"; + ch[0] = (char)(((seek_region - CANADA_OFFSET)/26) + 65); + ch[1] = (char)(((seek_region - CANADA_OFFSET)%26) + 65); + record.region = new String(ch); + } else { + record.countryCode = countryCode[(seek_region - WORLD_OFFSET) / FIPS_RANGE]; + record.countryName = countryName[(seek_region - WORLD_OFFSET) / FIPS_RANGE]; + record.region = ""; + } + } + return record; + } + + public synchronized Location getLocation(long ipnum) { + int record_pointer; + byte record_buf[] = new byte[FULL_RECORD_LENGTH]; + int record_buf_offset = 0; + Location record = new Location(); + int str_length = 0; + int j, seek_country; + double latitude = 0, longitude = 0; + + try { + seek_country = seekCountry(ipnum); + if (seek_country == databaseSegments[0]) { + return null; + } + record_pointer = seek_country + (2 * recordLength - 1) * databaseSegments[0]; + + if ((dboptions & GEOIP_MEMORY_CACHE) == 1) { + //read from memory + System.arraycopy(dbbuffer, record_pointer, record_buf, 0, Math.min(dbbuffer.length - record_pointer, FULL_RECORD_LENGTH)); +} else { + //read from disk + file.seek(record_pointer); + file.readFully(record_buf); + } + + // get country + record.countryCode = countryCode[unsignedByteToInt(record_buf[0])]; + record.countryName = countryName[unsignedByteToInt(record_buf[0])]; + record_buf_offset++; + + // get region + while (record_buf[record_buf_offset + str_length] != '\0') + str_length++; + if (str_length > 0) { + record.region = new String(record_buf, record_buf_offset, str_length); + } + record_buf_offset += str_length + 1; + str_length = 0; + + // get city + while (record_buf[record_buf_offset + str_length] != '\0') + str_length++; + if (str_length > 0) { + record.city = new String(record_buf, record_buf_offset, str_length, "ISO-8859-1"); + } + record_buf_offset += str_length + 1; + str_length = 0; + + // get postal code + while (record_buf[record_buf_offset + str_length] != '\0') + str_length++; + if (str_length > 0) { + record.postalCode = new String(record_buf, record_buf_offset, str_length); + } + record_buf_offset += str_length + 1; + + // get latitude + for (j = 0; j < 3; j++) + latitude += (unsignedByteToInt(record_buf[record_buf_offset + j]) << (j * 8)); + record.latitude = (float) latitude/10000 - 180; + record_buf_offset += 3; + + // get longitude + for (j = 0; j < 3; j++) + longitude += (unsignedByteToInt(record_buf[record_buf_offset + j]) << (j * 8)); + record.longitude = (float) longitude/10000 - 180; + + record.dma_code = record.metro_code = 0; + record.area_code = 0; + if (databaseType == DatabaseInfo.CITY_EDITION_REV1) { + // get DMA code + int metroarea_combo = 0; + if (record.countryCode == "US") { + record_buf_offset += 3; + for (j = 0; j < 3; j++) + metroarea_combo += (unsignedByteToInt(record_buf[record_buf_offset + j]) << (j * 8)); + record.metro_code = record.dma_code = metroarea_combo/1000; + record.area_code = metroarea_combo % 1000; + } + } + } + catch (IOException e) { + System.err.println("IO Exception while seting up segments"); + } + return record; + } + + public String getOrg(InetAddress addr) { + return getOrg(bytesToLong(addr.getAddress())); + } + + public String getOrg(String str) { + InetAddress addr; + try { + addr = InetAddress.getByName(str); + } + catch (UnknownHostException e) { + return null; + } + return getOrg(addr); + } + + // GeoIP Organization and ISP Edition methods + public synchronized String getOrg(long ipnum) { + int seek_org; + int record_pointer; + int str_length = 0; + byte [] buf = new byte[MAX_ORG_RECORD_LENGTH]; + String org_buf; + + try { + seek_org = seekCountry(ipnum); + if (seek_org == databaseSegments[0]) { + return null; + } + + record_pointer = seek_org + (2 * recordLength - 1) * databaseSegments[0]; + if ((dboptions & GEOIP_MEMORY_CACHE) == 1) { + //read from memory + System.arraycopy(dbbuffer, record_pointer, buf, 0, Math.min(dbbuffer.length - record_pointer, MAX_ORG_RECORD_LENGTH)); + } else { + //read from disk + file.seek(record_pointer); + file.readFully(buf); + } + while (buf[str_length] != '\0') { + str_length++; + } + org_buf = new String(buf, 0, str_length, "ISO-8859-1"); + return org_buf; + } + catch (IOException e) { + System.out.println("IO Exception"); + return null; + } + } + + /** + * Finds the country index value given an IPv6 address. + * + * @param addr the ip address to find in long format. + * @return the country index. + */ + private synchronized int seekCountryV6(InetAddress addr) { + byte [] v6vec = addr.getAddress(); + byte [] buf = new byte[2 * MAX_RECORD_LENGTH]; + int [] x = new int[2]; + int offset = 0; + _check_mtime(); + for (int depth = 127; depth >= 0; depth--) { + if ((dboptions & GEOIP_MEMORY_CACHE) == 1) { + //read from memory + for (int i = 0;i < 2 * MAX_RECORD_LENGTH;i++) { + buf[i] = dbbuffer[(2 * recordLength * offset)+i]; + } + } else if ((dboptions & GEOIP_INDEX_CACHE) != 0) { + //read from index cache + for (int i = 0;i < 2 * MAX_RECORD_LENGTH;i++) { + buf[i] = index_cache[(2 * recordLength * offset)+i]; + } + } else { + //read from disk + try { + file.seek(2 * recordLength * offset); + file.readFully(buf); + } + catch (IOException e) { + System.out.println("IO Exception"); + } + } + for (int i = 0; i<2; i++) { + x[i] = 0; + for (int j = 0; j<recordLength; j++) { + int y = buf[i*recordLength+j]; + if (y < 0) { + y+= 256; + } + x[i] += (y << (j * 8)); + } + } + + int bnum = 127 - depth; + int idx = bnum >> 3; + int b_mask = 1 << ( bnum & 7 ^ 7 ); + if ((v6vec[idx] & b_mask) > 0) { + if (x[1] >= databaseSegments[0]) { + last_netmask = 128 - depth; + return x[1]; + } + offset = x[1]; + } + else { + if (x[0] >= databaseSegments[0]) { + last_netmask = 128 - depth; + return x[0]; + } + offset = x[0]; + } + } + + // shouldn't reach here + System.err.println("Error seeking country while seeking " + addr.getHostAddress() ); + return 0; + } + /** + * Finds the country index value given an IP address. + * + * @param ipAddress the ip address to find in long format. + * @return the country index. + */ + private synchronized int seekCountry(long ipAddress) { + byte [] buf = new byte[2 * MAX_RECORD_LENGTH]; + int [] x = new int[2]; + int offset = 0; + _check_mtime(); + for (int depth = 31; depth >= 0; depth--) { + if ((dboptions & GEOIP_MEMORY_CACHE) == 1) { + //read from memory + for (int i = 0;i < 2 * MAX_RECORD_LENGTH;i++) { + buf[i] = dbbuffer[(2 * recordLength * offset)+i]; + } + } else if ((dboptions & GEOIP_INDEX_CACHE) != 0) { + //read from index cache + for (int i = 0;i < 2 * MAX_RECORD_LENGTH;i++) { + buf[i] = index_cache[(2 * recordLength * offset)+i]; + } + } else { + //read from disk + try { + file.seek(2 * recordLength * offset); + file.readFully(buf); + } + catch (IOException e) { + System.out.println("IO Exception"); + } + } + for (int i = 0; i<2; i++) { + x[i] = 0; + for (int j = 0; j<recordLength; j++) { + int y = buf[i*recordLength+j]; + if (y < 0) { + y+= 256; + } + x[i] += (y << (j * 8)); + } + } + + if ((ipAddress & (1 << depth)) > 0) { + if (x[1] >= databaseSegments[0]) { + last_netmask = 32 - depth; + return x[1]; + } + offset = x[1]; + } + else { + if (x[0] >= databaseSegments[0]) { + last_netmask = 32 - depth; + return x[0]; + } + offset = x[0]; + } + } + + // shouldn't reach here + System.err.println("Error seeking country while seeking " + ipAddress); + return 0; + } + + /** + * Returns the long version of an IP address given an InetAddress object. + * + * @param address the InetAddress. + * @return the long form of the IP address. + */ + private static long bytesToLong(byte [] address) { + long ipnum = 0; + for (int i = 0; i < 4; ++i) { + long y = address[i]; + if (y < 0) { + y+= 256; + } + ipnum += y << ((3-i)*8); + } + return ipnum; + } + + private static int unsignedByteToInt(byte b) { + return (int) b & 0xFF; + } +} diff --git a/EssentialsGeoIP/src/com/maxmind/geoip/Region.java b/EssentialsGeoIP/src/com/maxmind/geoip/Region.java new file mode 100644 index 000000000..cba0594b6 --- /dev/null +++ b/EssentialsGeoIP/src/com/maxmind/geoip/Region.java @@ -0,0 +1,8 @@ +package com.maxmind.geoip; + +public class Region{ + public String countryCode; + public String countryName; + public String region; +} + diff --git a/EssentialsGeoIP/src/com/maxmind/geoip/regionName.java b/EssentialsGeoIP/src/com/maxmind/geoip/regionName.java new file mode 100644 index 000000000..da261ca15 --- /dev/null +++ b/EssentialsGeoIP/src/com/maxmind/geoip/regionName.java @@ -0,0 +1,13400 @@ +package com.maxmind.geoip; +// generated automatically from admin/generate_regionName.pl +public class regionName { +static public String regionNameByCode(String country_code,String region_code) { + String name = null; + int region_code2 = -1; + if (region_code == null) { return null; } + if (region_code.equals("")) { return null; } + + if ( ((region_code.charAt(0) >= 48 ) && ( region_code.charAt(0) < ( 48 + 10 ))) + && ((region_code.charAt(1) >= 48 ) && ( region_code.charAt(1) < ( 48 + 10 ))) + ){ + // only numbers, that shorten the large switch statements + region_code2 = (region_code.charAt(0)- 48) * 10 + region_code.charAt(1) - 48; + } + else if ( ( ((region_code.charAt(0) >= 65) && (region_code.charAt(0) < (65 + 26))) + || ((region_code.charAt(0) >= 48) && (region_code.charAt(0) < (48 + 10)))) + && ( ((region_code.charAt(1) >= 65) && (region_code.charAt(1) < (65 + 26))) + || ((region_code.charAt(1) >= 48) && (region_code.charAt(1) < (48 + 10)))) + ) { + + region_code2 = (region_code.charAt(0) - 48) * (65 + 26 - 48) + region_code.charAt(1) - 48 + 100; + } + + if (region_code2 == -1) {return null;} + if (country_code.equals("CA") == true) { + switch (region_code2) { + case 849: + name = "Alberta"; + break; + case 893: + name = "British Columbia"; + break; + case 1365: + name = "Manitoba"; + break; + case 1408: + name = "New Brunswick"; + break; + case 1418: + name = "Newfoundland"; + break; + case 1425: + name = "Nova Scotia"; + break; + case 1427: + name = "Nunavut"; + break; + case 1463: + name = "Ontario"; + break; + case 1497: + name = "Prince Edward Island"; + break; + case 1538: + name = "Quebec"; + break; + case 1632: + name = "Saskatchewan"; + break; + case 1426: + name = "Northwest Territories"; + break; + case 1899: + name = "Yukon Territory"; + break; + } + } + if (country_code.equals("US") == true) { + switch (region_code2) { + case 848: + name = "Armed Forces Americas"; + break; + case 852: + name = "Armed Forces Europe"; + break; + case 858: + name = "Alaska"; + break; + case 859: + name = "Alabama"; + break; + case 863: + name = "Armed Forces Pacific"; + break; + case 865: + name = "Arkansas"; + break; + case 866: + name = "American Samoa"; + break; + case 873: + name = "Arizona"; + break; + case 934: + name = "California"; + break; + case 948: + name = "Colorado"; + break; + case 953: + name = "Connecticut"; + break; + case 979: + name = "District of Columbia"; + break; + case 981: + name = "Delaware"; + break; + case 1074: + name = "Florida"; + break; + case 1075: + name = "Federated States of Micronesia"; + break; + case 1106: + name = "Georgia"; + break; + case 1126: + name = "Guam"; + break; + case 1157: + name = "Hawaii"; + break; + case 1192: + name = "Iowa"; + break; + case 1195: + name = "Idaho"; + break; + case 1203: + name = "Illinois"; + break; + case 1205: + name = "Indiana"; + break; + case 1296: + name = "Kansas"; + break; + case 1302: + name = "Kentucky"; + break; + case 1321: + name = "Louisiana"; + break; + case 1364: + name = "Massachusetts"; + break; + case 1367: + name = "Maryland"; + break; + case 1368: + name = "Maine"; + break; + case 1371: + name = "Marshall Islands"; + break; + case 1372: + name = "Michigan"; + break; + case 1377: + name = "Minnesota"; + break; + case 1378: + name = "Missouri"; + break; + case 1379: + name = "Northern Mariana Islands"; + break; + case 1382: + name = "Mississippi"; + break; + case 1383: + name = "Montana"; + break; + case 1409: + name = "North Carolina"; + break; + case 1410: + name = "North Dakota"; + break; + case 1411: + name = "Nebraska"; + break; + case 1414: + name = "New Hampshire"; + break; + case 1416: + name = "New Jersey"; + break; + case 1419: + name = "New Mexico"; + break; + case 1428: + name = "Nevada"; + break; + case 1431: + name = "New York"; + break; + case 1457: + name = "Ohio"; + break; + case 1460: + name = "Oklahoma"; + break; + case 1467: + name = "Oregon"; + break; + case 1493: + name = "Pennsylvania"; + break; + case 1510: + name = "Puerto Rico"; + break; + case 1515: + name = "Palau"; + break; + case 1587: + name = "Rhode Island"; + break; + case 1624: + name = "South Carolina"; + break; + case 1625: + name = "South Dakota"; + break; + case 1678: + name = "Tennessee"; + break; + case 1688: + name = "Texas"; + break; + case 1727: + name = "Utah"; + break; + case 1751: + name = "Virginia"; + break; + case 1759: + name = "Virgin Islands"; + break; + case 1770: + name = "Vermont"; + break; + case 1794: + name = "Washington"; + break; + case 1815: + name = "West Virginia"; + break; + case 1802: + name = "Wisconsin"; + break; + case 1818: + name = "Wyoming"; + break; + } + } + if (country_code.equals("AD") == true) { + switch (region_code2) { + case 2: + name = "Canillo"; + break; + case 3: + name = "Encamp"; + break; + case 4: + name = "La Massana"; + break; + case 5: + name = "Ordino"; + break; + case 6: + name = "Sant Julia de Loria"; + break; + case 7: + name = "Andorra la Vella"; + break; + case 8: + name = "Escaldes-Engordany"; + break; + } + } + if (country_code.equals("AE") == true) { + switch (region_code2) { + case 1: + name = "Abu Dhabi"; + break; + case 2: + name = "Ajman"; + break; + case 3: + name = "Dubai"; + break; + case 4: + name = "Fujairah"; + break; + case 5: + name = "Ras Al Khaimah"; + break; + case 6: + name = "Sharjah"; + break; + case 7: + name = "Umm Al Quwain"; + break; + } + } + if (country_code.equals("AF") == true) { + switch (region_code2) { + case 1: + name = "Badakhshan"; + break; + case 2: + name = "Badghis"; + break; + case 3: + name = "Baghlan"; + break; + case 5: + name = "Bamian"; + break; + case 6: + name = "Farah"; + break; + case 7: + name = "Faryab"; + break; + case 8: + name = "Ghazni"; + break; + case 9: + name = "Ghowr"; + break; + case 10: + name = "Helmand"; + break; + case 11: + name = "Herat"; + break; + case 13: + name = "Kabol"; + break; + case 14: + name = "Kapisa"; + break; + case 15: + name = "Konar"; + break; + case 16: + name = "Laghman"; + break; + case 17: + name = "Lowgar"; + break; + case 18: + name = "Nangarhar"; + break; + case 19: + name = "Nimruz"; + break; + case 21: + name = "Paktia"; + break; + case 22: + name = "Parvan"; + break; + case 23: + name = "Kandahar"; + break; + case 24: + name = "Kondoz"; + break; + case 26: + name = "Takhar"; + break; + case 27: + name = "Vardak"; + break; + case 28: + name = "Zabol"; + break; + case 29: + name = "Paktika"; + break; + case 30: + name = "Balkh"; + break; + case 31: + name = "Jowzjan"; + break; + case 32: + name = "Samangan"; + break; + case 33: + name = "Sar-e Pol"; + break; + case 34: + name = "Konar"; + break; + case 35: + name = "Laghman"; + break; + case 36: + name = "Paktia"; + break; + case 37: + name = "Khowst"; + break; + case 38: + name = "Nurestan"; + break; + case 39: + name = "Oruzgan"; + break; + case 40: + name = "Parvan"; + break; + case 41: + name = "Daykondi"; + break; + case 42: + name = "Panjshir"; + break; + } + } + if (country_code.equals("AG") == true) { + switch (region_code2) { + case 1: + name = "Barbuda"; + break; + case 3: + name = "Saint George"; + break; + case 4: + name = "Saint John"; + break; + case 5: + name = "Saint Mary"; + break; + case 6: + name = "Saint Paul"; + break; + case 7: + name = "Saint Peter"; + break; + case 8: + name = "Saint Philip"; + break; + } + } + if (country_code.equals("AL") == true) { + switch (region_code2) { + case 40: + name = "Berat"; + break; + case 41: + name = "Diber"; + break; + case 42: + name = "Durres"; + break; + case 43: + name = "Elbasan"; + break; + case 44: + name = "Fier"; + break; + case 45: + name = "Gjirokaster"; + break; + case 46: + name = "Korce"; + break; + case 47: + name = "Kukes"; + break; + case 48: + name = "Lezhe"; + break; + case 49: + name = "Shkoder"; + break; + case 50: + name = "Tirane"; + break; + case 51: + name = "Vlore"; + break; + } + } + if (country_code.equals("AM") == true) { + switch (region_code2) { + case 1: + name = "Aragatsotn"; + break; + case 2: + name = "Ararat"; + break; + case 3: + name = "Armavir"; + break; + case 4: + name = "Geghark'unik'"; + break; + case 5: + name = "Kotayk'"; + break; + case 6: + name = "Lorri"; + break; + case 7: + name = "Shirak"; + break; + case 8: + name = "Syunik'"; + break; + case 9: + name = "Tavush"; + break; + case 10: + name = "Vayots' Dzor"; + break; + case 11: + name = "Yerevan"; + break; + } + } + if (country_code.equals("AO") == true) { + switch (region_code2) { + case 1: + name = "Benguela"; + break; + case 2: + name = "Bie"; + break; + case 3: + name = "Cabinda"; + break; + case 4: + name = "Cuando Cubango"; + break; + case 5: + name = "Cuanza Norte"; + break; + case 6: + name = "Cuanza Sul"; + break; + case 7: + name = "Cunene"; + break; + case 8: + name = "Huambo"; + break; + case 9: + name = "Huila"; + break; + case 10: + name = "Luanda"; + break; + case 12: + name = "Malanje"; + break; + case 13: + name = "Namibe"; + break; + case 14: + name = "Moxico"; + break; + case 15: + name = "Uige"; + break; + case 16: + name = "Zaire"; + break; + case 17: + name = "Lunda Norte"; + break; + case 18: + name = "Lunda Sul"; + break; + case 19: + name = "Bengo"; + break; + case 20: + name = "Luanda"; + break; + } + } + if (country_code.equals("AR") == true) { + switch (region_code2) { + case 1: + name = "Buenos Aires"; + break; + case 2: + name = "Catamarca"; + break; + case 3: + name = "Chaco"; + break; + case 4: + name = "Chubut"; + break; + case 5: + name = "Cordoba"; + break; + case 6: + name = "Corrientes"; + break; + case 7: + name = "Distrito Federal"; + break; + case 8: + name = "Entre Rios"; + break; + case 9: + name = "Formosa"; + break; + case 10: + name = "Jujuy"; + break; + case 11: + name = "La Pampa"; + break; + case 12: + name = "La Rioja"; + break; + case 13: + name = "Mendoza"; + break; + case 14: + name = "Misiones"; + break; + case 15: + name = "Neuquen"; + break; + case 16: + name = "Rio Negro"; + break; + case 17: + name = "Salta"; + break; + case 18: + name = "San Juan"; + break; + case 19: + name = "San Luis"; + break; + case 20: + name = "Santa Cruz"; + break; + case 21: + name = "Santa Fe"; + break; + case 22: + name = "Santiago del Estero"; + break; + case 23: + name = "Tierra del Fuego"; + break; + case 24: + name = "Tucuman"; + break; + } + } + if (country_code.equals("AT") == true) { + switch (region_code2) { + case 1: + name = "Burgenland"; + break; + case 2: + name = "Karnten"; + break; + case 3: + name = "Niederosterreich"; + break; + case 4: + name = "Oberosterreich"; + break; + case 5: + name = "Salzburg"; + break; + case 6: + name = "Steiermark"; + break; + case 7: + name = "Tirol"; + break; + case 8: + name = "Vorarlberg"; + break; + case 9: + name = "Wien"; + break; + } + } + if (country_code.equals("AU") == true) { + switch (region_code2) { + case 1: + name = "Australian Capital Territory"; + break; + case 2: + name = "New South Wales"; + break; + case 3: + name = "Northern Territory"; + break; + case 4: + name = "Queensland"; + break; + case 5: + name = "South Australia"; + break; + case 6: + name = "Tasmania"; + break; + case 7: + name = "Victoria"; + break; + case 8: + name = "Western Australia"; + break; + } + } + if (country_code.equals("AZ") == true) { + switch (region_code2) { + case 1: + name = "Abseron"; + break; + case 2: + name = "Agcabadi"; + break; + case 3: + name = "Agdam"; + break; + case 4: + name = "Agdas"; + break; + case 5: + name = "Agstafa"; + break; + case 6: + name = "Agsu"; + break; + case 7: + name = "Ali Bayramli"; + break; + case 8: + name = "Astara"; + break; + case 9: + name = "Baki"; + break; + case 10: + name = "Balakan"; + break; + case 11: + name = "Barda"; + break; + case 12: + name = "Beylaqan"; + break; + case 13: + name = "Bilasuvar"; + break; + case 14: + name = "Cabrayil"; + break; + case 15: + name = "Calilabad"; + break; + case 16: + name = "Daskasan"; + break; + case 17: + name = "Davaci"; + break; + case 18: + name = "Fuzuli"; + break; + case 19: + name = "Gadabay"; + break; + case 20: + name = "Ganca"; + break; + case 21: + name = "Goranboy"; + break; + case 22: + name = "Goycay"; + break; + case 23: + name = "Haciqabul"; + break; + case 24: + name = "Imisli"; + break; + case 25: + name = "Ismayilli"; + break; + case 26: + name = "Kalbacar"; + break; + case 27: + name = "Kurdamir"; + break; + case 28: + name = "Lacin"; + break; + case 29: + name = "Lankaran"; + break; + case 30: + name = "Lankaran"; + break; + case 31: + name = "Lerik"; + break; + case 32: + name = "Masalli"; + break; + case 33: + name = "Mingacevir"; + break; + case 34: + name = "Naftalan"; + break; + case 35: + name = "Naxcivan"; + break; + case 36: + name = "Neftcala"; + break; + case 37: + name = "Oguz"; + break; + case 38: + name = "Qabala"; + break; + case 39: + name = "Qax"; + break; + case 40: + name = "Qazax"; + break; + case 41: + name = "Qobustan"; + break; + case 42: + name = "Quba"; + break; + case 43: + name = "Qubadli"; + break; + case 44: + name = "Qusar"; + break; + case 45: + name = "Saatli"; + break; + case 46: + name = "Sabirabad"; + break; + case 47: + name = "Saki"; + break; + case 48: + name = "Saki"; + break; + case 49: + name = "Salyan"; + break; + case 50: + name = "Samaxi"; + break; + case 51: + name = "Samkir"; + break; + case 52: + name = "Samux"; + break; + case 53: + name = "Siyazan"; + break; + case 54: + name = "Sumqayit"; + break; + case 55: + name = "Susa"; + break; + case 56: + name = "Susa"; + break; + case 57: + name = "Tartar"; + break; + case 58: + name = "Tovuz"; + break; + case 59: + name = "Ucar"; + break; + case 60: + name = "Xacmaz"; + break; + case 61: + name = "Xankandi"; + break; + case 62: + name = "Xanlar"; + break; + case 63: + name = "Xizi"; + break; + case 64: + name = "Xocali"; + break; + case 65: + name = "Xocavand"; + break; + case 66: + name = "Yardimli"; + break; + case 67: + name = "Yevlax"; + break; + case 68: + name = "Yevlax"; + break; + case 69: + name = "Zangilan"; + break; + case 70: + name = "Zaqatala"; + break; + case 71: + name = "Zardab"; + break; + } + } + if (country_code.equals("BA") == true) { + switch (region_code2) { + case 1: + name = "Federation of Bosnia and Herzegovina"; + break; + case 2: + name = "Republika Srpska"; + break; + } + } + if (country_code.equals("BB") == true) { + switch (region_code2) { + case 1: + name = "Christ Church"; + break; + case 2: + name = "Saint Andrew"; + break; + case 3: + name = "Saint George"; + break; + case 4: + name = "Saint James"; + break; + case 5: + name = "Saint John"; + break; + case 6: + name = "Saint Joseph"; + break; + case 7: + name = "Saint Lucy"; + break; + case 8: + name = "Saint Michael"; + break; + case 9: + name = "Saint Peter"; + break; + case 10: + name = "Saint Philip"; + break; + case 11: + name = "Saint Thomas"; + break; + } + } + if (country_code.equals("BD") == true) { + switch (region_code2) { + case 1: + name = "Barisal"; + break; + case 4: + name = "Bandarban"; + break; + case 5: + name = "Comilla"; + break; + case 12: + name = "Mymensingh"; + break; + case 13: + name = "Noakhali"; + break; + case 15: + name = "Patuakhali"; + break; + case 22: + name = "Bagerhat"; + break; + case 23: + name = "Bhola"; + break; + case 24: + name = "Bogra"; + break; + case 25: + name = "Barguna"; + break; + case 26: + name = "Brahmanbaria"; + break; + case 27: + name = "Chandpur"; + break; + case 28: + name = "Chapai Nawabganj"; + break; + case 29: + name = "Chattagram"; + break; + case 30: + name = "Chuadanga"; + break; + case 31: + name = "Cox's Bazar"; + break; + case 32: + name = "Dhaka"; + break; + case 33: + name = "Dinajpur"; + break; + case 34: + name = "Faridpur"; + break; + case 35: + name = "Feni"; + break; + case 36: + name = "Gaibandha"; + break; + case 37: + name = "Gazipur"; + break; + case 38: + name = "Gopalganj"; + break; + case 39: + name = "Habiganj"; + break; + case 40: + name = "Jaipurhat"; + break; + case 41: + name = "Jamalpur"; + break; + case 42: + name = "Jessore"; + break; + case 43: + name = "Jhalakati"; + break; + case 44: + name = "Jhenaidah"; + break; + case 45: + name = "Khagrachari"; + break; + case 46: + name = "Khulna"; + break; + case 47: + name = "Kishorganj"; + break; + case 48: + name = "Kurigram"; + break; + case 49: + name = "Kushtia"; + break; + case 50: + name = "Laksmipur"; + break; + case 51: + name = "Lalmonirhat"; + break; + case 52: + name = "Madaripur"; + break; + case 53: + name = "Magura"; + break; + case 54: + name = "Manikganj"; + break; + case 55: + name = "Meherpur"; + break; + case 56: + name = "Moulavibazar"; + break; + case 57: + name = "Munshiganj"; + break; + case 58: + name = "Naogaon"; + break; + case 59: + name = "Narail"; + break; + case 60: + name = "Narayanganj"; + break; + case 61: + name = "Narsingdi"; + break; + case 62: + name = "Nator"; + break; + case 63: + name = "Netrakona"; + break; + case 64: + name = "Nilphamari"; + break; + case 65: + name = "Pabna"; + break; + case 66: + name = "Panchagar"; + break; + case 67: + name = "Parbattya Chattagram"; + break; + case 68: + name = "Pirojpur"; + break; + case 69: + name = "Rajbari"; + break; + case 70: + name = "Rajshahi"; + break; + case 71: + name = "Rangpur"; + break; + case 72: + name = "Satkhira"; + break; + case 73: + name = "Shariyatpur"; + break; + case 74: + name = "Sherpur"; + break; + case 75: + name = "Sirajganj"; + break; + case 76: + name = "Sunamganj"; + break; + case 77: + name = "Sylhet"; + break; + case 78: + name = "Tangail"; + break; + case 79: + name = "Thakurgaon"; + break; + case 81: + name = "Dhaka"; + break; + case 82: + name = "Khulna"; + break; + case 83: + name = "Rajshahi"; + break; + case 84: + name = "Chittagong"; + break; + case 85: + name = "Barisal"; + break; + case 86: + name = "Sylhet"; + break; + } + } + if (country_code.equals("BE") == true) { + switch (region_code2) { + case 1: + name = "Antwerpen"; + break; + case 2: + name = "Brabant"; + break; + case 3: + name = "Hainaut"; + break; + case 4: + name = "Liege"; + break; + case 5: + name = "Limburg"; + break; + case 6: + name = "Luxembourg"; + break; + case 7: + name = "Namur"; + break; + case 8: + name = "Oost-Vlaanderen"; + break; + case 9: + name = "West-Vlaanderen"; + break; + case 10: + name = "Brabant Wallon"; + break; + case 11: + name = "Brussels Hoofdstedelijk Gewest"; + break; + case 12: + name = "Vlaams-Brabant"; + break; + } + } + if (country_code.equals("BF") == true) { + switch (region_code2) { + case 15: + name = "Bam"; + break; + case 19: + name = "Boulkiemde"; + break; + case 20: + name = "Ganzourgou"; + break; + case 21: + name = "Gnagna"; + break; + case 28: + name = "Kouritenga"; + break; + case 33: + name = "Oudalan"; + break; + case 34: + name = "Passore"; + break; + case 36: + name = "Sanguie"; + break; + case 40: + name = "Soum"; + break; + case 42: + name = "Tapoa"; + break; + case 44: + name = "Zoundweogo"; + break; + case 45: + name = "Bale"; + break; + case 46: + name = "Banwa"; + break; + case 47: + name = "Bazega"; + break; + case 48: + name = "Bougouriba"; + break; + case 49: + name = "Boulgou"; + break; + case 50: + name = "Gourma"; + break; + case 51: + name = "Houet"; + break; + case 52: + name = "Ioba"; + break; + case 53: + name = "Kadiogo"; + break; + case 54: + name = "Kenedougou"; + break; + case 55: + name = "Komoe"; + break; + case 56: + name = "Komondjari"; + break; + case 57: + name = "Kompienga"; + break; + case 58: + name = "Kossi"; + break; + case 59: + name = "Koulpelogo"; + break; + case 60: + name = "Kourweogo"; + break; + case 61: + name = "Leraba"; + break; + case 62: + name = "Loroum"; + break; + case 63: + name = "Mouhoun"; + break; + case 64: + name = "Namentenga"; + break; + case 65: + name = "Naouri"; + break; + case 66: + name = "Nayala"; + break; + case 67: + name = "Noumbiel"; + break; + case 68: + name = "Oubritenga"; + break; + case 69: + name = "Poni"; + break; + case 70: + name = "Sanmatenga"; + break; + case 71: + name = "Seno"; + break; + case 72: + name = "Sissili"; + break; + case 73: + name = "Sourou"; + break; + case 74: + name = "Tuy"; + break; + case 75: + name = "Yagha"; + break; + case 76: + name = "Yatenga"; + break; + case 77: + name = "Ziro"; + break; + case 78: + name = "Zondoma"; + break; + } + } + if (country_code.equals("BG") == true) { + switch (region_code2) { + case 33: + name = "Mikhaylovgrad"; + break; + case 38: + name = "Blagoevgrad"; + break; + case 39: + name = "Burgas"; + break; + case 40: + name = "Dobrich"; + break; + case 41: + name = "Gabrovo"; + break; + case 42: + name = "Grad Sofiya"; + break; + case 43: + name = "Khaskovo"; + break; + case 44: + name = "Kurdzhali"; + break; + case 45: + name = "Kyustendil"; + break; + case 46: + name = "Lovech"; + break; + case 47: + name = "Montana"; + break; + case 48: + name = "Pazardzhik"; + break; + case 49: + name = "Pernik"; + break; + case 50: + name = "Pleven"; + break; + case 51: + name = "Plovdiv"; + break; + case 52: + name = "Razgrad"; + break; + case 53: + name = "Ruse"; + break; + case 54: + name = "Shumen"; + break; + case 55: + name = "Silistra"; + break; + case 56: + name = "Sliven"; + break; + case 57: + name = "Smolyan"; + break; + case 58: + name = "Sofiya"; + break; + case 59: + name = "Stara Zagora"; + break; + case 60: + name = "Turgovishte"; + break; + case 61: + name = "Varna"; + break; + case 62: + name = "Veliko Turnovo"; + break; + case 63: + name = "Vidin"; + break; + case 64: + name = "Vratsa"; + break; + case 65: + name = "Yambol"; + break; + } + } + if (country_code.equals("BH") == true) { + switch (region_code2) { + case 1: + name = "Al Hadd"; + break; + case 2: + name = "Al Manamah"; + break; + case 3: + name = "Al Muharraq"; + break; + case 5: + name = "Jidd Hafs"; + break; + case 6: + name = "Sitrah"; + break; + case 7: + name = "Ar Rifa' wa al Mintaqah al Janubiyah"; + break; + case 8: + name = "Al Mintaqah al Gharbiyah"; + break; + case 9: + name = "Mintaqat Juzur Hawar"; + break; + case 10: + name = "Al Mintaqah ash Shamaliyah"; + break; + case 11: + name = "Al Mintaqah al Wusta"; + break; + case 12: + name = "Madinat"; + break; + case 13: + name = "Ar Rifa"; + break; + case 14: + name = "Madinat Hamad"; + break; + case 15: + name = "Al Muharraq"; + break; + case 16: + name = "Al Asimah"; + break; + case 17: + name = "Al Janubiyah"; + break; + case 18: + name = "Ash Shamaliyah"; + break; + case 19: + name = "Al Wusta"; + break; + } + } + if (country_code.equals("BI") == true) { + switch (region_code2) { + case 2: + name = "Bujumbura"; + break; + case 9: + name = "Bubanza"; + break; + case 10: + name = "Bururi"; + break; + case 11: + name = "Cankuzo"; + break; + case 12: + name = "Cibitoke"; + break; + case 13: + name = "Gitega"; + break; + case 14: + name = "Karuzi"; + break; + case 15: + name = "Kayanza"; + break; + case 16: + name = "Kirundo"; + break; + case 17: + name = "Makamba"; + break; + case 18: + name = "Muyinga"; + break; + case 19: + name = "Ngozi"; + break; + case 20: + name = "Rutana"; + break; + case 21: + name = "Ruyigi"; + break; + case 22: + name = "Muramvya"; + break; + case 23: + name = "Mwaro"; + break; + } + } + if (country_code.equals("BJ") == true) { + switch (region_code2) { + case 1: + name = "Atakora"; + break; + case 2: + name = "Atlantique"; + break; + case 3: + name = "Borgou"; + break; + case 4: + name = "Mono"; + break; + case 5: + name = "Oueme"; + break; + case 6: + name = "Zou"; + break; + case 7: + name = "Alibori"; + break; + case 8: + name = "Atakora"; + break; + case 9: + name = "Atlanyique"; + break; + case 10: + name = "Borgou"; + break; + case 11: + name = "Collines"; + break; + case 12: + name = "Kouffo"; + break; + case 13: + name = "Donga"; + break; + case 14: + name = "Littoral"; + break; + case 15: + name = "Mono"; + break; + case 16: + name = "Oueme"; + break; + case 17: + name = "Plateau"; + break; + case 18: + name = "Zou"; + break; + } + } + if (country_code.equals("BM") == true) { + switch (region_code2) { + case 1: + name = "Devonshire"; + break; + case 2: + name = "Hamilton"; + break; + case 3: + name = "Hamilton"; + break; + case 4: + name = "Paget"; + break; + case 5: + name = "Pembroke"; + break; + case 6: + name = "Saint George"; + break; + case 7: + name = "Saint George's"; + break; + case 8: + name = "Sandys"; + break; + case 9: + name = "Smiths"; + break; + case 10: + name = "Southampton"; + break; + case 11: + name = "Warwick"; + break; + } + } + if (country_code.equals("BN") == true) { + switch (region_code2) { + case 7: + name = "Alibori"; + break; + case 8: + name = "Belait"; + break; + case 9: + name = "Brunei and Muara"; + break; + case 10: + name = "Temburong"; + break; + case 11: + name = "Collines"; + break; + case 12: + name = "Kouffo"; + break; + case 13: + name = "Donga"; + break; + case 14: + name = "Littoral"; + break; + case 15: + name = "Tutong"; + break; + case 16: + name = "Oueme"; + break; + case 17: + name = "Plateau"; + break; + case 18: + name = "Zou"; + break; + } + } + if (country_code.equals("BO") == true) { + switch (region_code2) { + case 1: + name = "Chuquisaca"; + break; + case 2: + name = "Cochabamba"; + break; + case 3: + name = "El Beni"; + break; + case 4: + name = "La Paz"; + break; + case 5: + name = "Oruro"; + break; + case 6: + name = "Pando"; + break; + case 7: + name = "Potosi"; + break; + case 8: + name = "Santa Cruz"; + break; + case 9: + name = "Tarija"; + break; + } + } + if (country_code.equals("BR") == true) { + switch (region_code2) { + case 1: + name = "Acre"; + break; + case 2: + name = "Alagoas"; + break; + case 3: + name = "Amapa"; + break; + case 4: + name = "Amazonas"; + break; + case 5: + name = "Bahia"; + break; + case 6: + name = "Ceara"; + break; + case 7: + name = "Distrito Federal"; + break; + case 8: + name = "Espirito Santo"; + break; + case 11: + name = "Mato Grosso do Sul"; + break; + case 13: + name = "Maranhao"; + break; + case 14: + name = "Mato Grosso"; + break; + case 15: + name = "Minas Gerais"; + break; + case 16: + name = "Para"; + break; + case 17: + name = "Paraiba"; + break; + case 18: + name = "Parana"; + break; + case 20: + name = "Piaui"; + break; + case 21: + name = "Rio de Janeiro"; + break; + case 22: + name = "Rio Grande do Norte"; + break; + case 23: + name = "Rio Grande do Sul"; + break; + case 24: + name = "Rondonia"; + break; + case 25: + name = "Roraima"; + break; + case 26: + name = "Santa Catarina"; + break; + case 27: + name = "Sao Paulo"; + break; + case 28: + name = "Sergipe"; + break; + case 29: + name = "Goias"; + break; + case 30: + name = "Pernambuco"; + break; + case 31: + name = "Tocantins"; + break; + } + } + if (country_code.equals("BS") == true) { + switch (region_code2) { + case 5: + name = "Bimini"; + break; + case 6: + name = "Cat Island"; + break; + case 10: + name = "Exuma"; + break; + case 13: + name = "Inagua"; + break; + case 15: + name = "Long Island"; + break; + case 16: + name = "Mayaguana"; + break; + case 18: + name = "Ragged Island"; + break; + case 22: + name = "Harbour Island"; + break; + case 23: + name = "New Providence"; + break; + case 24: + name = "Acklins and Crooked Islands"; + break; + case 25: + name = "Freeport"; + break; + case 26: + name = "Fresh Creek"; + break; + case 27: + name = "Governor's Harbour"; + break; + case 28: + name = "Green Turtle Cay"; + break; + case 29: + name = "High Rock"; + break; + case 30: + name = "Kemps Bay"; + break; + case 31: + name = "Marsh Harbour"; + break; + case 32: + name = "Nichollstown and Berry Islands"; + break; + case 33: + name = "Rock Sound"; + break; + case 34: + name = "Sandy Point"; + break; + case 35: + name = "San Salvador and Rum Cay"; + break; + } + } + if (country_code.equals("BT") == true) { + switch (region_code2) { + case 5: + name = "Bumthang"; + break; + case 6: + name = "Chhukha"; + break; + case 7: + name = "Chirang"; + break; + case 8: + name = "Daga"; + break; + case 9: + name = "Geylegphug"; + break; + case 10: + name = "Ha"; + break; + case 11: + name = "Lhuntshi"; + break; + case 12: + name = "Mongar"; + break; + case 13: + name = "Paro"; + break; + case 14: + name = "Pemagatsel"; + break; + case 15: + name = "Punakha"; + break; + case 16: + name = "Samchi"; + break; + case 17: + name = "Samdrup"; + break; + case 18: + name = "Shemgang"; + break; + case 19: + name = "Tashigang"; + break; + case 20: + name = "Thimphu"; + break; + case 21: + name = "Tongsa"; + break; + case 22: + name = "Wangdi Phodrang"; + break; + } + } + if (country_code.equals("BW") == true) { + switch (region_code2) { + case 1: + name = "Central"; + break; + case 3: + name = "Ghanzi"; + break; + case 4: + name = "Kgalagadi"; + break; + case 5: + name = "Kgatleng"; + break; + case 6: + name = "Kweneng"; + break; + case 8: + name = "North-East"; + break; + case 9: + name = "South-East"; + break; + case 10: + name = "Southern"; + break; + case 11: + name = "North-West"; + break; + } + } + if (country_code.equals("BY") == true) { + switch (region_code2) { + case 1: + name = "Brestskaya Voblasts'"; + break; + case 2: + name = "Homyel'skaya Voblasts'"; + break; + case 3: + name = "Hrodzyenskaya Voblasts'"; + break; + case 4: + name = "Minsk"; + break; + case 5: + name = "Minskaya Voblasts'"; + break; + case 6: + name = "Mahilyowskaya Voblasts'"; + break; + case 7: + name = "Vitsyebskaya Voblasts'"; + break; + } + } + if (country_code.equals("BZ") == true) { + switch (region_code2) { + case 1: + name = "Belize"; + break; + case 2: + name = "Cayo"; + break; + case 3: + name = "Corozal"; + break; + case 4: + name = "Orange Walk"; + break; + case 5: + name = "Stann Creek"; + break; + case 6: + name = "Toledo"; + break; + } + } + if (country_code.equals("CD") == true) { + switch (region_code2) { + case 1: + name = "Bandundu"; + break; + case 2: + name = "Equateur"; + break; + case 4: + name = "Kasai-Oriental"; + break; + case 5: + name = "Katanga"; + break; + case 6: + name = "Kinshasa"; + break; + case 7: + name = "Kivu"; + break; + case 8: + name = "Bas-Congo"; + break; + case 9: + name = "Orientale"; + break; + case 10: + name = "Maniema"; + break; + case 11: + name = "Nord-Kivu"; + break; + case 12: + name = "Sud-Kivu"; + break; + case 13: + name = "Cuvette"; + break; + } + } + if (country_code.equals("CF") == true) { + switch (region_code2) { + case 1: + name = "Bamingui-Bangoran"; + break; + case 2: + name = "Basse-Kotto"; + break; + case 3: + name = "Haute-Kotto"; + break; + case 4: + name = "Mambere-Kadei"; + break; + case 5: + name = "Haut-Mbomou"; + break; + case 6: + name = "Kemo"; + break; + case 7: + name = "Lobaye"; + break; + case 8: + name = "Mbomou"; + break; + case 9: + name = "Nana-Mambere"; + break; + case 11: + name = "Ouaka"; + break; + case 12: + name = "Ouham"; + break; + case 13: + name = "Ouham-Pende"; + break; + case 14: + name = "Cuvette-Ouest"; + break; + case 15: + name = "Nana-Grebizi"; + break; + case 16: + name = "Sangha-Mbaere"; + break; + case 17: + name = "Ombella-Mpoko"; + break; + case 18: + name = "Bangui"; + break; + } + } + if (country_code.equals("CG") == true) { + switch (region_code2) { + case 1: + name = "Bouenza"; + break; + case 3: + name = "Cuvette"; + break; + case 4: + name = "Kouilou"; + break; + case 5: + name = "Lekoumou"; + break; + case 6: + name = "Likouala"; + break; + case 7: + name = "Niari"; + break; + case 8: + name = "Plateaux"; + break; + case 10: + name = "Sangha"; + break; + case 11: + name = "Pool"; + break; + case 12: + name = "Brazzaville"; + break; + } + } + if (country_code.equals("CH") == true) { + switch (region_code2) { + case 1: + name = "Aargau"; + break; + case 2: + name = "Ausser-Rhoden"; + break; + case 3: + name = "Basel-Landschaft"; + break; + case 4: + name = "Basel-Stadt"; + break; + case 5: + name = "Bern"; + break; + case 6: + name = "Fribourg"; + break; + case 7: + name = "Geneve"; + break; + case 8: + name = "Glarus"; + break; + case 9: + name = "Graubunden"; + break; + case 10: + name = "Inner-Rhoden"; + break; + case 11: + name = "Luzern"; + break; + case 12: + name = "Neuchatel"; + break; + case 13: + name = "Nidwalden"; + break; + case 14: + name = "Obwalden"; + break; + case 15: + name = "Sankt Gallen"; + break; + case 16: + name = "Schaffhausen"; + break; + case 17: + name = "Schwyz"; + break; + case 18: + name = "Solothurn"; + break; + case 19: + name = "Thurgau"; + break; + case 20: + name = "Ticino"; + break; + case 21: + name = "Uri"; + break; + case 22: + name = "Valais"; + break; + case 23: + name = "Vaud"; + break; + case 24: + name = "Zug"; + break; + case 25: + name = "Zurich"; + break; + case 26: + name = "Jura"; + break; + } + } + if (country_code.equals("CI") == true) { + switch (region_code2) { + case 5: + name = "Atacama"; + break; + case 6: + name = "Biobio"; + break; + case 51: + name = "Sassandra"; + break; + case 61: + name = "Abidjan"; + break; + case 74: + name = "Agneby"; + break; + case 75: + name = "Bafing"; + break; + case 76: + name = "Bas-Sassandra"; + break; + case 77: + name = "Denguele"; + break; + case 78: + name = "Dix-Huit Montagnes"; + break; + case 79: + name = "Fromager"; + break; + case 80: + name = "Haut-Sassandra"; + break; + case 81: + name = "Lacs"; + break; + case 82: + name = "Lagunes"; + break; + case 83: + name = "Marahoue"; + break; + case 84: + name = "Moyen-Cavally"; + break; + case 85: + name = "Moyen-Comoe"; + break; + case 86: + name = "N'zi-Comoe"; + break; + case 87: + name = "Savanes"; + break; + case 88: + name = "Sud-Bandama"; + break; + case 89: + name = "Sud-Comoe"; + break; + case 90: + name = "Vallee du Bandama"; + break; + case 91: + name = "Worodougou"; + break; + case 92: + name = "Zanzan"; + break; + } + } + if (country_code.equals("CL") == true) { + switch (region_code2) { + case 1: + name = "Valparaiso"; + break; + case 2: + name = "Aisen del General Carlos Ibanez del Campo"; + break; + case 3: + name = "Antofagasta"; + break; + case 4: + name = "Araucania"; + break; + case 5: + name = "Atacama"; + break; + case 6: + name = "Bio-Bio"; + break; + case 7: + name = "Coquimbo"; + break; + case 8: + name = "Libertador General Bernardo O'Higgins"; + break; + case 9: + name = "Los Lagos"; + break; + case 10: + name = "Magallanes y de la Antartica Chilena"; + break; + case 11: + name = "Maule"; + break; + case 12: + name = "Region Metropolitana"; + break; + case 13: + name = "Tarapaca"; + break; + case 14: + name = "Los Lagos"; + break; + case 15: + name = "Tarapaca"; + break; + case 16: + name = "Arica y Parinacota"; + break; + case 17: + name = "Los Rios"; + break; + } + } + if (country_code.equals("CM") == true) { + switch (region_code2) { + case 4: + name = "Est"; + break; + case 5: + name = "Littoral"; + break; + case 7: + name = "Nord-Ouest"; + break; + case 8: + name = "Ouest"; + break; + case 9: + name = "Sud-Ouest"; + break; + case 10: + name = "Adamaoua"; + break; + case 11: + name = "Centre"; + break; + case 12: + name = "Extreme-Nord"; + break; + case 13: + name = "Nord"; + break; + case 14: + name = "Sud"; + break; + } + } + if (country_code.equals("CN") == true) { + switch (region_code2) { + case 1: + name = "Anhui"; + break; + case 2: + name = "Zhejiang"; + break; + case 3: + name = "Jiangxi"; + break; + case 4: + name = "Jiangsu"; + break; + case 5: + name = "Jilin"; + break; + case 6: + name = "Qinghai"; + break; + case 7: + name = "Fujian"; + break; + case 8: + name = "Heilongjiang"; + break; + case 9: + name = "Henan"; + break; + case 10: + name = "Hebei"; + break; + case 11: + name = "Hunan"; + break; + case 12: + name = "Hubei"; + break; + case 13: + name = "Xinjiang"; + break; + case 14: + name = "Xizang"; + break; + case 15: + name = "Gansu"; + break; + case 16: + name = "Guangxi"; + break; + case 18: + name = "Guizhou"; + break; + case 19: + name = "Liaoning"; + break; + case 20: + name = "Nei Mongol"; + break; + case 21: + name = "Ningxia"; + break; + case 22: + name = "Beijing"; + break; + case 23: + name = "Shanghai"; + break; + case 24: + name = "Shanxi"; + break; + case 25: + name = "Shandong"; + break; + case 26: + name = "Shaanxi"; + break; + case 28: + name = "Tianjin"; + break; + case 29: + name = "Yunnan"; + break; + case 30: + name = "Guangdong"; + break; + case 31: + name = "Hainan"; + break; + case 32: + name = "Sichuan"; + break; + case 33: + name = "Chongqing"; + break; + } + } + if (country_code.equals("CO") == true) { + switch (region_code2) { + case 1: + name = "Amazonas"; + break; + case 2: + name = "Antioquia"; + break; + case 3: + name = "Arauca"; + break; + case 4: + name = "Atlantico"; + break; + case 5: + name = "Bolivar Department"; + break; + case 6: + name = "Boyaca Department"; + break; + case 7: + name = "Caldas Department"; + break; + case 8: + name = "Caqueta"; + break; + case 9: + name = "Cauca"; + break; + case 10: + name = "Cesar"; + break; + case 11: + name = "Choco"; + break; + case 12: + name = "Cordoba"; + break; + case 14: + name = "Guaviare"; + break; + case 15: + name = "Guainia"; + break; + case 16: + name = "Huila"; + break; + case 17: + name = "La Guajira"; + break; + case 18: + name = "Magdalena Department"; + break; + case 19: + name = "Meta"; + break; + case 20: + name = "Narino"; + break; + case 21: + name = "Norte de Santander"; + break; + case 22: + name = "Putumayo"; + break; + case 23: + name = "Quindio"; + break; + case 24: + name = "Risaralda"; + break; + case 25: + name = "San Andres y Providencia"; + break; + case 26: + name = "Santander"; + break; + case 27: + name = "Sucre"; + break; + case 28: + name = "Tolima"; + break; + case 29: + name = "Valle del Cauca"; + break; + case 30: + name = "Vaupes"; + break; + case 31: + name = "Vichada"; + break; + case 32: + name = "Casanare"; + break; + case 33: + name = "Cundinamarca"; + break; + case 34: + name = "Distrito Especial"; + break; + case 35: + name = "Bolivar"; + break; + case 36: + name = "Boyaca"; + break; + case 37: + name = "Caldas"; + break; + case 38: + name = "Magdalena"; + break; + } + } + if (country_code.equals("CR") == true) { + switch (region_code2) { + case 1: + name = "Alajuela"; + break; + case 2: + name = "Cartago"; + break; + case 3: + name = "Guanacaste"; + break; + case 4: + name = "Heredia"; + break; + case 6: + name = "Limon"; + break; + case 7: + name = "Puntarenas"; + break; + case 8: + name = "San Jose"; + break; + } + } + if (country_code.equals("CU") == true) { + switch (region_code2) { + case 1: + name = "Pinar del Rio"; + break; + case 2: + name = "Ciudad de la Habana"; + break; + case 3: + name = "Matanzas"; + break; + case 4: + name = "Isla de la Juventud"; + break; + case 5: + name = "Camaguey"; + break; + case 7: + name = "Ciego de Avila"; + break; + case 8: + name = "Cienfuegos"; + break; + case 9: + name = "Granma"; + break; + case 10: + name = "Guantanamo"; + break; + case 11: + name = "La Habana"; + break; + case 12: + name = "Holguin"; + break; + case 13: + name = "Las Tunas"; + break; + case 14: + name = "Sancti Spiritus"; + break; + case 15: + name = "Santiago de Cuba"; + break; + case 16: + name = "Villa Clara"; + break; + } + } + if (country_code.equals("CV") == true) { + switch (region_code2) { + case 1: + name = "Boa Vista"; + break; + case 2: + name = "Brava"; + break; + case 4: + name = "Maio"; + break; + case 5: + name = "Paul"; + break; + case 7: + name = "Ribeira Grande"; + break; + case 8: + name = "Sal"; + break; + case 10: + name = "Sao Nicolau"; + break; + case 11: + name = "Sao Vicente"; + break; + case 13: + name = "Mosteiros"; + break; + case 14: + name = "Praia"; + break; + case 15: + name = "Santa Catarina"; + break; + case 16: + name = "Santa Cruz"; + break; + case 17: + name = "Sao Domingos"; + break; + case 18: + name = "Sao Filipe"; + break; + case 19: + name = "Sao Miguel"; + break; + case 20: + name = "Tarrafal"; + break; + } + } + if (country_code.equals("CY") == true) { + switch (region_code2) { + case 1: + name = "Famagusta"; + break; + case 2: + name = "Kyrenia"; + break; + case 3: + name = "Larnaca"; + break; + case 4: + name = "Nicosia"; + break; + case 5: + name = "Limassol"; + break; + case 6: + name = "Paphos"; + break; + } + } + if (country_code.equals("CZ") == true) { + switch (region_code2) { + case 3: + name = "Blansko"; + break; + case 4: + name = "Breclav"; + break; + case 20: + name = "Hradec Kralove"; + break; + case 21: + name = "Jablonec nad Nisou"; + break; + case 23: + name = "Jicin"; + break; + case 24: + name = "Jihlava"; + break; + case 30: + name = "Kolin"; + break; + case 33: + name = "Liberec"; + break; + case 36: + name = "Melnik"; + break; + case 37: + name = "Mlada Boleslav"; + break; + case 39: + name = "Nachod"; + break; + case 41: + name = "Nymburk"; + break; + case 45: + name = "Pardubice"; + break; + case 52: + name = "Hlavni mesto Praha"; + break; + case 61: + name = "Semily"; + break; + case 70: + name = "Trutnov"; + break; + case 78: + name = "Jihomoravsky kraj"; + break; + case 79: + name = "Jihocesky kraj"; + break; + case 80: + name = "Vysocina"; + break; + case 81: + name = "Karlovarsky kraj"; + break; + case 82: + name = "Kralovehradecky kraj"; + break; + case 83: + name = "Liberecky kraj"; + break; + case 84: + name = "Olomoucky kraj"; + break; + case 85: + name = "Moravskoslezsky kraj"; + break; + case 86: + name = "Pardubicky kraj"; + break; + case 87: + name = "Plzensky kraj"; + break; + case 88: + name = "Stredocesky kraj"; + break; + case 89: + name = "Ustecky kraj"; + break; + case 90: + name = "Zlinsky kraj"; + break; + } + } + if (country_code.equals("DE") == true) { + switch (region_code2) { + case 1: + name = "Baden-Wurttemberg"; + break; + case 2: + name = "Bayern"; + break; + case 3: + name = "Bremen"; + break; + case 4: + name = "Hamburg"; + break; + case 5: + name = "Hessen"; + break; + case 6: + name = "Niedersachsen"; + break; + case 7: + name = "Nordrhein-Westfalen"; + break; + case 8: + name = "Rheinland-Pfalz"; + break; + case 9: + name = "Saarland"; + break; + case 10: + name = "Schleswig-Holstein"; + break; + case 11: + name = "Brandenburg"; + break; + case 12: + name = "Mecklenburg-Vorpommern"; + break; + case 13: + name = "Sachsen"; + break; + case 14: + name = "Sachsen-Anhalt"; + break; + case 15: + name = "Thuringen"; + break; + case 16: + name = "Berlin"; + break; + } + } + if (country_code.equals("DJ") == true) { + switch (region_code2) { + case 1: + name = "Ali Sabieh"; + break; + case 4: + name = "Obock"; + break; + case 5: + name = "Tadjoura"; + break; + case 6: + name = "Dikhil"; + break; + case 7: + name = "Djibouti"; + break; + case 8: + name = "Arta"; + break; + } + } + if (country_code.equals("DK") == true) { + switch (region_code2) { + case 17: + name = "Hovedstaden"; + break; + case 18: + name = "Midtjylland"; + break; + case 19: + name = "Nordjylland"; + break; + case 20: + name = "Sjelland"; + break; + case 21: + name = "Syddanmark"; + break; + } + } + if (country_code.equals("DM") == true) { + switch (region_code2) { + case 2: + name = "Saint Andrew"; + break; + case 3: + name = "Saint David"; + break; + case 4: + name = "Saint George"; + break; + case 5: + name = "Saint John"; + break; + case 6: + name = "Saint Joseph"; + break; + case 7: + name = "Saint Luke"; + break; + case 8: + name = "Saint Mark"; + break; + case 9: + name = "Saint Patrick"; + break; + case 10: + name = "Saint Paul"; + break; + case 11: + name = "Saint Peter"; + break; + } + } + if (country_code.equals("DO") == true) { + switch (region_code2) { + case 1: + name = "Azua"; + break; + case 2: + name = "Baoruco"; + break; + case 3: + name = "Barahona"; + break; + case 4: + name = "Dajabon"; + break; + case 5: + name = "Distrito Nacional"; + break; + case 6: + name = "Duarte"; + break; + case 8: + name = "Espaillat"; + break; + case 9: + name = "Independencia"; + break; + case 10: + name = "La Altagracia"; + break; + case 11: + name = "Elias Pina"; + break; + case 12: + name = "La Romana"; + break; + case 14: + name = "Maria Trinidad Sanchez"; + break; + case 15: + name = "Monte Cristi"; + break; + case 16: + name = "Pedernales"; + break; + case 17: + name = "Peravia"; + break; + case 18: + name = "Puerto Plata"; + break; + case 19: + name = "Salcedo"; + break; + case 20: + name = "Samana"; + break; + case 21: + name = "Sanchez Ramirez"; + break; + case 23: + name = "San Juan"; + break; + case 24: + name = "San Pedro De Macoris"; + break; + case 25: + name = "Santiago"; + break; + case 26: + name = "Santiago Rodriguez"; + break; + case 27: + name = "Valverde"; + break; + case 28: + name = "El Seibo"; + break; + case 29: + name = "Hato Mayor"; + break; + case 30: + name = "La Vega"; + break; + case 31: + name = "Monsenor Nouel"; + break; + case 32: + name = "Monte Plata"; + break; + case 33: + name = "San Cristobal"; + break; + case 34: + name = "Distrito Nacional"; + break; + case 35: + name = "Peravia"; + break; + case 36: + name = "San Jose de Ocoa"; + break; + case 37: + name = "Santo Domingo"; + break; + } + } + if (country_code.equals("DZ") == true) { + switch (region_code2) { + case 1: + name = "Alger"; + break; + case 3: + name = "Batna"; + break; + case 4: + name = "Constantine"; + break; + case 6: + name = "Medea"; + break; + case 7: + name = "Mostaganem"; + break; + case 9: + name = "Oran"; + break; + case 10: + name = "Saida"; + break; + case 12: + name = "Setif"; + break; + case 13: + name = "Tiaret"; + break; + case 14: + name = "Tizi Ouzou"; + break; + case 15: + name = "Tlemcen"; + break; + case 18: + name = "Bejaia"; + break; + case 19: + name = "Biskra"; + break; + case 20: + name = "Blida"; + break; + case 21: + name = "Bouira"; + break; + case 22: + name = "Djelfa"; + break; + case 23: + name = "Guelma"; + break; + case 24: + name = "Jijel"; + break; + case 25: + name = "Laghouat"; + break; + case 26: + name = "Mascara"; + break; + case 27: + name = "M'sila"; + break; + case 29: + name = "Oum el Bouaghi"; + break; + case 30: + name = "Sidi Bel Abbes"; + break; + case 31: + name = "Skikda"; + break; + case 33: + name = "Tebessa"; + break; + case 34: + name = "Adrar"; + break; + case 35: + name = "Ain Defla"; + break; + case 36: + name = "Ain Temouchent"; + break; + case 37: + name = "Annaba"; + break; + case 38: + name = "Bechar"; + break; + case 39: + name = "Bordj Bou Arreridj"; + break; + case 40: + name = "Boumerdes"; + break; + case 41: + name = "Chlef"; + break; + case 42: + name = "El Bayadh"; + break; + case 43: + name = "El Oued"; + break; + case 44: + name = "El Tarf"; + break; + case 45: + name = "Ghardaia"; + break; + case 46: + name = "Illizi"; + break; + case 47: + name = "Khenchela"; + break; + case 48: + name = "Mila"; + break; + case 49: + name = "Naama"; + break; + case 50: + name = "Ouargla"; + break; + case 51: + name = "Relizane"; + break; + case 52: + name = "Souk Ahras"; + break; + case 53: + name = "Tamanghasset"; + break; + case 54: + name = "Tindouf"; + break; + case 55: + name = "Tipaza"; + break; + case 56: + name = "Tissemsilt"; + break; + } + } + if (country_code.equals("EC") == true) { + switch (region_code2) { + case 1: + name = "Galapagos"; + break; + case 2: + name = "Azuay"; + break; + case 3: + name = "Bolivar"; + break; + case 4: + name = "Canar"; + break; + case 5: + name = "Carchi"; + break; + case 6: + name = "Chimborazo"; + break; + case 7: + name = "Cotopaxi"; + break; + case 8: + name = "El Oro"; + break; + case 9: + name = "Esmeraldas"; + break; + case 10: + name = "Guayas"; + break; + case 11: + name = "Imbabura"; + break; + case 12: + name = "Loja"; + break; + case 13: + name = "Los Rios"; + break; + case 14: + name = "Manabi"; + break; + case 15: + name = "Morona-Santiago"; + break; + case 17: + name = "Pastaza"; + break; + case 18: + name = "Pichincha"; + break; + case 19: + name = "Tungurahua"; + break; + case 20: + name = "Zamora-Chinchipe"; + break; + case 22: + name = "Sucumbios"; + break; + case 23: + name = "Napo"; + break; + case 24: + name = "Orellana"; + break; + } + } + if (country_code.equals("EE") == true) { + switch (region_code2) { + case 1: + name = "Harjumaa"; + break; + case 2: + name = "Hiiumaa"; + break; + case 3: + name = "Ida-Virumaa"; + break; + case 4: + name = "Jarvamaa"; + break; + case 5: + name = "Jogevamaa"; + break; + case 6: + name = "Kohtla-Jarve"; + break; + case 7: + name = "Laanemaa"; + break; + case 8: + name = "Laane-Virumaa"; + break; + case 9: + name = "Narva"; + break; + case 10: + name = "Parnu"; + break; + case 11: + name = "Parnumaa"; + break; + case 12: + name = "Polvamaa"; + break; + case 13: + name = "Raplamaa"; + break; + case 14: + name = "Saaremaa"; + break; + case 15: + name = "Sillamae"; + break; + case 16: + name = "Tallinn"; + break; + case 17: + name = "Tartu"; + break; + case 18: + name = "Tartumaa"; + break; + case 19: + name = "Valgamaa"; + break; + case 20: + name = "Viljandimaa"; + break; + case 21: + name = "Vorumaa"; + break; + } + } + if (country_code.equals("EG") == true) { + switch (region_code2) { + case 1: + name = "Ad Daqahliyah"; + break; + case 2: + name = "Al Bahr al Ahmar"; + break; + case 3: + name = "Al Buhayrah"; + break; + case 4: + name = "Al Fayyum"; + break; + case 5: + name = "Al Gharbiyah"; + break; + case 6: + name = "Al Iskandariyah"; + break; + case 7: + name = "Al Isma'iliyah"; + break; + case 8: + name = "Al Jizah"; + break; + case 9: + name = "Al Minufiyah"; + break; + case 10: + name = "Al Minya"; + break; + case 11: + name = "Al Qahirah"; + break; + case 12: + name = "Al Qalyubiyah"; + break; + case 13: + name = "Al Wadi al Jadid"; + break; + case 14: + name = "Ash Sharqiyah"; + break; + case 15: + name = "As Suways"; + break; + case 16: + name = "Aswan"; + break; + case 17: + name = "Asyut"; + break; + case 18: + name = "Bani Suwayf"; + break; + case 19: + name = "Bur Sa'id"; + break; + case 20: + name = "Dumyat"; + break; + case 21: + name = "Kafr ash Shaykh"; + break; + case 22: + name = "Matruh"; + break; + case 23: + name = "Qina"; + break; + case 24: + name = "Suhaj"; + break; + case 26: + name = "Janub Sina'"; + break; + case 27: + name = "Shamal Sina'"; + break; + } + } + if (country_code.equals("ER") == true) { + switch (region_code2) { + case 1: + name = "Anseba"; + break; + case 2: + name = "Debub"; + break; + case 3: + name = "Debubawi K'eyih Bahri"; + break; + case 4: + name = "Gash Barka"; + break; + case 5: + name = "Ma'akel"; + break; + case 6: + name = "Semenawi K'eyih Bahri"; + break; + } + } + if (country_code.equals("ES") == true) { + switch (region_code2) { + case 7: + name = "Islas Baleares"; + break; + case 27: + name = "La Rioja"; + break; + case 29: + name = "Madrid"; + break; + case 31: + name = "Murcia"; + break; + case 32: + name = "Navarra"; + break; + case 34: + name = "Asturias"; + break; + case 39: + name = "Cantabria"; + break; + case 51: + name = "Andalucia"; + break; + case 52: + name = "Aragon"; + break; + case 53: + name = "Canarias"; + break; + case 54: + name = "Castilla-La Mancha"; + break; + case 55: + name = "Castilla y Leon"; + break; + case 56: + name = "Catalonia"; + break; + case 57: + name = "Extremadura"; + break; + case 58: + name = "Galicia"; + break; + case 59: + name = "Pais Vasco"; + break; + case 60: + name = "Comunidad Valenciana"; + break; + } + } + if (country_code.equals("ET") == true) { + switch (region_code2) { + case 2: + name = "Amhara"; + break; + case 7: + name = "Somali"; + break; + case 8: + name = "Gambella"; + break; + case 10: + name = "Addis Abeba"; + break; + case 11: + name = "Southern"; + break; + case 12: + name = "Tigray"; + break; + case 13: + name = "Benishangul"; + break; + case 14: + name = "Afar"; + break; + case 44: + name = "Adis Abeba"; + break; + case 45: + name = "Afar"; + break; + case 46: + name = "Amara"; + break; + case 47: + name = "Binshangul Gumuz"; + break; + case 48: + name = "Dire Dawa"; + break; + case 49: + name = "Gambela Hizboch"; + break; + case 50: + name = "Hareri Hizb"; + break; + case 51: + name = "Oromiya"; + break; + case 52: + name = "Sumale"; + break; + case 53: + name = "Tigray"; + break; + case 54: + name = "YeDebub Biheroch Bihereseboch na Hizboch"; + break; + } + } + if (country_code.equals("FI") == true) { + switch (region_code2) { + case 1: + name = "Aland"; + break; + case 6: + name = "Lapland"; + break; + case 8: + name = "Oulu"; + break; + case 13: + name = "Southern Finland"; + break; + case 14: + name = "Eastern Finland"; + break; + case 15: + name = "Western Finland"; + break; + } + } + if (country_code.equals("FJ") == true) { + switch (region_code2) { + case 1: + name = "Central"; + break; + case 2: + name = "Eastern"; + break; + case 3: + name = "Northern"; + break; + case 4: + name = "Rotuma"; + break; + case 5: + name = "Western"; + break; + } + } + if (country_code.equals("FM") == true) { + switch (region_code2) { + case 1: + name = "Kosrae"; + break; + case 2: + name = "Pohnpei"; + break; + case 3: + name = "Chuuk"; + break; + case 4: + name = "Yap"; + break; + } + } + if (country_code.equals("FR") == true) { + switch (region_code2) { + case 97: + name = "Aquitaine"; + break; + case 98: + name = "Auvergne"; + break; + case 99: + name = "Basse-Normandie"; + break; + case 832: + name = "Bourgogne"; + break; + case 833: + name = "Bretagne"; + break; + case 834: + name = "Centre"; + break; + case 835: + name = "Champagne-Ardenne"; + break; + case 836: + name = "Corse"; + break; + case 837: + name = "Franche-Comte"; + break; + case 838: + name = "Haute-Normandie"; + break; + case 839: + name = "Ile-de-France"; + break; + case 840: + name = "Languedoc-Roussillon"; + break; + case 875: + name = "Limousin"; + break; + case 876: + name = "Lorraine"; + break; + case 877: + name = "Midi-Pyrenees"; + break; + case 878: + name = "Nord-Pas-de-Calais"; + break; + case 879: + name = "Pays de la Loire"; + break; + case 880: + name = "Picardie"; + break; + case 881: + name = "Poitou-Charentes"; + break; + case 882: + name = "Provence-Alpes-Cote d'Azur"; + break; + case 883: + name = "Rhone-Alpes"; + break; + case 918: + name = "Alsace"; + break; + } + } + if (country_code.equals("GA") == true) { + switch (region_code2) { + case 1: + name = "Estuaire"; + break; + case 2: + name = "Haut-Ogooue"; + break; + case 3: + name = "Moyen-Ogooue"; + break; + case 4: + name = "Ngounie"; + break; + case 5: + name = "Nyanga"; + break; + case 6: + name = "Ogooue-Ivindo"; + break; + case 7: + name = "Ogooue-Lolo"; + break; + case 8: + name = "Ogooue-Maritime"; + break; + case 9: + name = "Woleu-Ntem"; + break; + } + } + if (country_code.equals("GB") == true) { + switch (region_code2) { + case 1: + name = "Avon"; + break; + case 3: + name = "Berkshire"; + break; + case 7: + name = "Cleveland"; + break; + case 17: + name = "Greater London"; + break; + case 18: + name = "Greater Manchester"; + break; + case 20: + name = "Hereford and Worcester"; + break; + case 22: + name = "Humberside"; + break; + case 28: + name = "Merseyside"; + break; + case 37: + name = "South Yorkshire"; + break; + case 41: + name = "Tyne and Wear"; + break; + case 43: + name = "West Midlands"; + break; + case 45: + name = "West Yorkshire"; + break; + case 79: + name = "Central"; + break; + case 82: + name = "Grampian"; + break; + case 84: + name = "Lothian"; + break; + case 87: + name = "Strathclyde"; + break; + case 88: + name = "Tayside"; + break; + case 90: + name = "Clwyd"; + break; + case 91: + name = "Dyfed"; + break; + case 92: + name = "Gwent"; + break; + case 94: + name = "Mid Glamorgan"; + break; + case 96: + name = "South Glamorgan"; + break; + case 97: + name = "West Glamorgan"; + break; + case 832: + name = "Barking and Dagenham"; + break; + case 833: + name = "Barnet"; + break; + case 834: + name = "Barnsley"; + break; + case 835: + name = "Bath and North East Somerset"; + break; + case 836: + name = "Bedfordshire"; + break; + case 837: + name = "Bexley"; + break; + case 838: + name = "Birmingham"; + break; + case 839: + name = "Blackburn with Darwen"; + break; + case 840: + name = "Blackpool"; + break; + case 875: + name = "Bolton"; + break; + case 876: + name = "Bournemouth"; + break; + case 877: + name = "Bracknell Forest"; + break; + case 878: + name = "Bradford"; + break; + case 879: + name = "Brent"; + break; + case 880: + name = "Brighton and Hove"; + break; + case 881: + name = "Bristol"; + break; + case 882: + name = "Bromley"; + break; + case 883: + name = "Buckinghamshire"; + break; + case 918: + name = "Bury"; + break; + case 919: + name = "Calderdale"; + break; + case 920: + name = "Cambridgeshire"; + break; + case 921: + name = "Camden"; + break; + case 922: + name = "Cheshire"; + break; + case 923: + name = "Cornwall"; + break; + case 924: + name = "Coventry"; + break; + case 925: + name = "Croydon"; + break; + case 926: + name = "Cumbria"; + break; + case 961: + name = "Darlington"; + break; + case 962: + name = "Derby"; + break; + case 963: + name = "Derbyshire"; + break; + case 964: + name = "Devon"; + break; + case 965: + name = "Doncaster"; + break; + case 966: + name = "Dorset"; + break; + case 967: + name = "Dudley"; + break; + case 968: + name = "Durham"; + break; + case 969: + name = "Ealing"; + break; + case 1004: + name = "East Riding of Yorkshire"; + break; + case 1005: + name = "East Sussex"; + break; + case 1006: + name = "Enfield"; + break; + case 1007: + name = "Essex"; + break; + case 1008: + name = "Gateshead"; + break; + case 1009: + name = "Gloucestershire"; + break; + case 1010: + name = "Greenwich"; + break; + case 1011: + name = "Hackney"; + break; + case 1012: + name = "Halton"; + break; + case 1047: + name = "Hammersmith and Fulham"; + break; + case 1048: + name = "Hampshire"; + break; + case 1049: + name = "Haringey"; + break; + case 1050: + name = "Harrow"; + break; + case 1051: + name = "Hartlepool"; + break; + case 1052: + name = "Havering"; + break; + case 1053: + name = "Herefordshire"; + break; + case 1054: + name = "Hertford"; + break; + case 1055: + name = "Hillingdon"; + break; + case 1090: + name = "Hounslow"; + break; + case 1091: + name = "Isle of Wight"; + break; + case 1092: + name = "Islington"; + break; + case 1093: + name = "Kensington and Chelsea"; + break; + case 1094: + name = "Kent"; + break; + case 1095: + name = "Kingston upon Hull"; + break; + case 1096: + name = "Kingston upon Thames"; + break; + case 1097: + name = "Kirklees"; + break; + case 1098: + name = "Knowsley"; + break; + case 1133: + name = "Lambeth"; + break; + case 1134: + name = "Lancashire"; + break; + case 1135: + name = "Leeds"; + break; + case 1136: + name = "Leicester"; + break; + case 1137: + name = "Leicestershire"; + break; + case 1138: + name = "Lewisham"; + break; + case 1139: + name = "Lincolnshire"; + break; + case 1140: + name = "Liverpool"; + break; + case 1141: + name = "London"; + break; + case 1176: + name = "Luton"; + break; + case 1177: + name = "Manchester"; + break; + case 1178: + name = "Medway"; + break; + case 1179: + name = "Merton"; + break; + case 1180: + name = "Middlesbrough"; + break; + case 1181: + name = "Milton Keynes"; + break; + case 1182: + name = "Newcastle upon Tyne"; + break; + case 1183: + name = "Newham"; + break; + case 1184: + name = "Norfolk"; + break; + case 1219: + name = "Northamptonshire"; + break; + case 1220: + name = "North East Lincolnshire"; + break; + case 1221: + name = "North Lincolnshire"; + break; + case 1222: + name = "North Somerset"; + break; + case 1223: + name = "North Tyneside"; + break; + case 1224: + name = "Northumberland"; + break; + case 1225: + name = "North Yorkshire"; + break; + case 1226: + name = "Nottingham"; + break; + case 1227: + name = "Nottinghamshire"; + break; + case 1262: + name = "Oldham"; + break; + case 1263: + name = "Oxfordshire"; + break; + case 1264: + name = "Peterborough"; + break; + case 1265: + name = "Plymouth"; + break; + case 1266: + name = "Poole"; + break; + case 1267: + name = "Portsmouth"; + break; + case 1268: + name = "Reading"; + break; + case 1269: + name = "Redbridge"; + break; + case 1270: + name = "Redcar and Cleveland"; + break; + case 1305: + name = "Richmond upon Thames"; + break; + case 1306: + name = "Rochdale"; + break; + case 1307: + name = "Rotherham"; + break; + case 1308: + name = "Rutland"; + break; + case 1309: + name = "Salford"; + break; + case 1310: + name = "Shropshire"; + break; + case 1311: + name = "Sandwell"; + break; + case 1312: + name = "Sefton"; + break; + case 1313: + name = "Sheffield"; + break; + case 1348: + name = "Slough"; + break; + case 1349: + name = "Solihull"; + break; + case 1350: + name = "Somerset"; + break; + case 1351: + name = "Southampton"; + break; + case 1352: + name = "Southend-on-Sea"; + break; + case 1353: + name = "South Gloucestershire"; + break; + case 1354: + name = "South Tyneside"; + break; + case 1355: + name = "Southwark"; + break; + case 1356: + name = "Staffordshire"; + break; + case 1391: + name = "St. Helens"; + break; + case 1392: + name = "Stockport"; + break; + case 1393: + name = "Stockton-on-Tees"; + break; + case 1394: + name = "Stoke-on-Trent"; + break; + case 1395: + name = "Suffolk"; + break; + case 1396: + name = "Sunderland"; + break; + case 1397: + name = "Surrey"; + break; + case 1398: + name = "Sutton"; + break; + case 1399: + name = "Swindon"; + break; + case 1434: + name = "Tameside"; + break; + case 1435: + name = "Telford and Wrekin"; + break; + case 1436: + name = "Thurrock"; + break; + case 1437: + name = "Torbay"; + break; + case 1438: + name = "Tower Hamlets"; + break; + case 1439: + name = "Trafford"; + break; + case 1440: + name = "Wakefield"; + break; + case 1441: + name = "Walsall"; + break; + case 1442: + name = "Waltham Forest"; + break; + case 1477: + name = "Wandsworth"; + break; + case 1478: + name = "Warrington"; + break; + case 1479: + name = "Warwickshire"; + break; + case 1480: + name = "West Berkshire"; + break; + case 1481: + name = "Westminster"; + break; + case 1482: + name = "West Sussex"; + break; + case 1483: + name = "Wigan"; + break; + case 1484: + name = "Wiltshire"; + break; + case 1485: + name = "Windsor and Maidenhead"; + break; + case 1520: + name = "Wirral"; + break; + case 1521: + name = "Wokingham"; + break; + case 1522: + name = "Wolverhampton"; + break; + case 1523: + name = "Worcestershire"; + break; + case 1524: + name = "York"; + break; + case 1525: + name = "Antrim"; + break; + case 1526: + name = "Ards"; + break; + case 1527: + name = "Armagh"; + break; + case 1528: + name = "Ballymena"; + break; + case 1563: + name = "Ballymoney"; + break; + case 1564: + name = "Banbridge"; + break; + case 1565: + name = "Belfast"; + break; + case 1566: + name = "Carrickfergus"; + break; + case 1567: + name = "Castlereagh"; + break; + case 1568: + name = "Coleraine"; + break; + case 1569: + name = "Cookstown"; + break; + case 1570: + name = "Craigavon"; + break; + case 1571: + name = "Down"; + break; + case 1606: + name = "Dungannon"; + break; + case 1607: + name = "Fermanagh"; + break; + case 1608: + name = "Larne"; + break; + case 1609: + name = "Limavady"; + break; + case 1610: + name = "Lisburn"; + break; + case 1611: + name = "Derry"; + break; + case 1612: + name = "Magherafelt"; + break; + case 1613: + name = "Moyle"; + break; + case 1614: + name = "Newry and Mourne"; + break; + case 1649: + name = "Newtownabbey"; + break; + case 1650: + name = "North Down"; + break; + case 1651: + name = "Omagh"; + break; + case 1652: + name = "Strabane"; + break; + case 1653: + name = "Aberdeen City"; + break; + case 1654: + name = "Aberdeenshire"; + break; + case 1655: + name = "Angus"; + break; + case 1656: + name = "Argyll and Bute"; + break; + case 1657: + name = "Scottish Borders"; + break; + case 1692: + name = "Clackmannanshire"; + break; + case 1693: + name = "Dumfries and Galloway"; + break; + case 1694: + name = "Dundee City"; + break; + case 1695: + name = "East Ayrshire"; + break; + case 1696: + name = "East Dunbartonshire"; + break; + case 1697: + name = "East Lothian"; + break; + case 1698: + name = "East Renfrewshire"; + break; + case 1699: + name = "Edinburgh"; + break; + case 1700: + name = "Falkirk"; + break; + case 1735: + name = "Fife"; + break; + case 1736: + name = "Glasgow City"; + break; + case 1737: + name = "Highland"; + break; + case 1738: + name = "Inverclyde"; + break; + case 1739: + name = "Midlothian"; + break; + case 1740: + name = "Moray"; + break; + case 1741: + name = "North Ayrshire"; + break; + case 1742: + name = "North Lanarkshire"; + break; + case 1743: + name = "Orkney"; + break; + case 1778: + name = "Perth and Kinross"; + break; + case 1779: + name = "Renfrewshire"; + break; + case 1780: + name = "Shetland Islands"; + break; + case 1781: + name = "South Ayrshire"; + break; + case 1782: + name = "South Lanarkshire"; + break; + case 1783: + name = "Stirling"; + break; + case 1784: + name = "West Dunbartonshire"; + break; + case 1785: + name = "Eilean Siar"; + break; + case 1786: + name = "West Lothian"; + break; + case 1821: + name = "Isle of Anglesey"; + break; + case 1822: + name = "Blaenau Gwent"; + break; + case 1823: + name = "Bridgend"; + break; + case 1824: + name = "Caerphilly"; + break; + case 1825: + name = "Cardiff"; + break; + case 1826: + name = "Ceredigion"; + break; + case 1827: + name = "Carmarthenshire"; + break; + case 1828: + name = "Conwy"; + break; + case 1829: + name = "Denbighshire"; + break; + case 1864: + name = "Flintshire"; + break; + case 1865: + name = "Gwynedd"; + break; + case 1866: + name = "Merthyr Tydfil"; + break; + case 1867: + name = "Monmouthshire"; + break; + case 1868: + name = "Neath Port Talbot"; + break; + case 1869: + name = "Newport"; + break; + case 1870: + name = "Pembrokeshire"; + break; + case 1871: + name = "Powys"; + break; + case 1872: + name = "Rhondda Cynon Taff"; + break; + case 1907: + name = "Swansea"; + break; + case 1908: + name = "Torfaen"; + break; + case 1909: + name = "Vale of Glamorgan"; + break; + case 1910: + name = "Wrexham"; + break; + } + } + if (country_code.equals("GD") == true) { + switch (region_code2) { + case 1: + name = "Saint Andrew"; + break; + case 2: + name = "Saint David"; + break; + case 3: + name = "Saint George"; + break; + case 4: + name = "Saint John"; + break; + case 5: + name = "Saint Mark"; + break; + case 6: + name = "Saint Patrick"; + break; + } + } + if (country_code.equals("GE") == true) { + switch (region_code2) { + case 1: + name = "Abashis Raioni"; + break; + case 2: + name = "Abkhazia"; + break; + case 3: + name = "Adigenis Raioni"; + break; + case 4: + name = "Ajaria"; + break; + case 5: + name = "Akhalgoris Raioni"; + break; + case 6: + name = "Akhalk'alak'is Raioni"; + break; + case 7: + name = "Akhalts'ikhis Raioni"; + break; + case 8: + name = "Akhmetis Raioni"; + break; + case 9: + name = "Ambrolauris Raioni"; + break; + case 10: + name = "Aspindzis Raioni"; + break; + case 11: + name = "Baghdat'is Raioni"; + break; + case 12: + name = "Bolnisis Raioni"; + break; + case 13: + name = "Borjomis Raioni"; + break; + case 14: + name = "Chiat'ura"; + break; + case 15: + name = "Ch'khorotsqus Raioni"; + break; + case 16: + name = "Ch'okhatauris Raioni"; + break; + case 17: + name = "Dedop'listsqaros Raioni"; + break; + case 18: + name = "Dmanisis Raioni"; + break; + case 19: + name = "Dushet'is Raioni"; + break; + case 20: + name = "Gardabanis Raioni"; + break; + case 21: + name = "Gori"; + break; + case 22: + name = "Goris Raioni"; + break; + case 23: + name = "Gurjaanis Raioni"; + break; + case 24: + name = "Javis Raioni"; + break; + case 25: + name = "K'arelis Raioni"; + break; + case 26: + name = "Kaspis Raioni"; + break; + case 27: + name = "Kharagaulis Raioni"; + break; + case 28: + name = "Khashuris Raioni"; + break; + case 29: + name = "Khobis Raioni"; + break; + case 30: + name = "Khonis Raioni"; + break; + case 31: + name = "K'ut'aisi"; + break; + case 32: + name = "Lagodekhis Raioni"; + break; + case 33: + name = "Lanch'khut'is Raioni"; + break; + case 34: + name = "Lentekhis Raioni"; + break; + case 35: + name = "Marneulis Raioni"; + break; + case 36: + name = "Martvilis Raioni"; + break; + case 37: + name = "Mestiis Raioni"; + break; + case 38: + name = "Mts'khet'is Raioni"; + break; + case 39: + name = "Ninotsmindis Raioni"; + break; + case 40: + name = "Onis Raioni"; + break; + case 41: + name = "Ozurget'is Raioni"; + break; + case 42: + name = "P'ot'i"; + break; + case 43: + name = "Qazbegis Raioni"; + break; + case 44: + name = "Qvarlis Raioni"; + break; + case 45: + name = "Rust'avi"; + break; + case 46: + name = "Sach'kheris Raioni"; + break; + case 47: + name = "Sagarejos Raioni"; + break; + case 48: + name = "Samtrediis Raioni"; + break; + case 49: + name = "Senakis Raioni"; + break; + case 50: + name = "Sighnaghis Raioni"; + break; + case 51: + name = "T'bilisi"; + break; + case 52: + name = "T'elavis Raioni"; + break; + case 53: + name = "T'erjolis Raioni"; + break; + case 54: + name = "T'et'ritsqaros Raioni"; + break; + case 55: + name = "T'ianet'is Raioni"; + break; + case 56: + name = "Tqibuli"; + break; + case 57: + name = "Ts'ageris Raioni"; + break; + case 58: + name = "Tsalenjikhis Raioni"; + break; + case 59: + name = "Tsalkis Raioni"; + break; + case 60: + name = "Tsqaltubo"; + break; + case 61: + name = "Vanis Raioni"; + break; + case 62: + name = "Zestap'onis Raioni"; + break; + case 63: + name = "Zugdidi"; + break; + case 64: + name = "Zugdidis Raioni"; + break; + } + } + if (country_code.equals("GH") == true) { + switch (region_code2) { + case 1: + name = "Greater Accra"; + break; + case 2: + name = "Ashanti"; + break; + case 3: + name = "Brong-Ahafo"; + break; + case 4: + name = "Central"; + break; + case 5: + name = "Eastern"; + break; + case 6: + name = "Northern"; + break; + case 8: + name = "Volta"; + break; + case 9: + name = "Western"; + break; + case 10: + name = "Upper East"; + break; + case 11: + name = "Upper West"; + break; + } + } + if (country_code.equals("GL") == true) { + switch (region_code2) { + case 1: + name = "Nordgronland"; + break; + case 2: + name = "Ostgronland"; + break; + case 3: + name = "Vestgronland"; + break; + } + } + if (country_code.equals("GM") == true) { + switch (region_code2) { + case 1: + name = "Banjul"; + break; + case 2: + name = "Lower River"; + break; + case 3: + name = "Central River"; + break; + case 4: + name = "Upper River"; + break; + case 5: + name = "Western"; + break; + case 7: + name = "North Bank"; + break; + } + } + if (country_code.equals("GN") == true) { + switch (region_code2) { + case 1: + name = "Beyla"; + break; + case 2: + name = "Boffa"; + break; + case 3: + name = "Boke"; + break; + case 4: + name = "Conakry"; + break; + case 5: + name = "Dabola"; + break; + case 6: + name = "Dalaba"; + break; + case 7: + name = "Dinguiraye"; + break; + case 9: + name = "Faranah"; + break; + case 10: + name = "Forecariah"; + break; + case 11: + name = "Fria"; + break; + case 12: + name = "Gaoual"; + break; + case 13: + name = "Gueckedou"; + break; + case 15: + name = "Kerouane"; + break; + case 16: + name = "Kindia"; + break; + case 17: + name = "Kissidougou"; + break; + case 18: + name = "Koundara"; + break; + case 19: + name = "Kouroussa"; + break; + case 21: + name = "Macenta"; + break; + case 22: + name = "Mali"; + break; + case 23: + name = "Mamou"; + break; + case 25: + name = "Pita"; + break; + case 27: + name = "Telimele"; + break; + case 28: + name = "Tougue"; + break; + case 29: + name = "Yomou"; + break; + case 30: + name = "Coyah"; + break; + case 31: + name = "Dubreka"; + break; + case 32: + name = "Kankan"; + break; + case 33: + name = "Koubia"; + break; + case 34: + name = "Labe"; + break; + case 35: + name = "Lelouma"; + break; + case 36: + name = "Lola"; + break; + case 37: + name = "Mandiana"; + break; + case 38: + name = "Nzerekore"; + break; + case 39: + name = "Siguiri"; + break; + } + } + if (country_code.equals("GQ") == true) { + switch (region_code2) { + case 3: + name = "Annobon"; + break; + case 4: + name = "Bioko Norte"; + break; + case 5: + name = "Bioko Sur"; + break; + case 6: + name = "Centro Sur"; + break; + case 7: + name = "Kie-Ntem"; + break; + case 8: + name = "Litoral"; + break; + case 9: + name = "Wele-Nzas"; + break; + } + } + if (country_code.equals("GR") == true) { + switch (region_code2) { + case 1: + name = "Evros"; + break; + case 2: + name = "Rodhopi"; + break; + case 3: + name = "Xanthi"; + break; + case 4: + name = "Drama"; + break; + case 5: + name = "Serrai"; + break; + case 6: + name = "Kilkis"; + break; + case 7: + name = "Pella"; + break; + case 8: + name = "Florina"; + break; + case 9: + name = "Kastoria"; + break; + case 10: + name = "Grevena"; + break; + case 11: + name = "Kozani"; + break; + case 12: + name = "Imathia"; + break; + case 13: + name = "Thessaloniki"; + break; + case 14: + name = "Kavala"; + break; + case 15: + name = "Khalkidhiki"; + break; + case 16: + name = "Pieria"; + break; + case 17: + name = "Ioannina"; + break; + case 18: + name = "Thesprotia"; + break; + case 19: + name = "Preveza"; + break; + case 20: + name = "Arta"; + break; + case 21: + name = "Larisa"; + break; + case 22: + name = "Trikala"; + break; + case 23: + name = "Kardhitsa"; + break; + case 24: + name = "Magnisia"; + break; + case 25: + name = "Kerkira"; + break; + case 26: + name = "Levkas"; + break; + case 27: + name = "Kefallinia"; + break; + case 28: + name = "Zakinthos"; + break; + case 29: + name = "Fthiotis"; + break; + case 30: + name = "Evritania"; + break; + case 31: + name = "Aitolia kai Akarnania"; + break; + case 32: + name = "Fokis"; + break; + case 33: + name = "Voiotia"; + break; + case 34: + name = "Evvoia"; + break; + case 35: + name = "Attiki"; + break; + case 36: + name = "Argolis"; + break; + case 37: + name = "Korinthia"; + break; + case 38: + name = "Akhaia"; + break; + case 39: + name = "Ilia"; + break; + case 40: + name = "Messinia"; + break; + case 41: + name = "Arkadhia"; + break; + case 42: + name = "Lakonia"; + break; + case 43: + name = "Khania"; + break; + case 44: + name = "Rethimni"; + break; + case 45: + name = "Iraklion"; + break; + case 46: + name = "Lasithi"; + break; + case 47: + name = "Dhodhekanisos"; + break; + case 48: + name = "Samos"; + break; + case 49: + name = "Kikladhes"; + break; + case 50: + name = "Khios"; + break; + case 51: + name = "Lesvos"; + break; + } + } + if (country_code.equals("GT") == true) { + switch (region_code2) { + case 1: + name = "Alta Verapaz"; + break; + case 2: + name = "Baja Verapaz"; + break; + case 3: + name = "Chimaltenango"; + break; + case 4: + name = "Chiquimula"; + break; + case 5: + name = "El Progreso"; + break; + case 6: + name = "Escuintla"; + break; + case 7: + name = "Guatemala"; + break; + case 8: + name = "Huehuetenango"; + break; + case 9: + name = "Izabal"; + break; + case 10: + name = "Jalapa"; + break; + case 11: + name = "Jutiapa"; + break; + case 12: + name = "Peten"; + break; + case 13: + name = "Quetzaltenango"; + break; + case 14: + name = "Quiche"; + break; + case 15: + name = "Retalhuleu"; + break; + case 16: + name = "Sacatepequez"; + break; + case 17: + name = "San Marcos"; + break; + case 18: + name = "Santa Rosa"; + break; + case 19: + name = "Solola"; + break; + case 20: + name = "Suchitepequez"; + break; + case 21: + name = "Totonicapan"; + break; + case 22: + name = "Zacapa"; + break; + } + } + if (country_code.equals("GW") == true) { + switch (region_code2) { + case 1: + name = "Bafata"; + break; + case 2: + name = "Quinara"; + break; + case 4: + name = "Oio"; + break; + case 5: + name = "Bolama"; + break; + case 6: + name = "Cacheu"; + break; + case 7: + name = "Tombali"; + break; + case 10: + name = "Gabu"; + break; + case 11: + name = "Bissau"; + break; + case 12: + name = "Biombo"; + break; + } + } + if (country_code.equals("GY") == true) { + switch (region_code2) { + case 10: + name = "Barima-Waini"; + break; + case 11: + name = "Cuyuni-Mazaruni"; + break; + case 12: + name = "Demerara-Mahaica"; + break; + case 13: + name = "East Berbice-Corentyne"; + break; + case 14: + name = "Essequibo Islands-West Demerara"; + break; + case 15: + name = "Mahaica-Berbice"; + break; + case 16: + name = "Pomeroon-Supenaam"; + break; + case 17: + name = "Potaro-Siparuni"; + break; + case 18: + name = "Upper Demerara-Berbice"; + break; + case 19: + name = "Upper Takutu-Upper Essequibo"; + break; + } + } + if (country_code.equals("HN") == true) { + switch (region_code2) { + case 1: + name = "Atlantida"; + break; + case 2: + name = "Choluteca"; + break; + case 3: + name = "Colon"; + break; + case 4: + name = "Comayagua"; + break; + case 5: + name = "Copan"; + break; + case 6: + name = "Cortes"; + break; + case 7: + name = "El Paraiso"; + break; + case 8: + name = "Francisco Morazan"; + break; + case 9: + name = "Gracias a Dios"; + break; + case 10: + name = "Intibuca"; + break; + case 11: + name = "Islas de la Bahia"; + break; + case 12: + name = "La Paz"; + break; + case 13: + name = "Lempira"; + break; + case 14: + name = "Ocotepeque"; + break; + case 15: + name = "Olancho"; + break; + case 16: + name = "Santa Barbara"; + break; + case 17: + name = "Valle"; + break; + case 18: + name = "Yoro"; + break; + } + } + if (country_code.equals("HR") == true) { + switch (region_code2) { + case 1: + name = "Bjelovarsko-Bilogorska"; + break; + case 2: + name = "Brodsko-Posavska"; + break; + case 3: + name = "Dubrovacko-Neretvanska"; + break; + case 4: + name = "Istarska"; + break; + case 5: + name = "Karlovacka"; + break; + case 6: + name = "Koprivnicko-Krizevacka"; + break; + case 7: + name = "Krapinsko-Zagorska"; + break; + case 8: + name = "Licko-Senjska"; + break; + case 9: + name = "Medimurska"; + break; + case 10: + name = "Osjecko-Baranjska"; + break; + case 11: + name = "Pozesko-Slavonska"; + break; + case 12: + name = "Primorsko-Goranska"; + break; + case 13: + name = "Sibensko-Kninska"; + break; + case 14: + name = "Sisacko-Moslavacka"; + break; + case 15: + name = "Splitsko-Dalmatinska"; + break; + case 16: + name = "Varazdinska"; + break; + case 17: + name = "Viroviticko-Podravska"; + break; + case 18: + name = "Vukovarsko-Srijemska"; + break; + case 19: + name = "Zadarska"; + break; + case 20: + name = "Zagrebacka"; + break; + case 21: + name = "Grad Zagreb"; + break; + } + } + if (country_code.equals("HT") == true) { + switch (region_code2) { + case 3: + name = "Nord-Ouest"; + break; + case 6: + name = "Artibonite"; + break; + case 7: + name = "Centre"; + break; + case 9: + name = "Nord"; + break; + case 10: + name = "Nord-Est"; + break; + case 11: + name = "Ouest"; + break; + case 12: + name = "Sud"; + break; + case 13: + name = "Sud-Est"; + break; + case 14: + name = "Grand' Anse"; + break; + case 15: + name = "Nippes"; + break; + } + } + if (country_code.equals("HU") == true) { + switch (region_code2) { + case 1: + name = "Bacs-Kiskun"; + break; + case 2: + name = "Baranya"; + break; + case 3: + name = "Bekes"; + break; + case 4: + name = "Borsod-Abauj-Zemplen"; + break; + case 5: + name = "Budapest"; + break; + case 6: + name = "Csongrad"; + break; + case 7: + name = "Debrecen"; + break; + case 8: + name = "Fejer"; + break; + case 9: + name = "Gyor-Moson-Sopron"; + break; + case 10: + name = "Hajdu-Bihar"; + break; + case 11: + name = "Heves"; + break; + case 12: + name = "Komarom-Esztergom"; + break; + case 13: + name = "Miskolc"; + break; + case 14: + name = "Nograd"; + break; + case 15: + name = "Pecs"; + break; + case 16: + name = "Pest"; + break; + case 17: + name = "Somogy"; + break; + case 18: + name = "Szabolcs-Szatmar-Bereg"; + break; + case 19: + name = "Szeged"; + break; + case 20: + name = "Jasz-Nagykun-Szolnok"; + break; + case 21: + name = "Tolna"; + break; + case 22: + name = "Vas"; + break; + case 23: + name = "Veszprem"; + break; + case 24: + name = "Zala"; + break; + case 25: + name = "Gyor"; + break; + case 26: + name = "Bekescsaba"; + break; + case 27: + name = "Dunaujvaros"; + break; + case 28: + name = "Eger"; + break; + case 29: + name = "Hodmezovasarhely"; + break; + case 30: + name = "Kaposvar"; + break; + case 31: + name = "Kecskemet"; + break; + case 32: + name = "Nagykanizsa"; + break; + case 33: + name = "Nyiregyhaza"; + break; + case 34: + name = "Sopron"; + break; + case 35: + name = "Szekesfehervar"; + break; + case 36: + name = "Szolnok"; + break; + case 37: + name = "Szombathely"; + break; + case 38: + name = "Tatabanya"; + break; + case 39: + name = "Veszprem"; + break; + case 40: + name = "Zalaegerszeg"; + break; + case 41: + name = "Salgotarjan"; + break; + case 42: + name = "Szekszard"; + break; + } + } + if (country_code.equals("ID") == true) { + switch (region_code2) { + case 1: + name = "Aceh"; + break; + case 2: + name = "Bali"; + break; + case 3: + name = "Bengkulu"; + break; + case 4: + name = "Jakarta Raya"; + break; + case 5: + name = "Jambi"; + break; + case 6: + name = "Jawa Barat"; + break; + case 7: + name = "Jawa Tengah"; + break; + case 8: + name = "Jawa Timur"; + break; + case 9: + name = "Papua"; + break; + case 10: + name = "Yogyakarta"; + break; + case 11: + name = "Kalimantan Barat"; + break; + case 12: + name = "Kalimantan Selatan"; + break; + case 13: + name = "Kalimantan Tengah"; + break; + case 14: + name = "Kalimantan Timur"; + break; + case 15: + name = "Lampung"; + break; + case 16: + name = "Maluku"; + break; + case 17: + name = "Nusa Tenggara Barat"; + break; + case 18: + name = "Nusa Tenggara Timur"; + break; + case 19: + name = "Riau"; + break; + case 20: + name = "Sulawesi Selatan"; + break; + case 21: + name = "Sulawesi Tengah"; + break; + case 22: + name = "Sulawesi Tenggara"; + break; + case 23: + name = "Sulawesi Utara"; + break; + case 24: + name = "Sumatera Barat"; + break; + case 25: + name = "Sumatera Selatan"; + break; + case 26: + name = "Sumatera Utara"; + break; + case 28: + name = "Maluku"; + break; + case 29: + name = "Maluku Utara"; + break; + case 30: + name = "Jawa Barat"; + break; + case 31: + name = "Sulawesi Utara"; + break; + case 32: + name = "Sumatera Selatan"; + break; + case 33: + name = "Banten"; + break; + case 34: + name = "Gorontalo"; + break; + case 35: + name = "Kepulauan Bangka Belitung"; + break; + case 36: + name = "Papua"; + break; + case 37: + name = "Riau"; + break; + case 38: + name = "Sulawesi Selatan"; + break; + case 39: + name = "Irian Jaya Barat"; + break; + case 40: + name = "Kepulauan Riau"; + break; + case 41: + name = "Sulawesi Barat"; + break; + } + } + if (country_code.equals("IE") == true) { + switch (region_code2) { + case 1: + name = "Carlow"; + break; + case 2: + name = "Cavan"; + break; + case 3: + name = "Clare"; + break; + case 4: + name = "Cork"; + break; + case 6: + name = "Donegal"; + break; + case 7: + name = "Dublin"; + break; + case 10: + name = "Galway"; + break; + case 11: + name = "Kerry"; + break; + case 12: + name = "Kildare"; + break; + case 13: + name = "Kilkenny"; + break; + case 14: + name = "Leitrim"; + break; + case 15: + name = "Laois"; + break; + case 16: + name = "Limerick"; + break; + case 18: + name = "Longford"; + break; + case 19: + name = "Louth"; + break; + case 20: + name = "Mayo"; + break; + case 21: + name = "Meath"; + break; + case 22: + name = "Monaghan"; + break; + case 23: + name = "Offaly"; + break; + case 24: + name = "Roscommon"; + break; + case 25: + name = "Sligo"; + break; + case 26: + name = "Tipperary"; + break; + case 27: + name = "Waterford"; + break; + case 29: + name = "Westmeath"; + break; + case 30: + name = "Wexford"; + break; + case 31: + name = "Wicklow"; + break; + } + } + if (country_code.equals("IL") == true) { + switch (region_code2) { + case 1: + name = "HaDarom"; + break; + case 2: + name = "HaMerkaz"; + break; + case 3: + name = "HaZafon"; + break; + case 4: + name = "Hefa"; + break; + case 5: + name = "Tel Aviv"; + break; + case 6: + name = "Yerushalayim"; + break; + } + } + if (country_code.equals("IN") == true) { + switch (region_code2) { + case 1: + name = "Andaman and Nicobar Islands"; + break; + case 2: + name = "Andhra Pradesh"; + break; + case 3: + name = "Assam"; + break; + case 5: + name = "Chandigarh"; + break; + case 6: + name = "Dadra and Nagar Haveli"; + break; + case 7: + name = "Delhi"; + break; + case 9: + name = "Gujarat"; + break; + case 10: + name = "Haryana"; + break; + case 11: + name = "Himachal Pradesh"; + break; + case 12: + name = "Jammu and Kashmir"; + break; + case 13: + name = "Kerala"; + break; + case 14: + name = "Lakshadweep"; + break; + case 16: + name = "Maharashtra"; + break; + case 17: + name = "Manipur"; + break; + case 18: + name = "Meghalaya"; + break; + case 19: + name = "Karnataka"; + break; + case 20: + name = "Nagaland"; + break; + case 21: + name = "Orissa"; + break; + case 22: + name = "Puducherry"; + break; + case 23: + name = "Punjab"; + break; + case 24: + name = "Rajasthan"; + break; + case 25: + name = "Tamil Nadu"; + break; + case 26: + name = "Tripura"; + break; + case 28: + name = "West Bengal"; + break; + case 29: + name = "Sikkim"; + break; + case 30: + name = "Arunachal Pradesh"; + break; + case 31: + name = "Mizoram"; + break; + case 32: + name = "Daman and Diu"; + break; + case 33: + name = "Goa"; + break; + case 34: + name = "Bihar"; + break; + case 35: + name = "Madhya Pradesh"; + break; + case 36: + name = "Uttar Pradesh"; + break; + case 37: + name = "Chhattisgarh"; + break; + case 38: + name = "Jharkhand"; + break; + case 39: + name = "Uttarakhand"; + break; + } + } + if (country_code.equals("IQ") == true) { + switch (region_code2) { + case 1: + name = "Al Anbar"; + break; + case 2: + name = "Al Basrah"; + break; + case 3: + name = "Al Muthanna"; + break; + case 4: + name = "Al Qadisiyah"; + break; + case 5: + name = "As Sulaymaniyah"; + break; + case 6: + name = "Babil"; + break; + case 7: + name = "Baghdad"; + break; + case 8: + name = "Dahuk"; + break; + case 9: + name = "Dhi Qar"; + break; + case 10: + name = "Diyala"; + break; + case 11: + name = "Arbil"; + break; + case 12: + name = "Karbala'"; + break; + case 13: + name = "At Ta'mim"; + break; + case 14: + name = "Maysan"; + break; + case 15: + name = "Ninawa"; + break; + case 16: + name = "Wasit"; + break; + case 17: + name = "An Najaf"; + break; + case 18: + name = "Salah ad Din"; + break; + } + } + if (country_code.equals("IR") == true) { + switch (region_code2) { + case 1: + name = "Azarbayjan-e Bakhtari"; + break; + case 2: + name = "Azarbayjan-e Khavari"; + break; + case 3: + name = "Chahar Mahall va Bakhtiari"; + break; + case 4: + name = "Sistan va Baluchestan"; + break; + case 5: + name = "Kohkiluyeh va Buyer Ahmadi"; + break; + case 7: + name = "Fars"; + break; + case 8: + name = "Gilan"; + break; + case 9: + name = "Hamadan"; + break; + case 10: + name = "Ilam"; + break; + case 11: + name = "Hormozgan"; + break; + case 12: + name = "Kerman"; + break; + case 13: + name = "Bakhtaran"; + break; + case 15: + name = "Khuzestan"; + break; + case 16: + name = "Kordestan"; + break; + case 17: + name = "Mazandaran"; + break; + case 18: + name = "Semnan Province"; + break; + case 19: + name = "Markazi"; + break; + case 21: + name = "Zanjan"; + break; + case 22: + name = "Bushehr"; + break; + case 23: + name = "Lorestan"; + break; + case 24: + name = "Markazi"; + break; + case 25: + name = "Semnan"; + break; + case 26: + name = "Tehran"; + break; + case 27: + name = "Zanjan"; + break; + case 28: + name = "Esfahan"; + break; + case 29: + name = "Kerman"; + break; + case 30: + name = "Khorasan"; + break; + case 31: + name = "Yazd"; + break; + case 32: + name = "Ardabil"; + break; + case 33: + name = "East Azarbaijan"; + break; + case 34: + name = "Markazi"; + break; + case 35: + name = "Mazandaran"; + break; + case 36: + name = "Zanjan"; + break; + case 37: + name = "Golestan"; + break; + case 38: + name = "Qazvin"; + break; + case 39: + name = "Qom"; + break; + case 40: + name = "Yazd"; + break; + case 41: + name = "Khorasan-e Janubi"; + break; + case 42: + name = "Khorasan-e Razavi"; + break; + case 43: + name = "Khorasan-e Shemali"; + break; + } + } + if (country_code.equals("IS") == true) { + switch (region_code2) { + case 3: + name = "Arnessysla"; + break; + case 5: + name = "Austur-Hunavatnssysla"; + break; + case 6: + name = "Austur-Skaftafellssysla"; + break; + case 7: + name = "Borgarfjardarsysla"; + break; + case 9: + name = "Eyjafjardarsysla"; + break; + case 10: + name = "Gullbringusysla"; + break; + case 15: + name = "Kjosarsysla"; + break; + case 17: + name = "Myrasysla"; + break; + case 20: + name = "Nordur-Mulasysla"; + break; + case 21: + name = "Nordur-Tingeyjarsysla"; + break; + case 23: + name = "Rangarvallasysla"; + break; + case 28: + name = "Skagafjardarsysla"; + break; + case 29: + name = "Snafellsnes- og Hnappadalssysla"; + break; + case 30: + name = "Strandasysla"; + break; + case 31: + name = "Sudur-Mulasysla"; + break; + case 32: + name = "Sudur-Tingeyjarsysla"; + break; + case 34: + name = "Vestur-Bardastrandarsysla"; + break; + case 35: + name = "Vestur-Hunavatnssysla"; + break; + case 36: + name = "Vestur-Isafjardarsysla"; + break; + case 37: + name = "Vestur-Skaftafellssysla"; + break; + case 40: + name = "Norourland Eystra"; + break; + case 41: + name = "Norourland Vestra"; + break; + case 42: + name = "Suourland"; + break; + case 43: + name = "Suournes"; + break; + case 44: + name = "Vestfiroir"; + break; + case 45: + name = "Vesturland"; + break; + } + } + if (country_code.equals("IT") == true) { + switch (region_code2) { + case 1: + name = "Abruzzi"; + break; + case 2: + name = "Basilicata"; + break; + case 3: + name = "Calabria"; + break; + case 4: + name = "Campania"; + break; + case 5: + name = "Emilia-Romagna"; + break; + case 6: + name = "Friuli-Venezia Giulia"; + break; + case 7: + name = "Lazio"; + break; + case 8: + name = "Liguria"; + break; + case 9: + name = "Lombardia"; + break; + case 10: + name = "Marche"; + break; + case 11: + name = "Molise"; + break; + case 12: + name = "Piemonte"; + break; + case 13: + name = "Puglia"; + break; + case 14: + name = "Sardegna"; + break; + case 15: + name = "Sicilia"; + break; + case 16: + name = "Toscana"; + break; + case 17: + name = "Trentino-Alto Adige"; + break; + case 18: + name = "Umbria"; + break; + case 19: + name = "Valle d'Aosta"; + break; + case 20: + name = "Veneto"; + break; + } + } + if (country_code.equals("JM") == true) { + switch (region_code2) { + case 1: + name = "Clarendon"; + break; + case 2: + name = "Hanover"; + break; + case 4: + name = "Manchester"; + break; + case 7: + name = "Portland"; + break; + case 8: + name = "Saint Andrew"; + break; + case 9: + name = "Saint Ann"; + break; + case 10: + name = "Saint Catherine"; + break; + case 11: + name = "Saint Elizabeth"; + break; + case 12: + name = "Saint James"; + break; + case 13: + name = "Saint Mary"; + break; + case 14: + name = "Saint Thomas"; + break; + case 15: + name = "Trelawny"; + break; + case 16: + name = "Westmoreland"; + break; + case 17: + name = "Kingston"; + break; + } + } + if (country_code.equals("JO") == true) { + switch (region_code2) { + case 2: + name = "Al Balqa'"; + break; + case 7: + name = "Ma"; + break; + case 9: + name = "Al Karak"; + break; + case 10: + name = "Al Mafraq"; + break; + case 11: + name = "Amman Governorate"; + break; + case 12: + name = "At Tafilah"; + break; + case 13: + name = "Az Zarqa"; + break; + case 14: + name = "Irbid"; + break; + case 16: + name = "Amman"; + break; + } + } + if (country_code.equals("JP") == true) { + switch (region_code2) { + case 1: + name = "Aichi"; + break; + case 2: + name = "Akita"; + break; + case 3: + name = "Aomori"; + break; + case 4: + name = "Chiba"; + break; + case 5: + name = "Ehime"; + break; + case 6: + name = "Fukui"; + break; + case 7: + name = "Fukuoka"; + break; + case 8: + name = "Fukushima"; + break; + case 9: + name = "Gifu"; + break; + case 10: + name = "Gumma"; + break; + case 11: + name = "Hiroshima"; + break; + case 12: + name = "Hokkaido"; + break; + case 13: + name = "Hyogo"; + break; + case 14: + name = "Ibaraki"; + break; + case 15: + name = "Ishikawa"; + break; + case 16: + name = "Iwate"; + break; + case 17: + name = "Kagawa"; + break; + case 18: + name = "Kagoshima"; + break; + case 19: + name = "Kanagawa"; + break; + case 20: + name = "Kochi"; + break; + case 21: + name = "Kumamoto"; + break; + case 22: + name = "Kyoto"; + break; + case 23: + name = "Mie"; + break; + case 24: + name = "Miyagi"; + break; + case 25: + name = "Miyazaki"; + break; + case 26: + name = "Nagano"; + break; + case 27: + name = "Nagasaki"; + break; + case 28: + name = "Nara"; + break; + case 29: + name = "Niigata"; + break; + case 30: + name = "Oita"; + break; + case 31: + name = "Okayama"; + break; + case 32: + name = "Osaka"; + break; + case 33: + name = "Saga"; + break; + case 34: + name = "Saitama"; + break; + case 35: + name = "Shiga"; + break; + case 36: + name = "Shimane"; + break; + case 37: + name = "Shizuoka"; + break; + case 38: + name = "Tochigi"; + break; + case 39: + name = "Tokushima"; + break; + case 40: + name = "Tokyo"; + break; + case 41: + name = "Tottori"; + break; + case 42: + name = "Toyama"; + break; + case 43: + name = "Wakayama"; + break; + case 44: + name = "Yamagata"; + break; + case 45: + name = "Yamaguchi"; + break; + case 46: + name = "Yamanashi"; + break; + case 47: + name = "Okinawa"; + break; + } + } + if (country_code.equals("KE") == true) { + switch (region_code2) { + case 1: + name = "Central"; + break; + case 2: + name = "Coast"; + break; + case 3: + name = "Eastern"; + break; + case 5: + name = "Nairobi Area"; + break; + case 6: + name = "North-Eastern"; + break; + case 7: + name = "Nyanza"; + break; + case 8: + name = "Rift Valley"; + break; + case 9: + name = "Western"; + break; + } + } + if (country_code.equals("KG") == true) { + switch (region_code2) { + case 1: + name = "Bishkek"; + break; + case 2: + name = "Chuy"; + break; + case 3: + name = "Jalal-Abad"; + break; + case 4: + name = "Naryn"; + break; + case 5: + name = "Osh"; + break; + case 6: + name = "Talas"; + break; + case 7: + name = "Ysyk-Kol"; + break; + case 8: + name = "Osh"; + break; + case 9: + name = "Batken"; + break; + } + } + if (country_code.equals("KH") == true) { + switch (region_code2) { + case 1: + name = "Batdambang"; + break; + case 2: + name = "Kampong Cham"; + break; + case 3: + name = "Kampong Chhnang"; + break; + case 4: + name = "Kampong Speu"; + break; + case 5: + name = "Kampong Thum"; + break; + case 6: + name = "Kampot"; + break; + case 7: + name = "Kandal"; + break; + case 8: + name = "Koh Kong"; + break; + case 9: + name = "Kracheh"; + break; + case 10: + name = "Mondulkiri"; + break; + case 11: + name = "Phnum Penh"; + break; + case 12: + name = "Pursat"; + break; + case 13: + name = "Preah Vihear"; + break; + case 14: + name = "Prey Veng"; + break; + case 15: + name = "Ratanakiri Kiri"; + break; + case 16: + name = "Siem Reap"; + break; + case 17: + name = "Stung Treng"; + break; + case 18: + name = "Svay Rieng"; + break; + case 19: + name = "Takeo"; + break; + case 25: + name = "Banteay Meanchey"; + break; + case 29: + name = "Batdambang"; + break; + case 30: + name = "Pailin"; + break; + } + } + if (country_code.equals("KI") == true) { + switch (region_code2) { + case 1: + name = "Gilbert Islands"; + break; + case 2: + name = "Line Islands"; + break; + case 3: + name = "Phoenix Islands"; + break; + } + } + if (country_code.equals("KM") == true) { + switch (region_code2) { + case 1: + name = "Anjouan"; + break; + case 2: + name = "Grande Comore"; + break; + case 3: + name = "Moheli"; + break; + } + } + if (country_code.equals("KN") == true) { + switch (region_code2) { + case 1: + name = "Christ Church Nichola Town"; + break; + case 2: + name = "Saint Anne Sandy Point"; + break; + case 3: + name = "Saint George Basseterre"; + break; + case 4: + name = "Saint George Gingerland"; + break; + case 5: + name = "Saint James Windward"; + break; + case 6: + name = "Saint John Capisterre"; + break; + case 7: + name = "Saint John Figtree"; + break; + case 8: + name = "Saint Mary Cayon"; + break; + case 9: + name = "Saint Paul Capisterre"; + break; + case 10: + name = "Saint Paul Charlestown"; + break; + case 11: + name = "Saint Peter Basseterre"; + break; + case 12: + name = "Saint Thomas Lowland"; + break; + case 13: + name = "Saint Thomas Middle Island"; + break; + case 15: + name = "Trinity Palmetto Point"; + break; + } + } + if (country_code.equals("KP") == true) { + switch (region_code2) { + case 1: + name = "Chagang-do"; + break; + case 3: + name = "Hamgyong-namdo"; + break; + case 6: + name = "Hwanghae-namdo"; + break; + case 7: + name = "Hwanghae-bukto"; + break; + case 8: + name = "Kaesong-si"; + break; + case 9: + name = "Kangwon-do"; + break; + case 11: + name = "P'yongan-bukto"; + break; + case 12: + name = "P'yongyang-si"; + break; + case 13: + name = "Yanggang-do"; + break; + case 14: + name = "Namp'o-si"; + break; + case 15: + name = "P'yongan-namdo"; + break; + case 17: + name = "Hamgyong-bukto"; + break; + case 18: + name = "Najin Sonbong-si"; + break; + } + } + if (country_code.equals("KR") == true) { + switch (region_code2) { + case 1: + name = "Cheju-do"; + break; + case 3: + name = "Cholla-bukto"; + break; + case 5: + name = "Ch'ungch'ong-bukto"; + break; + case 6: + name = "Kangwon-do"; + break; + case 10: + name = "Pusan-jikhalsi"; + break; + case 11: + name = "Seoul-t'ukpyolsi"; + break; + case 12: + name = "Inch'on-jikhalsi"; + break; + case 13: + name = "Kyonggi-do"; + break; + case 14: + name = "Kyongsang-bukto"; + break; + case 15: + name = "Taegu-jikhalsi"; + break; + case 16: + name = "Cholla-namdo"; + break; + case 17: + name = "Ch'ungch'ong-namdo"; + break; + case 18: + name = "Kwangju-jikhalsi"; + break; + case 19: + name = "Taejon-jikhalsi"; + break; + case 20: + name = "Kyongsang-namdo"; + break; + case 21: + name = "Ulsan-gwangyoksi"; + break; + } + } + if (country_code.equals("KW") == true) { + switch (region_code2) { + case 1: + name = "Al Ahmadi"; + break; + case 2: + name = "Al Kuwayt"; + break; + case 5: + name = "Al Jahra"; + break; + case 7: + name = "Al Farwaniyah"; + break; + case 8: + name = "Hawalli"; + break; + case 9: + name = "Mubarak al Kabir"; + break; + } + } + if (country_code.equals("KY") == true) { + switch (region_code2) { + case 1: + name = "Creek"; + break; + case 2: + name = "Eastern"; + break; + case 3: + name = "Midland"; + break; + case 4: + name = "South Town"; + break; + case 5: + name = "Spot Bay"; + break; + case 6: + name = "Stake Bay"; + break; + case 7: + name = "West End"; + break; + case 8: + name = "Western"; + break; + } + } + if (country_code.equals("KZ") == true) { + switch (region_code2) { + case 1: + name = "Almaty"; + break; + case 2: + name = "Almaty City"; + break; + case 3: + name = "Aqmola"; + break; + case 4: + name = "Aqtobe"; + break; + case 5: + name = "Astana"; + break; + case 6: + name = "Atyrau"; + break; + case 7: + name = "West Kazakhstan"; + break; + case 8: + name = "Bayqonyr"; + break; + case 9: + name = "Mangghystau"; + break; + case 10: + name = "South Kazakhstan"; + break; + case 11: + name = "Pavlodar"; + break; + case 12: + name = "Qaraghandy"; + break; + case 13: + name = "Qostanay"; + break; + case 14: + name = "Qyzylorda"; + break; + case 15: + name = "East Kazakhstan"; + break; + case 16: + name = "North Kazakhstan"; + break; + case 17: + name = "Zhambyl"; + break; + } + } + if (country_code.equals("LA") == true) { + switch (region_code2) { + case 1: + name = "Attapu"; + break; + case 2: + name = "Champasak"; + break; + case 3: + name = "Houaphan"; + break; + case 4: + name = "Khammouan"; + break; + case 5: + name = "Louang Namtha"; + break; + case 7: + name = "Oudomxai"; + break; + case 8: + name = "Phongsali"; + break; + case 9: + name = "Saravan"; + break; + case 10: + name = "Savannakhet"; + break; + case 11: + name = "Vientiane"; + break; + case 13: + name = "Xaignabouri"; + break; + case 14: + name = "Xiangkhoang"; + break; + case 17: + name = "Louangphrabang"; + break; + } + } + if (country_code.equals("LB") == true) { + switch (region_code2) { + case 1: + name = "Beqaa"; + break; + case 2: + name = "Al Janub"; + break; + case 3: + name = "Liban-Nord"; + break; + case 4: + name = "Beyrouth"; + break; + case 5: + name = "Mont-Liban"; + break; + case 6: + name = "Liban-Sud"; + break; + case 7: + name = "Nabatiye"; + break; + case 8: + name = "Beqaa"; + break; + case 9: + name = "Liban-Nord"; + break; + case 10: + name = "Aakk"; + break; + case 11: + name = "Baalbek-Hermel"; + break; + } + } + if (country_code.equals("LC") == true) { + switch (region_code2) { + case 1: + name = "Anse-la-Raye"; + break; + case 2: + name = "Dauphin"; + break; + case 3: + name = "Castries"; + break; + case 4: + name = "Choiseul"; + break; + case 5: + name = "Dennery"; + break; + case 6: + name = "Gros-Islet"; + break; + case 7: + name = "Laborie"; + break; + case 8: + name = "Micoud"; + break; + case 9: + name = "Soufriere"; + break; + case 10: + name = "Vieux-Fort"; + break; + case 11: + name = "Praslin"; + break; + } + } + if (country_code.equals("LI") == true) { + switch (region_code2) { + case 1: + name = "Balzers"; + break; + case 2: + name = "Eschen"; + break; + case 3: + name = "Gamprin"; + break; + case 4: + name = "Mauren"; + break; + case 5: + name = "Planken"; + break; + case 6: + name = "Ruggell"; + break; + case 7: + name = "Schaan"; + break; + case 8: + name = "Schellenberg"; + break; + case 9: + name = "Triesen"; + break; + case 10: + name = "Triesenberg"; + break; + case 11: + name = "Vaduz"; + break; + case 21: + name = "Gbarpolu"; + break; + case 22: + name = "River Gee"; + break; + } + } + if (country_code.equals("LK") == true) { + switch (region_code2) { + case 1: + name = "Amparai"; + break; + case 2: + name = "Anuradhapura"; + break; + case 3: + name = "Badulla"; + break; + case 4: + name = "Batticaloa"; + break; + case 6: + name = "Galle"; + break; + case 7: + name = "Hambantota"; + break; + case 9: + name = "Kalutara"; + break; + case 10: + name = "Kandy"; + break; + case 11: + name = "Kegalla"; + break; + case 12: + name = "Kurunegala"; + break; + case 14: + name = "Matale"; + break; + case 15: + name = "Matara"; + break; + case 16: + name = "Moneragala"; + break; + case 17: + name = "Nuwara Eliya"; + break; + case 18: + name = "Polonnaruwa"; + break; + case 19: + name = "Puttalam"; + break; + case 20: + name = "Ratnapura"; + break; + case 21: + name = "Trincomalee"; + break; + case 23: + name = "Colombo"; + break; + case 24: + name = "Gampaha"; + break; + case 25: + name = "Jaffna"; + break; + case 26: + name = "Mannar"; + break; + case 27: + name = "Mullaittivu"; + break; + case 28: + name = "Vavuniya"; + break; + case 29: + name = "Central"; + break; + case 30: + name = "North Central"; + break; + case 31: + name = "Northern"; + break; + case 32: + name = "North Western"; + break; + case 33: + name = "Sabaragamuwa"; + break; + case 34: + name = "Southern"; + break; + case 35: + name = "Uva"; + break; + case 36: + name = "Western"; + break; + } + } + if (country_code.equals("LR") == true) { + switch (region_code2) { + case 1: + name = "Bong"; + break; + case 4: + name = "Grand Cape Mount"; + break; + case 5: + name = "Lofa"; + break; + case 6: + name = "Maryland"; + break; + case 7: + name = "Monrovia"; + break; + case 9: + name = "Nimba"; + break; + case 10: + name = "Sino"; + break; + case 11: + name = "Grand Bassa"; + break; + case 12: + name = "Grand Cape Mount"; + break; + case 13: + name = "Maryland"; + break; + case 14: + name = "Montserrado"; + break; + case 17: + name = "Margibi"; + break; + case 18: + name = "River Cess"; + break; + case 19: + name = "Grand Gedeh"; + break; + case 20: + name = "Lofa"; + break; + case 21: + name = "Gbarpolu"; + break; + case 22: + name = "River Gee"; + break; + } + } + if (country_code.equals("LS") == true) { + switch (region_code2) { + case 10: + name = "Berea"; + break; + case 11: + name = "Butha-Buthe"; + break; + case 12: + name = "Leribe"; + break; + case 13: + name = "Mafeteng"; + break; + case 14: + name = "Maseru"; + break; + case 15: + name = "Mohales Hoek"; + break; + case 16: + name = "Mokhotlong"; + break; + case 17: + name = "Qachas Nek"; + break; + case 18: + name = "Quthing"; + break; + case 19: + name = "Thaba-Tseka"; + break; + } + } + if (country_code.equals("LT") == true) { + switch (region_code2) { + case 56: + name = "Alytaus Apskritis"; + break; + case 57: + name = "Kauno Apskritis"; + break; + case 58: + name = "Klaipedos Apskritis"; + break; + case 59: + name = "Marijampoles Apskritis"; + break; + case 60: + name = "Panevezio Apskritis"; + break; + case 61: + name = "Siauliu Apskritis"; + break; + case 62: + name = "Taurages Apskritis"; + break; + case 63: + name = "Telsiu Apskritis"; + break; + case 64: + name = "Utenos Apskritis"; + break; + case 65: + name = "Vilniaus Apskritis"; + break; + } + } + if (country_code.equals("LU") == true) { + switch (region_code2) { + case 1: + name = "Diekirch"; + break; + case 2: + name = "Grevenmacher"; + break; + case 3: + name = "Luxembourg"; + break; + } + } + if (country_code.equals("LV") == true) { + switch (region_code2) { + case 1: + name = "Aizkraukles"; + break; + case 2: + name = "Aluksnes"; + break; + case 3: + name = "Balvu"; + break; + case 4: + name = "Bauskas"; + break; + case 5: + name = "Cesu"; + break; + case 6: + name = "Daugavpils"; + break; + case 7: + name = "Daugavpils"; + break; + case 8: + name = "Dobeles"; + break; + case 9: + name = "Gulbenes"; + break; + case 10: + name = "Jekabpils"; + break; + case 11: + name = "Jelgava"; + break; + case 12: + name = "Jelgavas"; + break; + case 13: + name = "Jurmala"; + break; + case 14: + name = "Kraslavas"; + break; + case 15: + name = "Kuldigas"; + break; + case 16: + name = "Liepaja"; + break; + case 17: + name = "Liepajas"; + break; + case 18: + name = "Limbazu"; + break; + case 19: + name = "Ludzas"; + break; + case 20: + name = "Madonas"; + break; + case 21: + name = "Ogres"; + break; + case 22: + name = "Preilu"; + break; + case 23: + name = "Rezekne"; + break; + case 24: + name = "Rezeknes"; + break; + case 25: + name = "Riga"; + break; + case 26: + name = "Rigas"; + break; + case 27: + name = "Saldus"; + break; + case 28: + name = "Talsu"; + break; + case 29: + name = "Tukuma"; + break; + case 30: + name = "Valkas"; + break; + case 31: + name = "Valmieras"; + break; + case 32: + name = "Ventspils"; + break; + case 33: + name = "Ventspils"; + break; + } + } + if (country_code.equals("LY") == true) { + switch (region_code2) { + case 3: + name = "Al Aziziyah"; + break; + case 5: + name = "Al Jufrah"; + break; + case 8: + name = "Al Kufrah"; + break; + case 13: + name = "Ash Shati'"; + break; + case 30: + name = "Murzuq"; + break; + case 34: + name = "Sabha"; + break; + case 41: + name = "Tarhunah"; + break; + case 42: + name = "Tubruq"; + break; + case 45: + name = "Zlitan"; + break; + case 47: + name = "Ajdabiya"; + break; + case 48: + name = "Al Fatih"; + break; + case 49: + name = "Al Jabal al Akhdar"; + break; + case 50: + name = "Al Khums"; + break; + case 51: + name = "An Nuqat al Khams"; + break; + case 52: + name = "Awbari"; + break; + case 53: + name = "Az Zawiyah"; + break; + case 54: + name = "Banghazi"; + break; + case 55: + name = "Darnah"; + break; + case 56: + name = "Ghadamis"; + break; + case 57: + name = "Gharyan"; + break; + case 58: + name = "Misratah"; + break; + case 59: + name = "Sawfajjin"; + break; + case 60: + name = "Surt"; + break; + case 61: + name = "Tarabulus"; + break; + case 62: + name = "Yafran"; + break; + } + } + if (country_code.equals("MA") == true) { + switch (region_code2) { + case 1: + name = "Agadir"; + break; + case 2: + name = "Al Hoceima"; + break; + case 3: + name = "Azilal"; + break; + case 4: + name = "Ben Slimane"; + break; + case 5: + name = "Beni Mellal"; + break; + case 6: + name = "Boulemane"; + break; + case 7: + name = "Casablanca"; + break; + case 8: + name = "Chaouen"; + break; + case 9: + name = "El Jadida"; + break; + case 10: + name = "El Kelaa des Srarhna"; + break; + case 11: + name = "Er Rachidia"; + break; + case 12: + name = "Essaouira"; + break; + case 13: + name = "Fes"; + break; + case 14: + name = "Figuig"; + break; + case 15: + name = "Kenitra"; + break; + case 16: + name = "Khemisset"; + break; + case 17: + name = "Khenifra"; + break; + case 18: + name = "Khouribga"; + break; + case 19: + name = "Marrakech"; + break; + case 20: + name = "Meknes"; + break; + case 21: + name = "Nador"; + break; + case 22: + name = "Ouarzazate"; + break; + case 23: + name = "Oujda"; + break; + case 24: + name = "Rabat-Sale"; + break; + case 25: + name = "Safi"; + break; + case 26: + name = "Settat"; + break; + case 27: + name = "Tanger"; + break; + case 29: + name = "Tata"; + break; + case 30: + name = "Taza"; + break; + case 32: + name = "Tiznit"; + break; + case 33: + name = "Guelmim"; + break; + case 34: + name = "Ifrane"; + break; + case 35: + name = "Laayoune"; + break; + case 36: + name = "Tan-Tan"; + break; + case 37: + name = "Taounate"; + break; + case 38: + name = "Sidi Kacem"; + break; + case 39: + name = "Taroudannt"; + break; + case 40: + name = "Tetouan"; + break; + case 41: + name = "Larache"; + break; + case 45: + name = "Grand Casablanca"; + break; + case 46: + name = "Fes-Boulemane"; + break; + case 47: + name = "Marrakech-Tensift-Al Haouz"; + break; + case 48: + name = "Meknes-Tafilalet"; + break; + case 49: + name = "Rabat-Sale-Zemmour-Zaer"; + break; + case 50: + name = "Chaouia-Ouardigha"; + break; + case 51: + name = "Doukkala-Abda"; + break; + case 52: + name = "Gharb-Chrarda-Beni Hssen"; + break; + case 53: + name = "Guelmim-Es Smara"; + break; + case 54: + name = "Oriental"; + break; + case 55: + name = "Souss-Massa-Dr"; + break; + case 56: + name = "Tadla-Azilal"; + break; + case 57: + name = "Tanger-Tetouan"; + break; + case 58: + name = "Taza-Al Hoceima-Taounate"; + break; + case 59: + name = "La"; + break; + } + } + if (country_code.equals("MC") == true) { + switch (region_code2) { + case 1: + name = "La Condamine"; + break; + case 2: + name = "Monaco"; + break; + case 3: + name = "Monte-Carlo"; + break; + } + } + if (country_code.equals("MD") == true) { + switch (region_code2) { + case 46: + name = "Balti"; + break; + case 47: + name = "Cahul"; + break; + case 48: + name = "Chisinau"; + break; + case 49: + name = "Stinga Nistrului"; + break; + case 50: + name = "Edinet"; + break; + case 51: + name = "Gagauzia"; + break; + case 52: + name = "Lapusna"; + break; + case 53: + name = "Orhei"; + break; + case 54: + name = "Soroca"; + break; + case 55: + name = "Tighina"; + break; + case 56: + name = "Ungheni"; + break; + case 58: + name = "Stinga Nistrului"; + break; + case 59: + name = "Anenii Noi"; + break; + case 60: + name = "Balti"; + break; + case 61: + name = "Basarabeasca"; + break; + case 62: + name = "Bender"; + break; + case 63: + name = "Briceni"; + break; + case 64: + name = "Cahul"; + break; + case 65: + name = "Cantemir"; + break; + case 66: + name = "Calarasi"; + break; + case 67: + name = "Causeni"; + break; + case 68: + name = "Cimislia"; + break; + case 69: + name = "Criuleni"; + break; + case 70: + name = "Donduseni"; + break; + case 71: + name = "Drochia"; + break; + case 72: + name = "Dubasari"; + break; + case 73: + name = "Edinet"; + break; + case 74: + name = "Falesti"; + break; + case 75: + name = "Floresti"; + break; + case 76: + name = "Glodeni"; + break; + case 77: + name = "Hincesti"; + break; + case 78: + name = "Ialoveni"; + break; + case 79: + name = "Leova"; + break; + case 80: + name = "Nisporeni"; + break; + case 81: + name = "Ocnita"; + break; + case 83: + name = "Rezina"; + break; + case 84: + name = "Riscani"; + break; + case 85: + name = "Singerei"; + break; + case 86: + name = "Soldanesti"; + break; + case 87: + name = "Soroca"; + break; + case 88: + name = "Stefan-Voda"; + break; + case 89: + name = "Straseni"; + break; + case 90: + name = "Taraclia"; + break; + case 91: + name = "Telenesti"; + break; + case 92: + name = "Ungheni"; + break; + } + } + if (country_code.equals("MG") == true) { + switch (region_code2) { + case 1: + name = "Antsiranana"; + break; + case 2: + name = "Fianarantsoa"; + break; + case 3: + name = "Mahajanga"; + break; + case 4: + name = "Toamasina"; + break; + case 5: + name = "Antananarivo"; + break; + case 6: + name = "Toliara"; + break; + } + } + if (country_code.equals("MK") == true) { + switch (region_code2) { + case 1: + name = "Aracinovo"; + break; + case 2: + name = "Bac"; + break; + case 3: + name = "Belcista"; + break; + case 4: + name = "Berovo"; + break; + case 5: + name = "Bistrica"; + break; + case 6: + name = "Bitola"; + break; + case 7: + name = "Blatec"; + break; + case 8: + name = "Bogdanci"; + break; + case 9: + name = "Bogomila"; + break; + case 10: + name = "Bogovinje"; + break; + case 11: + name = "Bosilovo"; + break; + case 12: + name = "Brvenica"; + break; + case 13: + name = "Cair"; + break; + case 14: + name = "Capari"; + break; + case 15: + name = "Caska"; + break; + case 16: + name = "Cegrane"; + break; + case 17: + name = "Centar"; + break; + case 18: + name = "Centar Zupa"; + break; + case 19: + name = "Cesinovo"; + break; + case 20: + name = "Cucer-Sandevo"; + break; + case 21: + name = "Debar"; + break; + case 22: + name = "Delcevo"; + break; + case 23: + name = "Delogozdi"; + break; + case 24: + name = "Demir Hisar"; + break; + case 25: + name = "Demir Kapija"; + break; + case 26: + name = "Dobrusevo"; + break; + case 27: + name = "Dolna Banjica"; + break; + case 28: + name = "Dolneni"; + break; + case 29: + name = "Dorce Petrov"; + break; + case 30: + name = "Drugovo"; + break; + case 31: + name = "Dzepciste"; + break; + case 32: + name = "Gazi Baba"; + break; + case 33: + name = "Gevgelija"; + break; + case 34: + name = "Gostivar"; + break; + case 35: + name = "Gradsko"; + break; + case 36: + name = "Ilinden"; + break; + case 37: + name = "Izvor"; + break; + case 38: + name = "Jegunovce"; + break; + case 39: + name = "Kamenjane"; + break; + case 40: + name = "Karbinci"; + break; + case 41: + name = "Karpos"; + break; + case 42: + name = "Kavadarci"; + break; + case 43: + name = "Kicevo"; + break; + case 44: + name = "Kisela Voda"; + break; + case 45: + name = "Klecevce"; + break; + case 46: + name = "Kocani"; + break; + case 47: + name = "Konce"; + break; + case 48: + name = "Kondovo"; + break; + case 49: + name = "Konopiste"; + break; + case 50: + name = "Kosel"; + break; + case 51: + name = "Kratovo"; + break; + case 52: + name = "Kriva Palanka"; + break; + case 53: + name = "Krivogastani"; + break; + case 54: + name = "Krusevo"; + break; + case 55: + name = "Kuklis"; + break; + case 56: + name = "Kukurecani"; + break; + case 57: + name = "Kumanovo"; + break; + case 58: + name = "Labunista"; + break; + case 59: + name = "Lipkovo"; + break; + case 60: + name = "Lozovo"; + break; + case 61: + name = "Lukovo"; + break; + case 62: + name = "Makedonska Kamenica"; + break; + case 63: + name = "Makedonski Brod"; + break; + case 64: + name = "Mavrovi Anovi"; + break; + case 65: + name = "Meseista"; + break; + case 66: + name = "Miravci"; + break; + case 67: + name = "Mogila"; + break; + case 68: + name = "Murtino"; + break; + case 69: + name = "Negotino"; + break; + case 70: + name = "Negotino-Polosko"; + break; + case 71: + name = "Novaci"; + break; + case 72: + name = "Novo Selo"; + break; + case 73: + name = "Oblesevo"; + break; + case 74: + name = "Ohrid"; + break; + case 75: + name = "Orasac"; + break; + case 76: + name = "Orizari"; + break; + case 77: + name = "Oslomej"; + break; + case 78: + name = "Pehcevo"; + break; + case 79: + name = "Petrovec"; + break; + case 80: + name = "Plasnica"; + break; + case 81: + name = "Podares"; + break; + case 82: + name = "Prilep"; + break; + case 83: + name = "Probistip"; + break; + case 84: + name = "Radovis"; + break; + case 85: + name = "Rankovce"; + break; + case 86: + name = "Resen"; + break; + case 87: + name = "Rosoman"; + break; + case 88: + name = "Rostusa"; + break; + case 89: + name = "Samokov"; + break; + case 90: + name = "Saraj"; + break; + case 91: + name = "Sipkovica"; + break; + case 92: + name = "Sopiste"; + break; + case 93: + name = "Sopotnica"; + break; + case 94: + name = "Srbinovo"; + break; + case 95: + name = "Staravina"; + break; + case 96: + name = "Star Dojran"; + break; + case 97: + name = "Staro Nagoricane"; + break; + case 98: + name = "Stip"; + break; + case 99: + name = "Struga"; + break; + case 832: + name = "Strumica"; + break; + case 833: + name = "Studenicani"; + break; + case 834: + name = "Suto Orizari"; + break; + case 835: + name = "Sveti Nikole"; + break; + case 836: + name = "Tearce"; + break; + case 837: + name = "Tetovo"; + break; + case 838: + name = "Topolcani"; + break; + case 839: + name = "Valandovo"; + break; + case 840: + name = "Vasilevo"; + break; + case 875: + name = "Veles"; + break; + case 876: + name = "Velesta"; + break; + case 877: + name = "Vevcani"; + break; + case 878: + name = "Vinica"; + break; + case 879: + name = "Vitoliste"; + break; + case 880: + name = "Vranestica"; + break; + case 881: + name = "Vrapciste"; + break; + case 882: + name = "Vratnica"; + break; + case 883: + name = "Vrutok"; + break; + case 918: + name = "Zajas"; + break; + case 919: + name = "Zelenikovo"; + break; + case 920: + name = "Zelino"; + break; + case 921: + name = "Zitose"; + break; + case 922: + name = "Zletovo"; + break; + case 923: + name = "Zrnovci"; + break; + } + } + if (country_code.equals("ML") == true) { + switch (region_code2) { + case 1: + name = "Bamako"; + break; + case 3: + name = "Kayes"; + break; + case 4: + name = "Mopti"; + break; + case 5: + name = "Segou"; + break; + case 6: + name = "Sikasso"; + break; + case 7: + name = "Koulikoro"; + break; + case 8: + name = "Tombouctou"; + break; + case 9: + name = "Gao"; + break; + case 10: + name = "Kidal"; + break; + } + } + if (country_code.equals("MM") == true) { + switch (region_code2) { + case 1: + name = "Rakhine State"; + break; + case 2: + name = "Chin State"; + break; + case 3: + name = "Irrawaddy"; + break; + case 4: + name = "Kachin State"; + break; + case 5: + name = "Karan State"; + break; + case 6: + name = "Kayah State"; + break; + case 7: + name = "Magwe"; + break; + case 8: + name = "Mandalay"; + break; + case 9: + name = "Pegu"; + break; + case 10: + name = "Sagaing"; + break; + case 11: + name = "Shan State"; + break; + case 12: + name = "Tenasserim"; + break; + case 13: + name = "Mon State"; + break; + case 14: + name = "Rangoon"; + break; + case 17: + name = "Yangon"; + break; + } + } + if (country_code.equals("MN") == true) { + switch (region_code2) { + case 1: + name = "Arhangay"; + break; + case 2: + name = "Bayanhongor"; + break; + case 3: + name = "Bayan-Olgiy"; + break; + case 5: + name = "Darhan"; + break; + case 6: + name = "Dornod"; + break; + case 7: + name = "Dornogovi"; + break; + case 8: + name = "Dundgovi"; + break; + case 9: + name = "Dzavhan"; + break; + case 10: + name = "Govi-Altay"; + break; + case 11: + name = "Hentiy"; + break; + case 12: + name = "Hovd"; + break; + case 13: + name = "Hovsgol"; + break; + case 14: + name = "Omnogovi"; + break; + case 15: + name = "Ovorhangay"; + break; + case 16: + name = "Selenge"; + break; + case 17: + name = "Suhbaatar"; + break; + case 18: + name = "Tov"; + break; + case 19: + name = "Uvs"; + break; + case 20: + name = "Ulaanbaatar"; + break; + case 21: + name = "Bulgan"; + break; + case 22: + name = "Erdenet"; + break; + case 23: + name = "Darhan-Uul"; + break; + case 24: + name = "Govisumber"; + break; + case 25: + name = "Orhon"; + break; + } + } + if (country_code.equals("MO") == true) { + switch (region_code2) { + case 1: + name = "Ilhas"; + break; + case 2: + name = "Macau"; + break; + } + } + if (country_code.equals("MR") == true) { + switch (region_code2) { + case 1: + name = "Hodh Ech Chargui"; + break; + case 2: + name = "Hodh El Gharbi"; + break; + case 3: + name = "Assaba"; + break; + case 4: + name = "Gorgol"; + break; + case 5: + name = "Brakna"; + break; + case 6: + name = "Trarza"; + break; + case 7: + name = "Adrar"; + break; + case 8: + name = "Dakhlet Nouadhibou"; + break; + case 9: + name = "Tagant"; + break; + case 10: + name = "Guidimaka"; + break; + case 11: + name = "Tiris Zemmour"; + break; + case 12: + name = "Inchiri"; + break; + } + } + if (country_code.equals("MS") == true) { + switch (region_code2) { + case 1: + name = "Saint Anthony"; + break; + case 2: + name = "Saint Georges"; + break; + case 3: + name = "Saint Peter"; + break; + } + } + if (country_code.equals("MU") == true) { + switch (region_code2) { + case 12: + name = "Black River"; + break; + case 13: + name = "Flacq"; + break; + case 14: + name = "Grand Port"; + break; + case 15: + name = "Moka"; + break; + case 16: + name = "Pamplemousses"; + break; + case 17: + name = "Plaines Wilhems"; + break; + case 18: + name = "Port Louis"; + break; + case 19: + name = "Riviere du Rempart"; + break; + case 20: + name = "Savanne"; + break; + case 21: + name = "Agalega Islands"; + break; + case 22: + name = "Cargados Carajos"; + break; + case 23: + name = "Rodrigues"; + break; + } + } + if (country_code.equals("MV") == true) { + switch (region_code2) { + case 1: + name = "Seenu"; + break; + case 2: + name = "Aliff"; + break; + case 3: + name = "Laviyani"; + break; + case 4: + name = "Waavu"; + break; + case 5: + name = "Laamu"; + break; + case 7: + name = "Haa Aliff"; + break; + case 8: + name = "Thaa"; + break; + case 12: + name = "Meemu"; + break; + case 13: + name = "Raa"; + break; + case 14: + name = "Faafu"; + break; + case 17: + name = "Daalu"; + break; + case 20: + name = "Baa"; + break; + case 23: + name = "Haa Daalu"; + break; + case 24: + name = "Shaviyani"; + break; + case 25: + name = "Noonu"; + break; + case 26: + name = "Kaafu"; + break; + case 27: + name = "Gaafu Aliff"; + break; + case 28: + name = "Gaafu Daalu"; + break; + case 29: + name = "Naviyani"; + break; + case 40: + name = "Male"; + break; + } + } + if (country_code.equals("MW") == true) { + switch (region_code2) { + case 2: + name = "Chikwawa"; + break; + case 3: + name = "Chiradzulu"; + break; + case 4: + name = "Chitipa"; + break; + case 5: + name = "Thyolo"; + break; + case 6: + name = "Dedza"; + break; + case 7: + name = "Dowa"; + break; + case 8: + name = "Karonga"; + break; + case 9: + name = "Kasungu"; + break; + case 11: + name = "Lilongwe"; + break; + case 12: + name = "Mangochi"; + break; + case 13: + name = "Mchinji"; + break; + case 15: + name = "Mzimba"; + break; + case 16: + name = "Ntcheu"; + break; + case 17: + name = "Nkhata Bay"; + break; + case 18: + name = "Nkhotakota"; + break; + case 19: + name = "Nsanje"; + break; + case 20: + name = "Ntchisi"; + break; + case 21: + name = "Rumphi"; + break; + case 22: + name = "Salima"; + break; + case 23: + name = "Zomba"; + break; + case 24: + name = "Blantyre"; + break; + case 25: + name = "Mwanza"; + break; + case 26: + name = "Balaka"; + break; + case 27: + name = "Likoma"; + break; + case 28: + name = "Machinga"; + break; + case 29: + name = "Mulanje"; + break; + case 30: + name = "Phalombe"; + break; + } + } + if (country_code.equals("MX") == true) { + switch (region_code2) { + case 1: + name = "Aguascalientes"; + break; + case 2: + name = "Baja California"; + break; + case 3: + name = "Baja California Sur"; + break; + case 4: + name = "Campeche"; + break; + case 5: + name = "Chiapas"; + break; + case 6: + name = "Chihuahua"; + break; + case 7: + name = "Coahuila de Zaragoza"; + break; + case 8: + name = "Colima"; + break; + case 9: + name = "Distrito Federal"; + break; + case 10: + name = "Durango"; + break; + case 11: + name = "Guanajuato"; + break; + case 12: + name = "Guerrero"; + break; + case 13: + name = "Hidalgo"; + break; + case 14: + name = "Jalisco"; + break; + case 15: + name = "Mexico"; + break; + case 16: + name = "Michoacan de Ocampo"; + break; + case 17: + name = "Morelos"; + break; + case 18: + name = "Nayarit"; + break; + case 19: + name = "Nuevo Leon"; + break; + case 20: + name = "Oaxaca"; + break; + case 21: + name = "Puebla"; + break; + case 22: + name = "Queretaro de Arteaga"; + break; + case 23: + name = "Quintana Roo"; + break; + case 24: + name = "San Luis Potosi"; + break; + case 25: + name = "Sinaloa"; + break; + case 26: + name = "Sonora"; + break; + case 27: + name = "Tabasco"; + break; + case 28: + name = "Tamaulipas"; + break; + case 29: + name = "Tlaxcala"; + break; + case 30: + name = "Veracruz-Llave"; + break; + case 31: + name = "Yucatan"; + break; + case 32: + name = "Zacatecas"; + break; + } + } + if (country_code.equals("MY") == true) { + switch (region_code2) { + case 1: + name = "Johor"; + break; + case 2: + name = "Kedah"; + break; + case 3: + name = "Kelantan"; + break; + case 4: + name = "Melaka"; + break; + case 5: + name = "Negeri Sembilan"; + break; + case 6: + name = "Pahang"; + break; + case 7: + name = "Perak"; + break; + case 8: + name = "Perlis"; + break; + case 9: + name = "Pulau Pinang"; + break; + case 11: + name = "Sarawak"; + break; + case 12: + name = "Selangor"; + break; + case 13: + name = "Terengganu"; + break; + case 14: + name = "Kuala Lumpur"; + break; + case 15: + name = "Labuan"; + break; + case 16: + name = "Sabah"; + break; + case 17: + name = "Putrajaya"; + break; + } + } + if (country_code.equals("MZ") == true) { + switch (region_code2) { + case 1: + name = "Cabo Delgado"; + break; + case 2: + name = "Gaza"; + break; + case 3: + name = "Inhambane"; + break; + case 4: + name = "Maputo"; + break; + case 5: + name = "Sofala"; + break; + case 6: + name = "Nampula"; + break; + case 7: + name = "Niassa"; + break; + case 8: + name = "Tete"; + break; + case 9: + name = "Zambezia"; + break; + case 10: + name = "Manica"; + break; + case 11: + name = "Maputo"; + break; + } + } + if (country_code.equals("NA") == true) { + switch (region_code2) { + case 1: + name = "Bethanien"; + break; + case 2: + name = "Caprivi Oos"; + break; + case 3: + name = "Boesmanland"; + break; + case 4: + name = "Gobabis"; + break; + case 5: + name = "Grootfontein"; + break; + case 6: + name = "Kaokoland"; + break; + case 7: + name = "Karibib"; + break; + case 8: + name = "Keetmanshoop"; + break; + case 9: + name = "Luderitz"; + break; + case 10: + name = "Maltahohe"; + break; + case 11: + name = "Okahandja"; + break; + case 12: + name = "Omaruru"; + break; + case 13: + name = "Otjiwarongo"; + break; + case 14: + name = "Outjo"; + break; + case 15: + name = "Owambo"; + break; + case 16: + name = "Rehoboth"; + break; + case 17: + name = "Swakopmund"; + break; + case 18: + name = "Tsumeb"; + break; + case 20: + name = "Karasburg"; + break; + case 21: + name = "Windhoek"; + break; + case 22: + name = "Damaraland"; + break; + case 23: + name = "Hereroland Oos"; + break; + case 24: + name = "Hereroland Wes"; + break; + case 25: + name = "Kavango"; + break; + case 26: + name = "Mariental"; + break; + case 27: + name = "Namaland"; + break; + case 28: + name = "Caprivi"; + break; + case 29: + name = "Erongo"; + break; + case 30: + name = "Hardap"; + break; + case 31: + name = "Karas"; + break; + case 32: + name = "Kunene"; + break; + case 33: + name = "Ohangwena"; + break; + case 34: + name = "Okavango"; + break; + case 35: + name = "Omaheke"; + break; + case 36: + name = "Omusati"; + break; + case 37: + name = "Oshana"; + break; + case 38: + name = "Oshikoto"; + break; + case 39: + name = "Otjozondjupa"; + break; + } + } + if (country_code.equals("NE") == true) { + switch (region_code2) { + case 1: + name = "Agadez"; + break; + case 2: + name = "Diffa"; + break; + case 3: + name = "Dosso"; + break; + case 4: + name = "Maradi"; + break; + case 5: + name = "Niamey"; + break; + case 6: + name = "Tahoua"; + break; + case 7: + name = "Zinder"; + break; + case 8: + name = "Niamey"; + break; + } + } + if (country_code.equals("NG") == true) { + switch (region_code2) { + case 5: + name = "Lagos"; + break; + case 10: + name = "Rivers"; + break; + case 11: + name = "Federal Capital Territory"; + break; + case 12: + name = "Gongola"; + break; + case 16: + name = "Ogun"; + break; + case 17: + name = "Ondo"; + break; + case 18: + name = "Oyo"; + break; + case 21: + name = "Akwa Ibom"; + break; + case 22: + name = "Cross River"; + break; + case 23: + name = "Kaduna"; + break; + case 24: + name = "Katsina"; + break; + case 25: + name = "Anambra"; + break; + case 26: + name = "Benue"; + break; + case 27: + name = "Borno"; + break; + case 28: + name = "Imo"; + break; + case 29: + name = "Kano"; + break; + case 30: + name = "Kwara"; + break; + case 31: + name = "Niger"; + break; + case 32: + name = "Oyo"; + break; + case 35: + name = "Adamawa"; + break; + case 36: + name = "Delta"; + break; + case 37: + name = "Edo"; + break; + case 39: + name = "Jigawa"; + break; + case 40: + name = "Kebbi"; + break; + case 41: + name = "Kogi"; + break; + case 42: + name = "Osun"; + break; + case 43: + name = "Taraba"; + break; + case 44: + name = "Yobe"; + break; + case 45: + name = "Abia"; + break; + case 46: + name = "Bauchi"; + break; + case 47: + name = "Enugu"; + break; + case 48: + name = "Ondo"; + break; + case 49: + name = "Plateau"; + break; + case 50: + name = "Rivers"; + break; + case 51: + name = "Sokoto"; + break; + case 52: + name = "Bayelsa"; + break; + case 53: + name = "Ebonyi"; + break; + case 54: + name = "Ekiti"; + break; + case 55: + name = "Gombe"; + break; + case 56: + name = "Nassarawa"; + break; + case 57: + name = "Zamfara"; + break; + } + } + if (country_code.equals("NI") == true) { + switch (region_code2) { + case 1: + name = "Boaco"; + break; + case 2: + name = "Carazo"; + break; + case 3: + name = "Chinandega"; + break; + case 4: + name = "Chontales"; + break; + case 5: + name = "Esteli"; + break; + case 6: + name = "Granada"; + break; + case 7: + name = "Jinotega"; + break; + case 8: + name = "Leon"; + break; + case 9: + name = "Madriz"; + break; + case 10: + name = "Managua"; + break; + case 11: + name = "Masaya"; + break; + case 12: + name = "Matagalpa"; + break; + case 13: + name = "Nueva Segovia"; + break; + case 14: + name = "Rio San Juan"; + break; + case 15: + name = "Rivas"; + break; + case 16: + name = "Zelaya"; + break; + case 17: + name = "Autonoma Atlantico Norte"; + break; + case 18: + name = "Region Autonoma Atlantico Sur"; + break; + } + } + if (country_code.equals("NL") == true) { + switch (region_code2) { + case 1: + name = "Drenthe"; + break; + case 2: + name = "Friesland"; + break; + case 3: + name = "Gelderland"; + break; + case 4: + name = "Groningen"; + break; + case 5: + name = "Limburg"; + break; + case 6: + name = "Noord-Brabant"; + break; + case 7: + name = "Noord-Holland"; + break; + case 8: + name = "Overijssel"; + break; + case 9: + name = "Utrecht"; + break; + case 10: + name = "Zeeland"; + break; + case 11: + name = "Zuid-Holland"; + break; + case 12: + name = "Dronten"; + break; + case 13: + name = "Zuidelijke IJsselmeerpolders"; + break; + case 14: + name = "Lelystad"; + break; + case 15: + name = "Overijssel"; + break; + case 16: + name = "Flevoland"; + break; + } + } + if (country_code.equals("NO") == true) { + switch (region_code2) { + case 1: + name = "Akershus"; + break; + case 2: + name = "Aust-Agder"; + break; + case 4: + name = "Buskerud"; + break; + case 5: + name = "Finnmark"; + break; + case 6: + name = "Hedmark"; + break; + case 7: + name = "Hordaland"; + break; + case 8: + name = "More og Romsdal"; + break; + case 9: + name = "Nordland"; + break; + case 10: + name = "Nord-Trondelag"; + break; + case 11: + name = "Oppland"; + break; + case 12: + name = "Oslo"; + break; + case 13: + name = "Ostfold"; + break; + case 14: + name = "Rogaland"; + break; + case 15: + name = "Sogn og Fjordane"; + break; + case 16: + name = "Sor-Trondelag"; + break; + case 17: + name = "Telemark"; + break; + case 18: + name = "Troms"; + break; + case 19: + name = "Vest-Agder"; + break; + case 20: + name = "Vestfold"; + break; + } + } + if (country_code.equals("NP") == true) { + switch (region_code2) { + case 1: + name = "Bagmati"; + break; + case 2: + name = "Bheri"; + break; + case 3: + name = "Dhawalagiri"; + break; + case 4: + name = "Gandaki"; + break; + case 5: + name = "Janakpur"; + break; + case 6: + name = "Karnali"; + break; + case 7: + name = "Kosi"; + break; + case 8: + name = "Lumbini"; + break; + case 9: + name = "Mahakali"; + break; + case 10: + name = "Mechi"; + break; + case 11: + name = "Narayani"; + break; + case 12: + name = "Rapti"; + break; + case 13: + name = "Sagarmatha"; + break; + case 14: + name = "Seti"; + break; + } + } + if (country_code.equals("NR") == true) { + switch (region_code2) { + case 1: + name = "Aiwo"; + break; + case 2: + name = "Anabar"; + break; + case 3: + name = "Anetan"; + break; + case 4: + name = "Anibare"; + break; + case 5: + name = "Baiti"; + break; + case 6: + name = "Boe"; + break; + case 7: + name = "Buada"; + break; + case 8: + name = "Denigomodu"; + break; + case 9: + name = "Ewa"; + break; + case 10: + name = "Ijuw"; + break; + case 11: + name = "Meneng"; + break; + case 12: + name = "Nibok"; + break; + case 13: + name = "Uaboe"; + break; + case 14: + name = "Yaren"; + break; + } + } + if (country_code.equals("NZ") == true) { + switch (region_code2) { + case 10: + name = "Chatham Islands"; + break; + case 1010: + name = "Auckland"; + break; + case 1011: + name = "Bay of Plenty"; + break; + case 1012: + name = "Canterbury"; + break; + case 1047: + name = "Gisborne"; + break; + case 1048: + name = "Hawke's Bay"; + break; + case 1049: + name = "Manawatu-Wanganui"; + break; + case 1050: + name = "Marlborough"; + break; + case 1051: + name = "Nelson"; + break; + case 1052: + name = "Northland"; + break; + case 1053: + name = "Otago"; + break; + case 1054: + name = "Southland"; + break; + case 1055: + name = "Taranaki"; + break; + case 1090: + name = "Waikato"; + break; + case 1091: + name = "Wellington"; + break; + case 1092: + name = "West Coast"; + break; + case 85: + name = "Waikato"; + break; + } + } + if (country_code.equals("OM") == true) { + switch (region_code2) { + case 1: + name = "Ad Dakhiliyah"; + break; + case 2: + name = "Al Batinah"; + break; + case 3: + name = "Al Wusta"; + break; + case 4: + name = "Ash Sharqiyah"; + break; + case 5: + name = "Az Zahirah"; + break; + case 6: + name = "Masqat"; + break; + case 7: + name = "Musandam"; + break; + case 8: + name = "Zufar"; + break; + } + } + if (country_code.equals("PA") == true) { + switch (region_code2) { + case 1: + name = "Bocas del Toro"; + break; + case 2: + name = "Chiriqui"; + break; + case 3: + name = "Cocle"; + break; + case 4: + name = "Colon"; + break; + case 5: + name = "Darien"; + break; + case 6: + name = "Herrera"; + break; + case 7: + name = "Los Santos"; + break; + case 8: + name = "Panama"; + break; + case 9: + name = "San Blas"; + break; + case 10: + name = "Veraguas"; + break; + } + } + if (country_code.equals("PE") == true) { + switch (region_code2) { + case 1: + name = "Amazonas"; + break; + case 2: + name = "Ancash"; + break; + case 3: + name = "Apurimac"; + break; + case 4: + name = "Arequipa"; + break; + case 5: + name = "Ayacucho"; + break; + case 6: + name = "Cajamarca"; + break; + case 7: + name = "Callao"; + break; + case 8: + name = "Cusco"; + break; + case 9: + name = "Huancavelica"; + break; + case 10: + name = "Huanuco"; + break; + case 11: + name = "Ica"; + break; + case 12: + name = "Junin"; + break; + case 13: + name = "La Libertad"; + break; + case 14: + name = "Lambayeque"; + break; + case 15: + name = "Lima"; + break; + case 16: + name = "Loreto"; + break; + case 17: + name = "Madre de Dios"; + break; + case 18: + name = "Moquegua"; + break; + case 19: + name = "Pasco"; + break; + case 20: + name = "Piura"; + break; + case 21: + name = "Puno"; + break; + case 22: + name = "San Martin"; + break; + case 23: + name = "Tacna"; + break; + case 24: + name = "Tumbes"; + break; + case 25: + name = "Ucayali"; + break; + } + } + if (country_code.equals("PG") == true) { + switch (region_code2) { + case 1: + name = "Central"; + break; + case 2: + name = "Gulf"; + break; + case 3: + name = "Milne Bay"; + break; + case 4: + name = "Northern"; + break; + case 5: + name = "Southern Highlands"; + break; + case 6: + name = "Western"; + break; + case 7: + name = "North Solomons"; + break; + case 8: + name = "Chimbu"; + break; + case 9: + name = "Eastern Highlands"; + break; + case 10: + name = "East New Britain"; + break; + case 11: + name = "East Sepik"; + break; + case 12: + name = "Madang"; + break; + case 13: + name = "Manus"; + break; + case 14: + name = "Morobe"; + break; + case 15: + name = "New Ireland"; + break; + case 16: + name = "Western Highlands"; + break; + case 17: + name = "West New Britain"; + break; + case 18: + name = "Sandaun"; + break; + case 19: + name = "Enga"; + break; + case 20: + name = "National Capital"; + break; + } + } + if (country_code.equals("PH") == true) { + switch (region_code2) { + case 1: + name = "Abra"; + break; + case 2: + name = "Agusan del Norte"; + break; + case 3: + name = "Agusan del Sur"; + break; + case 4: + name = "Aklan"; + break; + case 5: + name = "Albay"; + break; + case 6: + name = "Antique"; + break; + case 7: + name = "Bataan"; + break; + case 8: + name = "Batanes"; + break; + case 9: + name = "Batangas"; + break; + case 10: + name = "Benguet"; + break; + case 11: + name = "Bohol"; + break; + case 12: + name = "Bukidnon"; + break; + case 13: + name = "Bulacan"; + break; + case 14: + name = "Cagayan"; + break; + case 15: + name = "Camarines Norte"; + break; + case 16: + name = "Camarines Sur"; + break; + case 17: + name = "Camiguin"; + break; + case 18: + name = "Capiz"; + break; + case 19: + name = "Catanduanes"; + break; + case 20: + name = "Cavite"; + break; + case 21: + name = "Cebu"; + break; + case 22: + name = "Basilan"; + break; + case 23: + name = "Eastern Samar"; + break; + case 24: + name = "Davao"; + break; + case 25: + name = "Davao del Sur"; + break; + case 26: + name = "Davao Oriental"; + break; + case 27: + name = "Ifugao"; + break; + case 28: + name = "Ilocos Norte"; + break; + case 29: + name = "Ilocos Sur"; + break; + case 30: + name = "Iloilo"; + break; + case 31: + name = "Isabela"; + break; + case 32: + name = "Kalinga-Apayao"; + break; + case 33: + name = "Laguna"; + break; + case 34: + name = "Lanao del Norte"; + break; + case 35: + name = "Lanao del Sur"; + break; + case 36: + name = "La Union"; + break; + case 37: + name = "Leyte"; + break; + case 38: + name = "Marinduque"; + break; + case 39: + name = "Masbate"; + break; + case 40: + name = "Mindoro Occidental"; + break; + case 41: + name = "Mindoro Oriental"; + break; + case 42: + name = "Misamis Occidental"; + break; + case 43: + name = "Misamis Oriental"; + break; + case 44: + name = "Mountain"; + break; + case 45: + name = "Negros Occidental"; + break; + case 46: + name = "Negros Oriental"; + break; + case 47: + name = "Nueva Ecija"; + break; + case 48: + name = "Nueva Vizcaya"; + break; + case 49: + name = "Palawan"; + break; + case 50: + name = "Pampanga"; + break; + case 51: + name = "Pangasinan"; + break; + case 53: + name = "Rizal"; + break; + case 54: + name = "Romblon"; + break; + case 55: + name = "Samar"; + break; + case 56: + name = "Maguindanao"; + break; + case 57: + name = "North Cotabato"; + break; + case 58: + name = "Sorsogon"; + break; + case 59: + name = "Southern Leyte"; + break; + case 60: + name = "Sulu"; + break; + case 61: + name = "Surigao del Norte"; + break; + case 62: + name = "Surigao del Sur"; + break; + case 63: + name = "Tarlac"; + break; + case 64: + name = "Zambales"; + break; + case 65: + name = "Zamboanga del Norte"; + break; + case 66: + name = "Zamboanga del Sur"; + break; + case 67: + name = "Northern Samar"; + break; + case 68: + name = "Quirino"; + break; + case 69: + name = "Siquijor"; + break; + case 70: + name = "South Cotabato"; + break; + case 71: + name = "Sultan Kudarat"; + break; + case 72: + name = "Tawitawi"; + break; + case 832: + name = "Angeles"; + break; + case 833: + name = "Bacolod"; + break; + case 834: + name = "Bago"; + break; + case 835: + name = "Baguio"; + break; + case 836: + name = "Bais"; + break; + case 837: + name = "Basilan City"; + break; + case 838: + name = "Batangas City"; + break; + case 839: + name = "Butuan"; + break; + case 840: + name = "Cabanatuan"; + break; + case 875: + name = "Cadiz"; + break; + case 876: + name = "Cagayan de Oro"; + break; + case 877: + name = "Calbayog"; + break; + case 878: + name = "Caloocan"; + break; + case 879: + name = "Canlaon"; + break; + case 880: + name = "Cavite City"; + break; + case 881: + name = "Cebu City"; + break; + case 882: + name = "Cotabato"; + break; + case 883: + name = "Dagupan"; + break; + case 918: + name = "Danao"; + break; + case 919: + name = "Dapitan"; + break; + case 920: + name = "Davao City"; + break; + case 921: + name = "Dipolog"; + break; + case 922: + name = "Dumaguete"; + break; + case 923: + name = "General Santos"; + break; + case 924: + name = "Gingoog"; + break; + case 925: + name = "Iligan"; + break; + case 926: + name = "Iloilo City"; + break; + case 961: + name = "Iriga"; + break; + case 962: + name = "La Carlota"; + break; + case 963: + name = "Laoag"; + break; + case 964: + name = "Lapu-Lapu"; + break; + case 965: + name = "Legaspi"; + break; + case 966: + name = "Lipa"; + break; + case 967: + name = "Lucena"; + break; + case 968: + name = "Mandaue"; + break; + case 969: + name = "Manila"; + break; + case 1004: + name = "Marawi"; + break; + case 1005: + name = "Naga"; + break; + case 1006: + name = "Olongapo"; + break; + case 1007: + name = "Ormoc"; + break; + case 1008: + name = "Oroquieta"; + break; + case 1009: + name = "Ozamis"; + break; + case 1010: + name = "Pagadian"; + break; + case 1011: + name = "Palayan"; + break; + case 1012: + name = "Pasay"; + break; + case 1047: + name = "Puerto Princesa"; + break; + case 1048: + name = "Quezon City"; + break; + case 1049: + name = "Roxas"; + break; + case 1050: + name = "San Carlos"; + break; + case 1051: + name = "San Carlos"; + break; + case 1052: + name = "San Jose"; + break; + case 1053: + name = "San Pablo"; + break; + case 1054: + name = "Silay"; + break; + case 1055: + name = "Surigao"; + break; + case 1090: + name = "Tacloban"; + break; + case 1091: + name = "Tagaytay"; + break; + case 1092: + name = "Tagbilaran"; + break; + case 1093: + name = "Tangub"; + break; + case 1094: + name = "Toledo"; + break; + case 1095: + name = "Trece Martires"; + break; + case 1096: + name = "Zamboanga"; + break; + case 1097: + name = "Aurora"; + break; + case 1134: + name = "Quezon"; + break; + case 1135: + name = "Negros Occidental"; + break; + } + } + if (country_code.equals("PK") == true) { + switch (region_code2) { + case 1: + name = "Federally Administered Tribal Areas"; + break; + case 2: + name = "Balochistan"; + break; + case 3: + name = "North-West Frontier"; + break; + case 4: + name = "Punjab"; + break; + case 5: + name = "Sindh"; + break; + case 6: + name = "Azad Kashmir"; + break; + case 7: + name = "Northern Areas"; + break; + case 8: + name = "Islamabad"; + break; + } + } + if (country_code.equals("PL") == true) { + switch (region_code2) { + case 72: + name = "Dolnoslaskie"; + break; + case 73: + name = "Kujawsko-Pomorskie"; + break; + case 74: + name = "Lodzkie"; + break; + case 75: + name = "Lubelskie"; + break; + case 76: + name = "Lubuskie"; + break; + case 77: + name = "Malopolskie"; + break; + case 78: + name = "Mazowieckie"; + break; + case 79: + name = "Opolskie"; + break; + case 80: + name = "Podkarpackie"; + break; + case 81: + name = "Podlaskie"; + break; + case 82: + name = "Pomorskie"; + break; + case 83: + name = "Slaskie"; + break; + case 84: + name = "Swietokrzyskie"; + break; + case 85: + name = "Warminsko-Mazurskie"; + break; + case 86: + name = "Wielkopolskie"; + break; + case 87: + name = "Zachodniopomorskie"; + break; + } + } + if (country_code.equals("PS") == true) { + switch (region_code2) { + case 1131: + name = "Gaza"; + break; + case 1798: + name = "West Bank"; + break; + } + } + if (country_code.equals("PT") == true) { + switch (region_code2) { + case 2: + name = "Aveiro"; + break; + case 3: + name = "Beja"; + break; + case 4: + name = "Braga"; + break; + case 5: + name = "Braganca"; + break; + case 6: + name = "Castelo Branco"; + break; + case 7: + name = "Coimbra"; + break; + case 8: + name = "Evora"; + break; + case 9: + name = "Faro"; + break; + case 10: + name = "Madeira"; + break; + case 11: + name = "Guarda"; + break; + case 13: + name = "Leiria"; + break; + case 14: + name = "Lisboa"; + break; + case 16: + name = "Portalegre"; + break; + case 17: + name = "Porto"; + break; + case 18: + name = "Santarem"; + break; + case 19: + name = "Setubal"; + break; + case 20: + name = "Viana do Castelo"; + break; + case 21: + name = "Vila Real"; + break; + case 22: + name = "Viseu"; + break; + case 23: + name = "Azores"; + break; + } + } + if (country_code.equals("PY") == true) { + switch (region_code2) { + case 1: + name = "Alto Parana"; + break; + case 2: + name = "Amambay"; + break; + case 3: + name = "Boqueron"; + break; + case 4: + name = "Caaguazu"; + break; + case 5: + name = "Caazapa"; + break; + case 6: + name = "Central"; + break; + case 7: + name = "Concepcion"; + break; + case 8: + name = "Cordillera"; + break; + case 10: + name = "Guaira"; + break; + case 11: + name = "Itapua"; + break; + case 12: + name = "Misiones"; + break; + case 13: + name = "Neembucu"; + break; + case 15: + name = "Paraguari"; + break; + case 16: + name = "Presidente Hayes"; + break; + case 17: + name = "San Pedro"; + break; + case 19: + name = "Canindeyu"; + break; + case 20: + name = "Chaco"; + break; + case 21: + name = "Nueva Asuncion"; + break; + case 23: + name = "Alto Paraguay"; + break; + } + } + if (country_code.equals("QA") == true) { + switch (region_code2) { + case 1: + name = "Ad Dawhah"; + break; + case 2: + name = "Al Ghuwariyah"; + break; + case 3: + name = "Al Jumaliyah"; + break; + case 4: + name = "Al Khawr"; + break; + case 5: + name = "Al Wakrah Municipality"; + break; + case 6: + name = "Ar Rayyan"; + break; + case 8: + name = "Madinat ach Shamal"; + break; + case 9: + name = "Umm Salal"; + break; + case 10: + name = "Al Wakrah"; + break; + case 11: + name = "Jariyan al Batnah"; + break; + case 12: + name = "Umm Sa'id"; + break; + } + } + if (country_code.equals("RO") == true) { + switch (region_code2) { + case 1: + name = "Alba"; + break; + case 2: + name = "Arad"; + break; + case 3: + name = "Arges"; + break; + case 4: + name = "Bacau"; + break; + case 5: + name = "Bihor"; + break; + case 6: + name = "Bistrita-Nasaud"; + break; + case 7: + name = "Botosani"; + break; + case 8: + name = "Braila"; + break; + case 9: + name = "Brasov"; + break; + case 10: + name = "Bucuresti"; + break; + case 11: + name = "Buzau"; + break; + case 12: + name = "Caras-Severin"; + break; + case 13: + name = "Cluj"; + break; + case 14: + name = "Constanta"; + break; + case 15: + name = "Covasna"; + break; + case 16: + name = "Dambovita"; + break; + case 17: + name = "Dolj"; + break; + case 18: + name = "Galati"; + break; + case 19: + name = "Gorj"; + break; + case 20: + name = "Harghita"; + break; + case 21: + name = "Hunedoara"; + break; + case 22: + name = "Ialomita"; + break; + case 23: + name = "Iasi"; + break; + case 25: + name = "Maramures"; + break; + case 26: + name = "Mehedinti"; + break; + case 27: + name = "Mures"; + break; + case 28: + name = "Neamt"; + break; + case 29: + name = "Olt"; + break; + case 30: + name = "Prahova"; + break; + case 31: + name = "Salaj"; + break; + case 32: + name = "Satu Mare"; + break; + case 33: + name = "Sibiu"; + break; + case 34: + name = "Suceava"; + break; + case 35: + name = "Teleorman"; + break; + case 36: + name = "Timis"; + break; + case 37: + name = "Tulcea"; + break; + case 38: + name = "Vaslui"; + break; + case 39: + name = "Valcea"; + break; + case 40: + name = "Vrancea"; + break; + case 41: + name = "Calarasi"; + break; + case 42: + name = "Giurgiu"; + break; + case 43: + name = "Ilfov"; + break; + } + } + if (country_code.equals("RS") == true) { + switch (region_code2) { + case 1: + name = "Kosovo"; + break; + case 2: + name = "Vojvodina"; + break; + } + } + if (country_code.equals("RU") == true) { + switch (region_code2) { + case 1: + name = "Adygeya"; + break; + case 2: + name = "Aginsky Buryatsky AO"; + break; + case 3: + name = "Gorno-Altay"; + break; + case 4: + name = "Altaisky krai"; + break; + case 5: + name = "Amur"; + break; + case 6: + name = "Arkhangel'sk"; + break; + case 7: + name = "Astrakhan'"; + break; + case 8: + name = "Bashkortostan"; + break; + case 9: + name = "Belgorod"; + break; + case 10: + name = "Bryansk"; + break; + case 11: + name = "Buryat"; + break; + case 12: + name = "Chechnya"; + break; + case 13: + name = "Chelyabinsk"; + break; + case 14: + name = "Chita"; + break; + case 15: + name = "Chukot"; + break; + case 16: + name = "Chuvashia"; + break; + case 17: + name = "Dagestan"; + break; + case 18: + name = "Evenk"; + break; + case 19: + name = "Ingush"; + break; + case 20: + name = "Irkutsk"; + break; + case 21: + name = "Ivanovo"; + break; + case 22: + name = "Kabardin-Balkar"; + break; + case 23: + name = "Kaliningrad"; + break; + case 24: + name = "Kalmyk"; + break; + case 25: + name = "Kaluga"; + break; + case 26: + name = "Kamchatka"; + break; + case 27: + name = "Karachay-Cherkess"; + break; + case 28: + name = "Karelia"; + break; + case 29: + name = "Kemerovo"; + break; + case 30: + name = "Khabarovsk"; + break; + case 31: + name = "Khakass"; + break; + case 32: + name = "Khanty-Mansiy"; + break; + case 33: + name = "Kirov"; + break; + case 34: + name = "Komi"; + break; + case 35: + name = "Komi-Permyak"; + break; + case 36: + name = "Koryak"; + break; + case 37: + name = "Kostroma"; + break; + case 38: + name = "Krasnodar"; + break; + case 39: + name = "Krasnoyarsk"; + break; + case 40: + name = "Kurgan"; + break; + case 41: + name = "Kursk"; + break; + case 42: + name = "Leningrad"; + break; + case 43: + name = "Lipetsk"; + break; + case 44: + name = "Magadan"; + break; + case 45: + name = "Mariy-El"; + break; + case 46: + name = "Mordovia"; + break; + case 47: + name = "Moskva"; + break; + case 48: + name = "Moscow City"; + break; + case 49: + name = "Murmansk"; + break; + case 50: + name = "Nenets"; + break; + case 51: + name = "Nizhegorod"; + break; + case 52: + name = "Novgorod"; + break; + case 53: + name = "Novosibirsk"; + break; + case 54: + name = "Omsk"; + break; + case 55: + name = "Orenburg"; + break; + case 56: + name = "Orel"; + break; + case 57: + name = "Penza"; + break; + case 58: + name = "Perm'"; + break; + case 59: + name = "Primor'ye"; + break; + case 60: + name = "Pskov"; + break; + case 61: + name = "Rostov"; + break; + case 62: + name = "Ryazan'"; + break; + case 63: + name = "Sakha"; + break; + case 64: + name = "Sakhalin"; + break; + case 65: + name = "Samara"; + break; + case 66: + name = "Saint Petersburg City"; + break; + case 67: + name = "Saratov"; + break; + case 68: + name = "North Ossetia"; + break; + case 69: + name = "Smolensk"; + break; + case 70: + name = "Stavropol'"; + break; + case 71: + name = "Sverdlovsk"; + break; + case 72: + name = "Tambovskaya oblast"; + break; + case 73: + name = "Tatarstan"; + break; + case 74: + name = "Taymyr"; + break; + case 75: + name = "Tomsk"; + break; + case 76: + name = "Tula"; + break; + case 77: + name = "Tver'"; + break; + case 78: + name = "Tyumen'"; + break; + case 79: + name = "Tuva"; + break; + case 80: + name = "Udmurt"; + break; + case 81: + name = "Ul'yanovsk"; + break; + case 82: + name = "Ust-Orda Buryat"; + break; + case 83: + name = "Vladimir"; + break; + case 84: + name = "Volgograd"; + break; + case 85: + name = "Vologda"; + break; + case 86: + name = "Voronezh"; + break; + case 87: + name = "Yamal-Nenets"; + break; + case 88: + name = "Yaroslavl'"; + break; + case 89: + name = "Yevrey"; + break; + case 90: + name = "Permskiy Kray"; + break; + case 91: + name = "Krasnoyarskiy Kray"; + break; + case 942: + name = "Chechnya Republic"; + break; + } + } + if (country_code.equals("RW") == true) { + switch (region_code2) { + case 1: + name = "Butare"; + break; + case 6: + name = "Gitarama"; + break; + case 7: + name = "Kibungo"; + break; + case 9: + name = "Kigali"; + break; + case 11: + name = "Est"; + break; + case 12: + name = "Kigali"; + break; + case 13: + name = "Nord"; + break; + case 14: + name = "Ouest"; + break; + case 15: + name = "Sud"; + break; + } + } + if (country_code.equals("SA") == true) { + switch (region_code2) { + case 2: + name = "Al Bahah"; + break; + case 3: + name = "Al Jawf"; + break; + case 5: + name = "Al Madinah"; + break; + case 6: + name = "Ash Sharqiyah"; + break; + case 8: + name = "Al Qasim"; + break; + case 9: + name = "Al Qurayyat"; + break; + case 10: + name = "Ar Riyad"; + break; + case 13: + name = "Ha'il"; + break; + case 14: + name = "Makkah"; + break; + case 15: + name = "Al Hudud ash Shamaliyah"; + break; + case 16: + name = "Najran"; + break; + case 17: + name = "Jizan"; + break; + case 19: + name = "Tabuk"; + break; + case 20: + name = "Al Jawf"; + break; + } + } + if (country_code.equals("SB") == true) { + switch (region_code2) { + case 3: + name = "Malaita"; + break; + case 6: + name = "Guadalcanal"; + break; + case 7: + name = "Isabel"; + break; + case 8: + name = "Makira"; + break; + case 9: + name = "Temotu"; + break; + case 10: + name = "Central"; + break; + case 11: + name = "Western"; + break; + case 12: + name = "Choiseul"; + break; + case 13: + name = "Rennell and Bellona"; + break; + } + } + if (country_code.equals("SC") == true) { + switch (region_code2) { + case 1: + name = "Anse aux Pins"; + break; + case 2: + name = "Anse Boileau"; + break; + case 3: + name = "Anse Etoile"; + break; + case 4: + name = "Anse Louis"; + break; + case 5: + name = "Anse Royale"; + break; + case 6: + name = "Baie Lazare"; + break; + case 7: + name = "Baie Sainte Anne"; + break; + case 8: + name = "Beau Vallon"; + break; + case 9: + name = "Bel Air"; + break; + case 10: + name = "Bel Ombre"; + break; + case 11: + name = "Cascade"; + break; + case 12: + name = "Glacis"; + break; + case 13: + name = "Grand' Anse"; + break; + case 14: + name = "Grand' Anse"; + break; + case 15: + name = "La Digue"; + break; + case 16: + name = "La Riviere Anglaise"; + break; + case 17: + name = "Mont Buxton"; + break; + case 18: + name = "Mont Fleuri"; + break; + case 19: + name = "Plaisance"; + break; + case 20: + name = "Pointe La Rue"; + break; + case 21: + name = "Port Glaud"; + break; + case 22: + name = "Saint Louis"; + break; + case 23: + name = "Takamaka"; + break; + } + } + if (country_code.equals("SD") == true) { + switch (region_code2) { + case 27: + name = "Al Wusta"; + break; + case 28: + name = "Al Istiwa'iyah"; + break; + case 29: + name = "Al Khartum"; + break; + case 30: + name = "Ash Shamaliyah"; + break; + case 31: + name = "Ash Sharqiyah"; + break; + case 32: + name = "Bahr al Ghazal"; + break; + case 33: + name = "Darfur"; + break; + case 34: + name = "Kurdufan"; + break; + case 35: + name = "Upper Nile"; + break; + case 40: + name = "Al Wahadah State"; + break; + case 44: + name = "Central Equatoria State"; + break; + } + } + if (country_code.equals("SE") == true) { + switch (region_code2) { + case 1: + name = "Alvsborgs Lan"; + break; + case 2: + name = "Blekinge Lan"; + break; + case 3: + name = "Gavleborgs Lan"; + break; + case 4: + name = "Goteborgs och Bohus Lan"; + break; + case 5: + name = "Gotlands Lan"; + break; + case 6: + name = "Hallands Lan"; + break; + case 7: + name = "Jamtlands Lan"; + break; + case 8: + name = "Jonkopings Lan"; + break; + case 9: + name = "Kalmar Lan"; + break; + case 10: + name = "Dalarnas Lan"; + break; + case 11: + name = "Kristianstads Lan"; + break; + case 12: + name = "Kronobergs Lan"; + break; + case 13: + name = "Malmohus Lan"; + break; + case 14: + name = "Norrbottens Lan"; + break; + case 15: + name = "Orebro Lan"; + break; + case 16: + name = "Ostergotlands Lan"; + break; + case 17: + name = "Skaraborgs Lan"; + break; + case 18: + name = "Sodermanlands Lan"; + break; + case 21: + name = "Uppsala Lan"; + break; + case 22: + name = "Varmlands Lan"; + break; + case 23: + name = "Vasterbottens Lan"; + break; + case 24: + name = "Vasternorrlands Lan"; + break; + case 25: + name = "Vastmanlands Lan"; + break; + case 26: + name = "Stockholms Lan"; + break; + case 27: + name = "Skane Lan"; + break; + case 28: + name = "Vastra Gotaland"; + break; + } + } + if (country_code.equals("SH") == true) { + switch (region_code2) { + case 1: + name = "Ascension"; + break; + case 2: + name = "Saint Helena"; + break; + case 3: + name = "Tristan da Cunha"; + break; + } + } + if (country_code.equals("SI") == true) { + switch (region_code2) { + case 1: + name = "Ajdovscina"; + break; + case 2: + name = "Beltinci"; + break; + case 3: + name = "Bled"; + break; + case 4: + name = "Bohinj"; + break; + case 5: + name = "Borovnica"; + break; + case 6: + name = "Bovec"; + break; + case 7: + name = "Brda"; + break; + case 8: + name = "Brezice"; + break; + case 9: + name = "Brezovica"; + break; + case 11: + name = "Celje"; + break; + case 12: + name = "Cerklje na Gorenjskem"; + break; + case 13: + name = "Cerknica"; + break; + case 14: + name = "Cerkno"; + break; + case 15: + name = "Crensovci"; + break; + case 16: + name = "Crna na Koroskem"; + break; + case 17: + name = "Crnomelj"; + break; + case 19: + name = "Divaca"; + break; + case 20: + name = "Dobrepolje"; + break; + case 22: + name = "Dol pri Ljubljani"; + break; + case 24: + name = "Dornava"; + break; + case 25: + name = "Dravograd"; + break; + case 26: + name = "Duplek"; + break; + case 27: + name = "Gorenja Vas-Poljane"; + break; + case 28: + name = "Gorisnica"; + break; + case 29: + name = "Gornja Radgona"; + break; + case 30: + name = "Gornji Grad"; + break; + case 31: + name = "Gornji Petrovci"; + break; + case 32: + name = "Grosuplje"; + break; + case 34: + name = "Hrastnik"; + break; + case 35: + name = "Hrpelje-Kozina"; + break; + case 36: + name = "Idrija"; + break; + case 37: + name = "Ig"; + break; + case 38: + name = "Ilirska Bistrica"; + break; + case 39: + name = "Ivancna Gorica"; + break; + case 40: + name = "Izola-Isola"; + break; + case 42: + name = "Jursinci"; + break; + case 44: + name = "Kanal"; + break; + case 45: + name = "Kidricevo"; + break; + case 46: + name = "Kobarid"; + break; + case 47: + name = "Kobilje"; + break; + case 49: + name = "Komen"; + break; + case 50: + name = "Koper-Capodistria"; + break; + case 51: + name = "Kozje"; + break; + case 52: + name = "Kranj"; + break; + case 53: + name = "Kranjska Gora"; + break; + case 54: + name = "Krsko"; + break; + case 55: + name = "Kungota"; + break; + case 57: + name = "Lasko"; + break; + case 61: + name = "Ljubljana"; + break; + case 62: + name = "Ljubno"; + break; + case 64: + name = "Logatec"; + break; + case 66: + name = "Loski Potok"; + break; + case 68: + name = "Lukovica"; + break; + case 71: + name = "Medvode"; + break; + case 72: + name = "Menges"; + break; + case 73: + name = "Metlika"; + break; + case 74: + name = "Mezica"; + break; + case 76: + name = "Mislinja"; + break; + case 77: + name = "Moravce"; + break; + case 78: + name = "Moravske Toplice"; + break; + case 79: + name = "Mozirje"; + break; + case 80: + name = "Murska Sobota"; + break; + case 81: + name = "Muta"; + break; + case 82: + name = "Naklo"; + break; + case 83: + name = "Nazarje"; + break; + case 84: + name = "Nova Gorica"; + break; + case 86: + name = "Odranci"; + break; + case 87: + name = "Ormoz"; + break; + case 88: + name = "Osilnica"; + break; + case 89: + name = "Pesnica"; + break; + case 91: + name = "Pivka"; + break; + case 92: + name = "Podcetrtek"; + break; + case 94: + name = "Postojna"; + break; + case 97: + name = "Puconci"; + break; + case 98: + name = "Racam"; + break; + case 99: + name = "Radece"; + break; + case 832: + name = "Radenci"; + break; + case 833: + name = "Radlje ob Dravi"; + break; + case 834: + name = "Radovljica"; + break; + case 837: + name = "Rogasovci"; + break; + case 838: + name = "Rogaska Slatina"; + break; + case 839: + name = "Rogatec"; + break; + case 875: + name = "Semic"; + break; + case 876: + name = "Sencur"; + break; + case 877: + name = "Sentilj"; + break; + case 878: + name = "Sentjernej"; + break; + case 880: + name = "Sevnica"; + break; + case 881: + name = "Sezana"; + break; + case 882: + name = "Skocjan"; + break; + case 883: + name = "Skofja Loka"; + break; + case 918: + name = "Skofljica"; + break; + case 919: + name = "Slovenj Gradec"; + break; + case 921: + name = "Slovenske Konjice"; + break; + case 922: + name = "Smarje pri Jelsah"; + break; + case 923: + name = "Smartno ob Paki"; + break; + case 924: + name = "Sostanj"; + break; + case 925: + name = "Starse"; + break; + case 926: + name = "Store"; + break; + case 961: + name = "Sveti Jurij"; + break; + case 962: + name = "Tolmin"; + break; + case 963: + name = "Trbovlje"; + break; + case 964: + name = "Trebnje"; + break; + case 965: + name = "Trzic"; + break; + case 966: + name = "Turnisce"; + break; + case 967: + name = "Velenje"; + break; + case 968: + name = "Velike Lasce"; + break; + case 1004: + name = "Vipava"; + break; + case 1005: + name = "Vitanje"; + break; + case 1006: + name = "Vodice"; + break; + case 1008: + name = "Vrhnika"; + break; + case 1009: + name = "Vuzenica"; + break; + case 1010: + name = "Zagorje ob Savi"; + break; + case 1012: + name = "Zavrc"; + break; + case 1047: + name = "Zelezniki"; + break; + case 1048: + name = "Ziri"; + break; + case 1049: + name = "Zrece"; + break; + case 1093: + name = "Dobrova-Horjul-Polhov Gradec"; + break; + case 1096: + name = "Domzale"; + break; + case 1136: + name = "Jesenice"; + break; + case 1138: + name = "Kamnik"; + break; + case 1139: + name = "Kocevje"; + break; + case 1177: + name = "Kuzma"; + break; + case 1178: + name = "Lenart"; + break; + case 1180: + name = "Litija"; + break; + case 1181: + name = "Ljutomer"; + break; + case 1182: + name = "Loska Dolina"; + break; + case 1184: + name = "Luce"; + break; + case 1219: + name = "Majsperk"; + break; + case 1220: + name = "Maribor"; + break; + case 1223: + name = "Miren-Kostanjevica"; + break; + case 1225: + name = "Novo Mesto"; + break; + case 1227: + name = "Piran"; + break; + case 1266: + name = "Preddvor"; + break; + case 1268: + name = "Ptuj"; + break; + case 1305: + name = "Ribnica"; + break; + case 1307: + name = "Ruse"; + break; + case 1311: + name = "Sentjur pri Celju"; + break; + case 1312: + name = "Slovenska Bistrica"; + break; + case 1392: + name = "Videm"; + break; + case 1393: + name = "Vojnik"; + break; + case 1395: + name = "Zalec"; + break; + } + } + if (country_code.equals("SK") == true) { + switch (region_code2) { + case 1: + name = "Banska Bystrica"; + break; + case 2: + name = "Bratislava"; + break; + case 3: + name = "Kosice"; + break; + case 4: + name = "Nitra"; + break; + case 5: + name = "Presov"; + break; + case 6: + name = "Trencin"; + break; + case 7: + name = "Trnava"; + break; + case 8: + name = "Zilina"; + break; + } + } + if (country_code.equals("SL") == true) { + switch (region_code2) { + case 1: + name = "Eastern"; + break; + case 2: + name = "Northern"; + break; + case 3: + name = "Southern"; + break; + case 4: + name = "Western Area"; + break; + } + } + if (country_code.equals("SM") == true) { + switch (region_code2) { + case 1: + name = "Acquaviva"; + break; + case 2: + name = "Chiesanuova"; + break; + case 3: + name = "Domagnano"; + break; + case 4: + name = "Faetano"; + break; + case 5: + name = "Fiorentino"; + break; + case 6: + name = "Borgo Maggiore"; + break; + case 7: + name = "San Marino"; + break; + case 8: + name = "Monte Giardino"; + break; + case 9: + name = "Serravalle"; + break; + } + } + if (country_code.equals("SN") == true) { + switch (region_code2) { + case 1: + name = "Dakar"; + break; + case 3: + name = "Diourbel"; + break; + case 4: + name = "Saint-Louis"; + break; + case 5: + name = "Tambacounda"; + break; + case 7: + name = "Thies"; + break; + case 8: + name = "Louga"; + break; + case 9: + name = "Fatick"; + break; + case 10: + name = "Kaolack"; + break; + case 11: + name = "Kolda"; + break; + case 12: + name = "Ziguinchor"; + break; + case 13: + name = "Louga"; + break; + case 14: + name = "Saint-Louis"; + break; + case 15: + name = "Matam"; + break; + } + } + if (country_code.equals("SO") == true) { + switch (region_code2) { + case 1: + name = "Bakool"; + break; + case 2: + name = "Banaadir"; + break; + case 3: + name = "Bari"; + break; + case 4: + name = "Bay"; + break; + case 5: + name = "Galguduud"; + break; + case 6: + name = "Gedo"; + break; + case 7: + name = "Hiiraan"; + break; + case 8: + name = "Jubbada Dhexe"; + break; + case 9: + name = "Jubbada Hoose"; + break; + case 10: + name = "Mudug"; + break; + case 11: + name = "Nugaal"; + break; + case 12: + name = "Sanaag"; + break; + case 13: + name = "Shabeellaha Dhexe"; + break; + case 14: + name = "Shabeellaha Hoose"; + break; + case 16: + name = "Woqooyi Galbeed"; + break; + case 18: + name = "Nugaal"; + break; + case 19: + name = "Togdheer"; + break; + case 20: + name = "Woqooyi Galbeed"; + break; + case 21: + name = "Awdal"; + break; + case 22: + name = "Sool"; + break; + } + } + if (country_code.equals("SR") == true) { + switch (region_code2) { + case 10: + name = "Brokopondo"; + break; + case 11: + name = "Commewijne"; + break; + case 12: + name = "Coronie"; + break; + case 13: + name = "Marowijne"; + break; + case 14: + name = "Nickerie"; + break; + case 15: + name = "Para"; + break; + case 16: + name = "Paramaribo"; + break; + case 17: + name = "Saramacca"; + break; + case 18: + name = "Sipaliwini"; + break; + case 19: + name = "Wanica"; + break; + } + } + if (country_code.equals("ST") == true) { + switch (region_code2) { + case 1: + name = "Principe"; + break; + case 2: + name = "Sao Tome"; + break; + } + } + if (country_code.equals("SV") == true) { + switch (region_code2) { + case 1: + name = "Ahuachapan"; + break; + case 2: + name = "Cabanas"; + break; + case 3: + name = "Chalatenango"; + break; + case 4: + name = "Cuscatlan"; + break; + case 5: + name = "La Libertad"; + break; + case 6: + name = "La Paz"; + break; + case 7: + name = "La Union"; + break; + case 8: + name = "Morazan"; + break; + case 9: + name = "San Miguel"; + break; + case 10: + name = "San Salvador"; + break; + case 11: + name = "Santa Ana"; + break; + case 12: + name = "San Vicente"; + break; + case 13: + name = "Sonsonate"; + break; + case 14: + name = "Usulutan"; + break; + } + } + if (country_code.equals("SY") == true) { + switch (region_code2) { + case 1: + name = "Al Hasakah"; + break; + case 2: + name = "Al Ladhiqiyah"; + break; + case 3: + name = "Al Qunaytirah"; + break; + case 4: + name = "Ar Raqqah"; + break; + case 5: + name = "As Suwayda'"; + break; + case 6: + name = "Dar"; + break; + case 7: + name = "Dayr az Zawr"; + break; + case 8: + name = "Rif Dimashq"; + break; + case 9: + name = "Halab"; + break; + case 10: + name = "Hamah"; + break; + case 11: + name = "Hims"; + break; + case 12: + name = "Idlib"; + break; + case 13: + name = "Dimashq"; + break; + case 14: + name = "Tartus"; + break; + } + } + if (country_code.equals("SZ") == true) { + switch (region_code2) { + case 1: + name = "Hhohho"; + break; + case 2: + name = "Lubombo"; + break; + case 3: + name = "Manzini"; + break; + case 4: + name = "Shiselweni"; + break; + case 5: + name = "Praslin"; + break; + } + } + if (country_code.equals("TD") == true) { + switch (region_code2) { + case 1: + name = "Batha"; + break; + case 2: + name = "Biltine"; + break; + case 3: + name = "Borkou-Ennedi-Tibesti"; + break; + case 4: + name = "Chari-Baguirmi"; + break; + case 5: + name = "Guera"; + break; + case 6: + name = "Kanem"; + break; + case 7: + name = "Lac"; + break; + case 8: + name = "Logone Occidental"; + break; + case 9: + name = "Logone Oriental"; + break; + case 10: + name = "Mayo-Kebbi"; + break; + case 11: + name = "Moyen-Chari"; + break; + case 12: + name = "Ouaddai"; + break; + case 13: + name = "Salamat"; + break; + case 14: + name = "Tandjile"; + break; + } + } + if (country_code.equals("TG") == true) { + switch (region_code2) { + case 9: + name = "Lama-Kara"; + break; + case 18: + name = "Tsevie"; + break; + case 22: + name = "Centrale"; + break; + case 23: + name = "Kara"; + break; + case 24: + name = "Maritime"; + break; + case 25: + name = "Plateaux"; + break; + case 26: + name = "Savanes"; + break; + } + } + if (country_code.equals("TH") == true) { + switch (region_code2) { + case 1: + name = "Mae Hong Son"; + break; + case 2: + name = "Chiang Mai"; + break; + case 3: + name = "Chiang Rai"; + break; + case 4: + name = "Nan"; + break; + case 5: + name = "Lamphun"; + break; + case 6: + name = "Lampang"; + break; + case 7: + name = "Phrae"; + break; + case 8: + name = "Tak"; + break; + case 9: + name = "Sukhothai"; + break; + case 10: + name = "Uttaradit"; + break; + case 11: + name = "Kamphaeng Phet"; + break; + case 12: + name = "Phitsanulok"; + break; + case 13: + name = "Phichit"; + break; + case 14: + name = "Phetchabun"; + break; + case 15: + name = "Uthai Thani"; + break; + case 16: + name = "Nakhon Sawan"; + break; + case 17: + name = "Nong Khai"; + break; + case 18: + name = "Loei"; + break; + case 20: + name = "Sakon Nakhon"; + break; + case 21: + name = "Nakhon Phanom"; + break; + case 22: + name = "Khon Kaen"; + break; + case 23: + name = "Kalasin"; + break; + case 24: + name = "Maha Sarakham"; + break; + case 25: + name = "Roi Et"; + break; + case 26: + name = "Chaiyaphum"; + break; + case 27: + name = "Nakhon Ratchasima"; + break; + case 28: + name = "Buriram"; + break; + case 29: + name = "Surin"; + break; + case 30: + name = "Sisaket"; + break; + case 31: + name = "Narathiwat"; + break; + case 32: + name = "Chai Nat"; + break; + case 33: + name = "Sing Buri"; + break; + case 34: + name = "Lop Buri"; + break; + case 35: + name = "Ang Thong"; + break; + case 36: + name = "Phra Nakhon Si Ayutthaya"; + break; + case 37: + name = "Saraburi"; + break; + case 38: + name = "Nonthaburi"; + break; + case 39: + name = "Pathum Thani"; + break; + case 40: + name = "Krung Thep"; + break; + case 41: + name = "Phayao"; + break; + case 42: + name = "Samut Prakan"; + break; + case 43: + name = "Nakhon Nayok"; + break; + case 44: + name = "Chachoengsao"; + break; + case 45: + name = "Prachin Buri"; + break; + case 46: + name = "Chon Buri"; + break; + case 47: + name = "Rayong"; + break; + case 48: + name = "Chanthaburi"; + break; + case 49: + name = "Trat"; + break; + case 50: + name = "Kanchanaburi"; + break; + case 51: + name = "Suphan Buri"; + break; + case 52: + name = "Ratchaburi"; + break; + case 53: + name = "Nakhon Pathom"; + break; + case 54: + name = "Samut Songkhram"; + break; + case 55: + name = "Samut Sakhon"; + break; + case 56: + name = "Phetchaburi"; + break; + case 57: + name = "Prachuap Khiri Khan"; + break; + case 58: + name = "Chumphon"; + break; + case 59: + name = "Ranong"; + break; + case 60: + name = "Surat Thani"; + break; + case 61: + name = "Phangnga"; + break; + case 62: + name = "Phuket"; + break; + case 63: + name = "Krabi"; + break; + case 64: + name = "Nakhon Si Thammarat"; + break; + case 65: + name = "Trang"; + break; + case 66: + name = "Phatthalung"; + break; + case 67: + name = "Satun"; + break; + case 68: + name = "Songkhla"; + break; + case 69: + name = "Pattani"; + break; + case 70: + name = "Yala"; + break; + case 71: + name = "Ubon Ratchathani"; + break; + case 72: + name = "Yasothon"; + break; + case 73: + name = "Nakhon Phanom"; + break; + case 75: + name = "Ubon Ratchathani"; + break; + case 76: + name = "Udon Thani"; + break; + case 77: + name = "Amnat Charoen"; + break; + case 78: + name = "Mukdahan"; + break; + case 79: + name = "Nong Bua Lamphu"; + break; + case 80: + name = "Sa Kaeo"; + break; + } + } + if (country_code.equals("TJ") == true) { + switch (region_code2) { + case 1: + name = "Kuhistoni Badakhshon"; + break; + case 2: + name = "Khatlon"; + break; + case 3: + name = "Sughd"; + break; + } + } + if (country_code.equals("TM") == true) { + switch (region_code2) { + case 1: + name = "Ahal"; + break; + case 2: + name = "Balkan"; + break; + case 3: + name = "Dashoguz"; + break; + case 4: + name = "Lebap"; + break; + case 5: + name = "Mary"; + break; + } + } + if (country_code.equals("TN") == true) { + switch (region_code2) { + case 2: + name = "Kasserine"; + break; + case 3: + name = "Kairouan"; + break; + case 6: + name = "Jendouba"; + break; + case 14: + name = "El Kef"; + break; + case 15: + name = "Al Mahdia"; + break; + case 16: + name = "Al Munastir"; + break; + case 17: + name = "Bajah"; + break; + case 18: + name = "Bizerte"; + break; + case 19: + name = "Nabeul"; + break; + case 22: + name = "Siliana"; + break; + case 23: + name = "Sousse"; + break; + case 26: + name = "Ariana"; + break; + case 27: + name = "Ben Arous"; + break; + case 28: + name = "Madanin"; + break; + case 29: + name = "Gabes"; + break; + case 30: + name = "Gafsa"; + break; + case 31: + name = "Kebili"; + break; + case 32: + name = "Sfax"; + break; + case 33: + name = "Sidi Bou Zid"; + break; + case 34: + name = "Tataouine"; + break; + case 35: + name = "Tozeur"; + break; + case 36: + name = "Tunis"; + break; + case 37: + name = "Zaghouan"; + break; + case 38: + name = "Aiana"; + break; + case 39: + name = "Manouba"; + break; + } + } + if (country_code.equals("TO") == true) { + switch (region_code2) { + case 1: + name = "Ha"; + break; + case 2: + name = "Tongatapu"; + break; + case 3: + name = "Vava"; + break; + } + } + if (country_code.equals("TR") == true) { + switch (region_code2) { + case 2: + name = "Adiyaman"; + break; + case 3: + name = "Afyonkarahisar"; + break; + case 4: + name = "Agri"; + break; + case 5: + name = "Amasya"; + break; + case 7: + name = "Antalya"; + break; + case 8: + name = "Artvin"; + break; + case 9: + name = "Aydin"; + break; + case 10: + name = "Balikesir"; + break; + case 11: + name = "Bilecik"; + break; + case 12: + name = "Bingol"; + break; + case 13: + name = "Bitlis"; + break; + case 14: + name = "Bolu"; + break; + case 15: + name = "Burdur"; + break; + case 16: + name = "Bursa"; + break; + case 17: + name = "Canakkale"; + break; + case 19: + name = "Corum"; + break; + case 20: + name = "Denizli"; + break; + case 21: + name = "Diyarbakir"; + break; + case 22: + name = "Edirne"; + break; + case 23: + name = "Elazig"; + break; + case 24: + name = "Erzincan"; + break; + case 25: + name = "Erzurum"; + break; + case 26: + name = "Eskisehir"; + break; + case 28: + name = "Giresun"; + break; + case 31: + name = "Hatay"; + break; + case 32: + name = "Mersin"; + break; + case 33: + name = "Isparta"; + break; + case 34: + name = "Istanbul"; + break; + case 35: + name = "Izmir"; + break; + case 37: + name = "Kastamonu"; + break; + case 38: + name = "Kayseri"; + break; + case 39: + name = "Kirklareli"; + break; + case 40: + name = "Kirsehir"; + break; + case 41: + name = "Kocaeli"; + break; + case 43: + name = "Kutahya"; + break; + case 44: + name = "Malatya"; + break; + case 45: + name = "Manisa"; + break; + case 46: + name = "Kahramanmaras"; + break; + case 48: + name = "Mugla"; + break; + case 49: + name = "Mus"; + break; + case 50: + name = "Nevsehir"; + break; + case 52: + name = "Ordu"; + break; + case 53: + name = "Rize"; + break; + case 54: + name = "Sakarya"; + break; + case 55: + name = "Samsun"; + break; + case 57: + name = "Sinop"; + break; + case 58: + name = "Sivas"; + break; + case 59: + name = "Tekirdag"; + break; + case 60: + name = "Tokat"; + break; + case 61: + name = "Trabzon"; + break; + case 62: + name = "Tunceli"; + break; + case 63: + name = "Sanliurfa"; + break; + case 64: + name = "Usak"; + break; + case 65: + name = "Van"; + break; + case 66: + name = "Yozgat"; + break; + case 68: + name = "Ankara"; + break; + case 69: + name = "Gumushane"; + break; + case 70: + name = "Hakkari"; + break; + case 71: + name = "Konya"; + break; + case 72: + name = "Mardin"; + break; + case 73: + name = "Nigde"; + break; + case 74: + name = "Siirt"; + break; + case 75: + name = "Aksaray"; + break; + case 76: + name = "Batman"; + break; + case 77: + name = "Bayburt"; + break; + case 78: + name = "Karaman"; + break; + case 79: + name = "Kirikkale"; + break; + case 80: + name = "Sirnak"; + break; + case 81: + name = "Adana"; + break; + case 82: + name = "Cankiri"; + break; + case 83: + name = "Gaziantep"; + break; + case 84: + name = "Kars"; + break; + case 85: + name = "Zonguldak"; + break; + case 86: + name = "Ardahan"; + break; + case 87: + name = "Bartin"; + break; + case 88: + name = "Igdir"; + break; + case 89: + name = "Karabuk"; + break; + case 90: + name = "Kilis"; + break; + case 91: + name = "Osmaniye"; + break; + case 92: + name = "Yalova"; + break; + case 93: + name = "Duzce"; + break; + } + } + if (country_code.equals("TT") == true) { + switch (region_code2) { + case 1: + name = "Arima"; + break; + case 2: + name = "Caroni"; + break; + case 3: + name = "Mayaro"; + break; + case 4: + name = "Nariva"; + break; + case 5: + name = "Port-of-Spain"; + break; + case 6: + name = "Saint Andrew"; + break; + case 7: + name = "Saint David"; + break; + case 8: + name = "Saint George"; + break; + case 9: + name = "Saint Patrick"; + break; + case 10: + name = "San Fernando"; + break; + case 11: + name = "Tobago"; + break; + case 12: + name = "Victoria"; + break; + } + } + if (country_code.equals("TW") == true) { + switch (region_code2) { + case 1: + name = "Fu-chien"; + break; + case 2: + name = "Kao-hsiung"; + break; + case 3: + name = "T'ai-pei"; + break; + case 4: + name = "T'ai-wan"; + break; + } + } + if (country_code.equals("TZ") == true) { + switch (region_code2) { + case 2: + name = "Pwani"; + break; + case 3: + name = "Dodoma"; + break; + case 4: + name = "Iringa"; + break; + case 5: + name = "Kigoma"; + break; + case 6: + name = "Kilimanjaro"; + break; + case 7: + name = "Lindi"; + break; + case 8: + name = "Mara"; + break; + case 9: + name = "Mbeya"; + break; + case 10: + name = "Morogoro"; + break; + case 11: + name = "Mtwara"; + break; + case 12: + name = "Mwanza"; + break; + case 13: + name = "Pemba North"; + break; + case 14: + name = "Ruvuma"; + break; + case 15: + name = "Shinyanga"; + break; + case 16: + name = "Singida"; + break; + case 17: + name = "Tabora"; + break; + case 18: + name = "Tanga"; + break; + case 19: + name = "Kagera"; + break; + case 20: + name = "Pemba South"; + break; + case 21: + name = "Zanzibar Central"; + break; + case 22: + name = "Zanzibar North"; + break; + case 23: + name = "Dar es Salaam"; + break; + case 24: + name = "Rukwa"; + break; + case 25: + name = "Zanzibar Urban"; + break; + case 26: + name = "Arusha"; + break; + case 27: + name = "Manyara"; + break; + } + } + if (country_code.equals("UA") == true) { + switch (region_code2) { + case 1: + name = "Cherkas'ka Oblast'"; + break; + case 2: + name = "Chernihivs'ka Oblast'"; + break; + case 3: + name = "Chernivets'ka Oblast'"; + break; + case 4: + name = "Dnipropetrovs'ka Oblast'"; + break; + case 5: + name = "Donets'ka Oblast'"; + break; + case 6: + name = "Ivano-Frankivs'ka Oblast'"; + break; + case 7: + name = "Kharkivs'ka Oblast'"; + break; + case 8: + name = "Khersons'ka Oblast'"; + break; + case 9: + name = "Khmel'nyts'ka Oblast'"; + break; + case 10: + name = "Kirovohrads'ka Oblast'"; + break; + case 11: + name = "Krym"; + break; + case 12: + name = "Kyyiv"; + break; + case 13: + name = "Kyyivs'ka Oblast'"; + break; + case 14: + name = "Luhans'ka Oblast'"; + break; + case 15: + name = "L'vivs'ka Oblast'"; + break; + case 16: + name = "Mykolayivs'ka Oblast'"; + break; + case 17: + name = "Odes'ka Oblast'"; + break; + case 18: + name = "Poltavs'ka Oblast'"; + break; + case 19: + name = "Rivnens'ka Oblast'"; + break; + case 20: + name = "Sevastopol'"; + break; + case 21: + name = "Sums'ka Oblast'"; + break; + case 22: + name = "Ternopil's'ka Oblast'"; + break; + case 23: + name = "Vinnyts'ka Oblast'"; + break; + case 24: + name = "Volyns'ka Oblast'"; + break; + case 25: + name = "Zakarpats'ka Oblast'"; + break; + case 26: + name = "Zaporiz'ka Oblast'"; + break; + case 27: + name = "Zhytomyrs'ka Oblast'"; + break; + } + } + if (country_code.equals("UG") == true) { + switch (region_code2) { + case 5: + name = "Busoga"; + break; + case 8: + name = "Karamoja"; + break; + case 12: + name = "South Buganda"; + break; + case 18: + name = "Central"; + break; + case 20: + name = "Eastern"; + break; + case 21: + name = "Nile"; + break; + case 22: + name = "North Buganda"; + break; + case 23: + name = "Northern"; + break; + case 24: + name = "Southern"; + break; + case 25: + name = "Western"; + break; + case 33: + name = "Jinja"; + break; + case 36: + name = "Kalangala"; + break; + case 37: + name = "Kampala"; + break; + case 42: + name = "Kiboga"; + break; + case 52: + name = "Mbarara"; + break; + case 56: + name = "Mubende"; + break; + case 65: + name = "Adjumani"; + break; + case 66: + name = "Bugiri"; + break; + case 67: + name = "Busia"; + break; + case 69: + name = "Katakwi"; + break; + case 71: + name = "Masaka"; + break; + case 73: + name = "Nakasongola"; + break; + case 74: + name = "Sembabule"; + break; + case 77: + name = "Arua"; + break; + case 78: + name = "Iganga"; + break; + case 79: + name = "Kabarole"; + break; + case 80: + name = "Kaberamaido"; + break; + case 81: + name = "Kamwenge"; + break; + case 82: + name = "Kanungu"; + break; + case 83: + name = "Kayunga"; + break; + case 84: + name = "Kitgum"; + break; + case 85: + name = "Kyenjojo"; + break; + case 86: + name = "Mayuge"; + break; + case 87: + name = "Mbale"; + break; + case 88: + name = "Moroto"; + break; + case 89: + name = "Mpigi"; + break; + case 90: + name = "Mukono"; + break; + case 91: + name = "Nakapiripirit"; + break; + case 92: + name = "Pader"; + break; + case 93: + name = "Rukungiri"; + break; + case 94: + name = "Sironko"; + break; + case 95: + name = "Soroti"; + break; + case 96: + name = "Wakiso"; + break; + case 97: + name = "Yumbe"; + break; + } + } + if (country_code.equals("UY") == true) { + switch (region_code2) { + case 1: + name = "Artigas"; + break; + case 2: + name = "Canelones"; + break; + case 3: + name = "Cerro Largo"; + break; + case 4: + name = "Colonia"; + break; + case 5: + name = "Durazno"; + break; + case 6: + name = "Flores"; + break; + case 7: + name = "Florida"; + break; + case 8: + name = "Lavalleja"; + break; + case 9: + name = "Maldonado"; + break; + case 10: + name = "Montevideo"; + break; + case 11: + name = "Paysandu"; + break; + case 12: + name = "Rio Negro"; + break; + case 13: + name = "Rivera"; + break; + case 14: + name = "Rocha"; + break; + case 15: + name = "Salto"; + break; + case 16: + name = "San Jose"; + break; + case 17: + name = "Soriano"; + break; + case 18: + name = "Tacuarembo"; + break; + case 19: + name = "Treinta y Tres"; + break; + } + } + if (country_code.equals("UZ") == true) { + switch (region_code2) { + case 1: + name = "Andijon"; + break; + case 2: + name = "Bukhoro"; + break; + case 3: + name = "Farghona"; + break; + case 4: + name = "Jizzakh"; + break; + case 5: + name = "Khorazm"; + break; + case 6: + name = "Namangan"; + break; + case 7: + name = "Nawoiy"; + break; + case 8: + name = "Qashqadaryo"; + break; + case 9: + name = "Qoraqalpoghiston"; + break; + case 10: + name = "Samarqand"; + break; + case 11: + name = "Sirdaryo"; + break; + case 12: + name = "Surkhondaryo"; + break; + case 13: + name = "Toshkent"; + break; + case 14: + name = "Toshkent"; + break; + } + } + if (country_code.equals("VC") == true) { + switch (region_code2) { + case 1: + name = "Charlotte"; + break; + case 2: + name = "Saint Andrew"; + break; + case 3: + name = "Saint David"; + break; + case 4: + name = "Saint George"; + break; + case 5: + name = "Saint Patrick"; + break; + case 6: + name = "Grenadines"; + break; + } + } + if (country_code.equals("VE") == true) { + switch (region_code2) { + case 1: + name = "Amazonas"; + break; + case 2: + name = "Anzoategui"; + break; + case 3: + name = "Apure"; + break; + case 4: + name = "Aragua"; + break; + case 5: + name = "Barinas"; + break; + case 6: + name = "Bolivar"; + break; + case 7: + name = "Carabobo"; + break; + case 8: + name = "Cojedes"; + break; + case 9: + name = "Delta Amacuro"; + break; + case 11: + name = "Falcon"; + break; + case 12: + name = "Guarico"; + break; + case 13: + name = "Lara"; + break; + case 14: + name = "Merida"; + break; + case 15: + name = "Miranda"; + break; + case 16: + name = "Monagas"; + break; + case 17: + name = "Nueva Esparta"; + break; + case 18: + name = "Portuguesa"; + break; + case 19: + name = "Sucre"; + break; + case 20: + name = "Tachira"; + break; + case 21: + name = "Trujillo"; + break; + case 22: + name = "Yaracuy"; + break; + case 23: + name = "Zulia"; + break; + case 24: + name = "Dependencias Federales"; + break; + case 25: + name = "Distrito Federal"; + break; + case 26: + name = "Vargas"; + break; + } + } + if (country_code.equals("VN") == true) { + switch (region_code2) { + case 1: + name = "An Giang"; + break; + case 2: + name = "Bac Thai"; + break; + case 3: + name = "Ben Tre"; + break; + case 4: + name = "Binh Tri Thien"; + break; + case 5: + name = "Cao Bang"; + break; + case 6: + name = "Cuu Long"; + break; + case 7: + name = "Dac Lac"; + break; + case 9: + name = "Dong Thap"; + break; + case 11: + name = "Ha Bac"; + break; + case 12: + name = "Hai Hung"; + break; + case 13: + name = "Hai Phong"; + break; + case 14: + name = "Ha Nam Ninh"; + break; + case 15: + name = "Ha Noi"; + break; + case 16: + name = "Ha Son Binh"; + break; + case 17: + name = "Ha Tuyen"; + break; + case 19: + name = "Hoang Lien Son"; + break; + case 20: + name = "Ho Chi Minh"; + break; + case 21: + name = "Kien Giang"; + break; + case 22: + name = "Lai Chau"; + break; + case 23: + name = "Lam Dong"; + break; + case 24: + name = "Long An"; + break; + case 25: + name = "Minh Hai"; + break; + case 26: + name = "Nghe Tinh"; + break; + case 27: + name = "Nghia Binh"; + break; + case 28: + name = "Phu Khanh"; + break; + case 29: + name = "Quang Nam-Da Nang"; + break; + case 30: + name = "Quang Ninh"; + break; + case 31: + name = "Song Be"; + break; + case 32: + name = "Son La"; + break; + case 33: + name = "Tay Ninh"; + break; + case 34: + name = "Thanh Hoa"; + break; + case 35: + name = "Thai Binh"; + break; + case 36: + name = "Thuan Hai"; + break; + case 37: + name = "Tien Giang"; + break; + case 38: + name = "Vinh Phu"; + break; + case 39: + name = "Lang Son"; + break; + case 40: + name = "Dong Nai"; + break; + case 43: + name = "An Giang"; + break; + case 44: + name = "Dac Lac"; + break; + case 45: + name = "Dong Nai"; + break; + case 46: + name = "Dong Thap"; + break; + case 47: + name = "Kien Giang"; + break; + case 48: + name = "Minh Hai"; + break; + case 49: + name = "Song Be"; + break; + case 50: + name = "Vinh Phu"; + break; + case 51: + name = "Ha Noi"; + break; + case 52: + name = "Ho Chi Minh"; + break; + case 53: + name = "Ba Ria-Vung Tau"; + break; + case 54: + name = "Binh Dinh"; + break; + case 55: + name = "Binh Thuan"; + break; + case 56: + name = "Can Tho"; + break; + case 57: + name = "Gia Lai"; + break; + case 58: + name = "Ha Giang"; + break; + case 59: + name = "Ha Tay"; + break; + case 60: + name = "Ha Tinh"; + break; + case 61: + name = "Hoa Binh"; + break; + case 62: + name = "Khanh Hoa"; + break; + case 63: + name = "Kon Tum"; + break; + case 64: + name = "Quang Tri"; + break; + case 65: + name = "Nam Ha"; + break; + case 66: + name = "Nghe An"; + break; + case 67: + name = "Ninh Binh"; + break; + case 68: + name = "Ninh Thuan"; + break; + case 69: + name = "Phu Yen"; + break; + case 70: + name = "Quang Binh"; + break; + case 71: + name = "Quang Ngai"; + break; + case 72: + name = "Quang Tri"; + break; + case 73: + name = "Soc Trang"; + break; + case 74: + name = "Thua Thien"; + break; + case 75: + name = "Tra Vinh"; + break; + case 76: + name = "Tuyen Quang"; + break; + case 77: + name = "Vinh Long"; + break; + case 78: + name = "Da Nang"; + break; + case 79: + name = "Hai Duong"; + break; + case 80: + name = "Ha Nam"; + break; + case 81: + name = "Hung Yen"; + break; + case 82: + name = "Nam Dinh"; + break; + case 83: + name = "Phu Tho"; + break; + case 84: + name = "Quang Nam"; + break; + case 85: + name = "Thai Nguyen"; + break; + case 86: + name = "Vinh Puc Province"; + break; + case 87: + name = "Can Tho"; + break; + case 88: + name = "Dak Lak"; + break; + case 89: + name = "Lai Chau"; + break; + case 90: + name = "Lao Cai"; + break; + case 91: + name = "Dak Nong"; + break; + case 92: + name = "Dien Bien"; + break; + case 93: + name = "Hau Giang"; + break; + } + } + if (country_code.equals("VU") == true) { + switch (region_code2) { + case 5: + name = "Ambrym"; + break; + case 6: + name = "Aoba"; + break; + case 7: + name = "Torba"; + break; + case 8: + name = "Efate"; + break; + case 9: + name = "Epi"; + break; + case 10: + name = "Malakula"; + break; + case 11: + name = "Paama"; + break; + case 12: + name = "Pentecote"; + break; + case 13: + name = "Sanma"; + break; + case 14: + name = "Shepherd"; + break; + case 15: + name = "Tafea"; + break; + case 16: + name = "Malampa"; + break; + case 17: + name = "Penama"; + break; + case 18: + name = "Shefa"; + break; + } + } + if (country_code.equals("WS") == true) { + switch (region_code2) { + case 2: + name = "Aiga-i-le-Tai"; + break; + case 3: + name = "Atua"; + break; + case 4: + name = "Fa"; + break; + case 5: + name = "Gaga"; + break; + case 6: + name = "Va"; + break; + case 7: + name = "Gagaifomauga"; + break; + case 8: + name = "Palauli"; + break; + case 9: + name = "Satupa"; + break; + case 10: + name = "Tuamasaga"; + break; + case 11: + name = "Vaisigano"; + break; + } + } + if (country_code.equals("YE") == true) { + switch (region_code2) { + case 1: + name = "Abyan"; + break; + case 2: + name = "Adan"; + break; + case 3: + name = "Al Mahrah"; + break; + case 4: + name = "Hadramawt"; + break; + case 5: + name = "Shabwah"; + break; + case 6: + name = "Al Ghaydah"; + break; + case 8: + name = "Al Hudaydah"; + break; + case 10: + name = "Al Mahwit"; + break; + case 11: + name = "Dhamar"; + break; + case 14: + name = "Ma'rib"; + break; + case 15: + name = "Sa"; + break; + case 16: + name = "San"; + break; + case 20: + name = "Al Bayda'"; + break; + case 21: + name = "Al Jawf"; + break; + case 22: + name = "Hajjah"; + break; + case 23: + name = "Ibb"; + break; + case 24: + name = "Lahij"; + break; + case 25: + name = "Ta"; + break; + } + } + if (country_code.equals("ZA") == true) { + switch (region_code2) { + case 1: + name = "North-Western Province"; + break; + case 2: + name = "KwaZulu-Natal"; + break; + case 3: + name = "Free State"; + break; + case 5: + name = "Eastern Cape"; + break; + case 6: + name = "Gauteng"; + break; + case 7: + name = "Mpumalanga"; + break; + case 8: + name = "Northern Cape"; + break; + case 9: + name = "Limpopo"; + break; + case 10: + name = "North-West"; + break; + case 11: + name = "Western Cape"; + break; + } + } + if (country_code.equals("ZM") == true) { + switch (region_code2) { + case 1: + name = "Western"; + break; + case 2: + name = "Central"; + break; + case 3: + name = "Eastern"; + break; + case 4: + name = "Luapula"; + break; + case 5: + name = "Northern"; + break; + case 6: + name = "North-Western"; + break; + case 7: + name = "Southern"; + break; + case 8: + name = "Copperbelt"; + break; + case 9: + name = "Lusaka"; + break; + } + } + if (country_code.equals("ZW") == true) { + switch (region_code2) { + case 1: + name = "Manicaland"; + break; + case 2: + name = "Midlands"; + break; + case 3: + name = "Mashonaland Central"; + break; + case 4: + name = "Mashonaland East"; + break; + case 5: + name = "Mashonaland West"; + break; + case 6: + name = "Matabeleland North"; + break; + case 7: + name = "Matabeleland South"; + break; + case 8: + name = "Masvingo"; + break; + case 9: + name = "Bulawayo"; + break; + case 10: + name = "Harare"; + break; + } + } + return name; + } +} diff --git a/EssentialsGeoIP/src/com/maxmind/geoip/timeZone.java b/EssentialsGeoIP/src/com/maxmind/geoip/timeZone.java new file mode 100644 index 000000000..c47802a8e --- /dev/null +++ b/EssentialsGeoIP/src/com/maxmind/geoip/timeZone.java @@ -0,0 +1,1403 @@ +package com.maxmind.geoip; +// generated automatically from admin/generate_timeZone.pl +public class timeZone { + static public String timeZoneByCountryAndRegion(String country,String region) { + String timezone = null; + if (country == null) { + return null; + } + if (region == null) { + region = ""; + } + if (country.equals("US") == true) { + if (region.equals("AL") == true) { + timezone = "America/Chicago"; + } else if (region.equals("AK") == true) { + timezone = "America/Anchorage"; + } else if (region.equals("AZ") == true) { + timezone = "America/Phoenix"; + } else if (region.equals("AR") == true) { + timezone = "America/Chicago"; + } else if (region.equals("CA") == true) { + timezone = "America/Los_Angeles"; + } else if (region.equals("CO") == true) { + timezone = "America/Denver"; + } else if (region.equals("CT") == true) { + timezone = "America/New_York"; + } else if (region.equals("DE") == true) { + timezone = "America/New_York"; + } else if (region.equals("DC") == true) { + timezone = "America/New_York"; + } else if (region.equals("FL") == true) { + timezone = "America/New_York"; + } else if (region.equals("GA") == true) { + timezone = "America/New_York"; + } else if (region.equals("HI") == true) { + timezone = "Pacific/Honolulu"; + } else if (region.equals("ID") == true) { + timezone = "America/Denver"; + } else if (region.equals("IL") == true) { + timezone = "America/Chicago"; + } else if (region.equals("IN") == true) { + timezone = "America/Indianapolis"; + } else if (region.equals("IA") == true) { + timezone = "America/Chicago"; + } else if (region.equals("KS") == true) { + timezone = "America/Chicago"; + } else if (region.equals("KY") == true) { + timezone = "America/New_York"; + } else if (region.equals("LA") == true) { + timezone = "America/Chicago"; + } else if (region.equals("ME") == true) { + timezone = "America/New_York"; + } else if (region.equals("MD") == true) { + timezone = "America/New_York"; + } else if (region.equals("MA") == true) { + timezone = "America/New_York"; + } else if (region.equals("MI") == true) { + timezone = "America/New_York"; + } else if (region.equals("MN") == true) { + timezone = "America/Chicago"; + } else if (region.equals("MS") == true) { + timezone = "America/Chicago"; + } else if (region.equals("MO") == true) { + timezone = "America/Chicago"; + } else if (region.equals("MT") == true) { + timezone = "America/Denver"; + } else if (region.equals("NE") == true) { + timezone = "America/Chicago"; + } else if (region.equals("NV") == true) { + timezone = "America/Los_Angeles"; + } else if (region.equals("NH") == true) { + timezone = "America/New_York"; + } else if (region.equals("NJ") == true) { + timezone = "America/New_York"; + } else if (region.equals("NM") == true) { + timezone = "America/Denver"; + } else if (region.equals("NY") == true) { + timezone = "America/New_York"; + } else if (region.equals("NC") == true) { + timezone = "America/New_York"; + } else if (region.equals("ND") == true) { + timezone = "America/Chicago"; + } else if (region.equals("OH") == true) { + timezone = "America/New_York"; + } else if (region.equals("OK") == true) { + timezone = "America/Chicago"; + } else if (region.equals("OR") == true) { + timezone = "America/Los_Angeles"; + } else if (region.equals("PA") == true) { + timezone = "America/New_York"; + } else if (region.equals("RI") == true) { + timezone = "America/New_York"; + } else if (region.equals("SC") == true) { + timezone = "America/New_York"; + } else if (region.equals("SD") == true) { + timezone = "America/Chicago"; + } else if (region.equals("TN") == true) { + timezone = "America/Chicago"; + } else if (region.equals("TX") == true) { + timezone = "America/Chicago"; + } else if (region.equals("UT") == true) { + timezone = "America/Denver"; + } else if (region.equals("VT") == true) { + timezone = "America/New_York"; + } else if (region.equals("VA") == true) { + timezone = "America/New_York"; + } else if (region.equals("WA") == true) { + timezone = "America/Los_Angeles"; + } else if (region.equals("WV") == true) { + timezone = "America/New_York"; + } else if (region.equals("WI") == true) { + timezone = "America/Chicago"; + } else if (region.equals("WY") == true) { + timezone = "America/Denver"; + } + } else if (country.equals("CA") == true) { + if (region.equals("AB") == true) { + timezone = "America/Edmonton"; + } else if (region.equals("BC") == true) { + timezone = "America/Vancouver"; + } else if (region.equals("MB") == true) { + timezone = "America/Winnipeg"; + } else if (region.equals("NB") == true) { + timezone = "America/Halifax"; + } else if (region.equals("NL") == true) { + timezone = "America/St_Johns"; + } else if (region.equals("NT") == true) { + timezone = "America/Yellowknife"; + } else if (region.equals("NS") == true) { + timezone = "America/Halifax"; + } else if (region.equals("NU") == true) { + timezone = "America/Rankin_Inlet"; + } else if (region.equals("ON") == true) { + timezone = "America/Rainy_River"; + } else if (region.equals("PE") == true) { + timezone = "America/Halifax"; + } else if (region.equals("QC") == true) { + timezone = "America/Montreal"; + } else if (region.equals("SK") == true) { + timezone = "America/Regina"; + } else if (region.equals("YT") == true) { + timezone = "America/Whitehorse"; + } + } else if (country.equals("AU") == true) { + if (region.equals("01") == true) { + timezone = "Australia/Canberra"; + } else if (region.equals("02") == true) { + timezone = "Australia/NSW"; + } else if (region.equals("03") == true) { + timezone = "Australia/North"; + } else if (region.equals("04") == true) { + timezone = "Australia/Queensland"; + } else if (region.equals("05") == true) { + timezone = "Australia/South"; + } else if (region.equals("06") == true) { + timezone = "Australia/Tasmania"; + } else if (region.equals("07") == true) { + timezone = "Australia/Victoria"; + } else if (region.equals("08") == true) { + timezone = "Australia/West"; + } + } else if (country.equals("AS") == true) { + timezone = "US/Samoa"; + } else if (country.equals("CI") == true) { + timezone = "Africa/Abidjan"; + } else if (country.equals("GH") == true) { + timezone = "Africa/Accra"; + } else if (country.equals("DZ") == true) { + timezone = "Africa/Algiers"; + } else if (country.equals("ER") == true) { + timezone = "Africa/Asmera"; + } else if (country.equals("ML") == true) { + timezone = "Africa/Bamako"; + } else if (country.equals("CF") == true) { + timezone = "Africa/Bangui"; + } else if (country.equals("GM") == true) { + timezone = "Africa/Banjul"; + } else if (country.equals("GW") == true) { + timezone = "Africa/Bissau"; + } else if (country.equals("CG") == true) { + timezone = "Africa/Brazzaville"; + } else if (country.equals("BI") == true) { + timezone = "Africa/Bujumbura"; + } else if (country.equals("EG") == true) { + timezone = "Africa/Cairo"; + } else if (country.equals("MA") == true) { + timezone = "Africa/Casablanca"; + } else if (country.equals("GN") == true) { + timezone = "Africa/Conakry"; + } else if (country.equals("SN") == true) { + timezone = "Africa/Dakar"; + } else if (country.equals("DJ") == true) { + timezone = "Africa/Djibouti"; + } else if (country.equals("SL") == true) { + timezone = "Africa/Freetown"; + } else if (country.equals("BW") == true) { + timezone = "Africa/Gaborone"; + } else if (country.equals("ZW") == true) { + timezone = "Africa/Harare"; + } else if (country.equals("ZA") == true) { + timezone = "Africa/Johannesburg"; + } else if (country.equals("UG") == true) { + timezone = "Africa/Kampala"; + } else if (country.equals("SD") == true) { + timezone = "Africa/Khartoum"; + } else if (country.equals("RW") == true) { + timezone = "Africa/Kigali"; + } else if (country.equals("NG") == true) { + timezone = "Africa/Lagos"; + } else if (country.equals("GA") == true) { + timezone = "Africa/Libreville"; + } else if (country.equals("TG") == true) { + timezone = "Africa/Lome"; + } else if (country.equals("AO") == true) { + timezone = "Africa/Luanda"; + } else if (country.equals("ZM") == true) { + timezone = "Africa/Lusaka"; + } else if (country.equals("GQ") == true) { + timezone = "Africa/Malabo"; + } else if (country.equals("MZ") == true) { + timezone = "Africa/Maputo"; + } else if (country.equals("LS") == true) { + timezone = "Africa/Maseru"; + } else if (country.equals("SZ") == true) { + timezone = "Africa/Mbabane"; + } else if (country.equals("SO") == true) { + timezone = "Africa/Mogadishu"; + } else if (country.equals("LR") == true) { + timezone = "Africa/Monrovia"; + } else if (country.equals("KE") == true) { + timezone = "Africa/Nairobi"; + } else if (country.equals("TD") == true) { + timezone = "Africa/Ndjamena"; + } else if (country.equals("NE") == true) { + timezone = "Africa/Niamey"; + } else if (country.equals("MR") == true) { + timezone = "Africa/Nouakchott"; + } else if (country.equals("BF") == true) { + timezone = "Africa/Ouagadougou"; + } else if (country.equals("ST") == true) { + timezone = "Africa/Sao_Tome"; + } else if (country.equals("LY") == true) { + timezone = "Africa/Tripoli"; + } else if (country.equals("TN") == true) { + timezone = "Africa/Tunis"; + } else if (country.equals("AI") == true) { + timezone = "America/Anguilla"; + } else if (country.equals("AG") == true) { + timezone = "America/Antigua"; + } else if (country.equals("AW") == true) { + timezone = "America/Aruba"; + } else if (country.equals("BB") == true) { + timezone = "America/Barbados"; + } else if (country.equals("BZ") == true) { + timezone = "America/Belize"; + } else if (country.equals("CO") == true) { + timezone = "America/Bogota"; + } else if (country.equals("VE") == true) { + timezone = "America/Caracas"; + } else if (country.equals("KY") == true) { + timezone = "America/Cayman"; + } else if (country.equals("CR") == true) { + timezone = "America/Costa_Rica"; + } else if (country.equals("DM") == true) { + timezone = "America/Dominica"; + } else if (country.equals("SV") == true) { + timezone = "America/El_Salvador"; + } else if (country.equals("GD") == true) { + timezone = "America/Grenada"; + } else if (country.equals("FR") == true) { + timezone = "Europe/Paris"; + } else if (country.equals("GP") == true) { + timezone = "America/Guadeloupe"; + } else if (country.equals("GT") == true) { + timezone = "America/Guatemala"; + } else if (country.equals("GY") == true) { + timezone = "America/Guyana"; + } else if (country.equals("CU") == true) { + timezone = "America/Havana"; + } else if (country.equals("JM") == true) { + timezone = "America/Jamaica"; + } else if (country.equals("BO") == true) { + timezone = "America/La_Paz"; + } else if (country.equals("PE") == true) { + timezone = "America/Lima"; + } else if (country.equals("NI") == true) { + timezone = "America/Managua"; + } else if (country.equals("MQ") == true) { + timezone = "America/Martinique"; + } else if (country.equals("UY") == true) { + timezone = "America/Montevideo"; + } else if (country.equals("MS") == true) { + timezone = "America/Montserrat"; + } else if (country.equals("BS") == true) { + timezone = "America/Nassau"; + } else if (country.equals("PA") == true) { + timezone = "America/Panama"; + } else if (country.equals("SR") == true) { + timezone = "America/Paramaribo"; + } else if (country.equals("PR") == true) { + timezone = "America/Puerto_Rico"; + } else if (country.equals("KN") == true) { + timezone = "America/St_Kitts"; + } else if (country.equals("LC") == true) { + timezone = "America/St_Lucia"; + } else if (country.equals("VC") == true) { + timezone = "America/St_Vincent"; + } else if (country.equals("HN") == true) { + timezone = "America/Tegucigalpa"; + } else if (country.equals("YE") == true) { + timezone = "Asia/Aden"; + } else if (country.equals("JO") == true) { + timezone = "Asia/Amman"; + } else if (country.equals("TM") == true) { + timezone = "Asia/Ashgabat"; + } else if (country.equals("IQ") == true) { + timezone = "Asia/Baghdad"; + } else if (country.equals("BH") == true) { + timezone = "Asia/Bahrain"; + } else if (country.equals("AZ") == true) { + timezone = "Asia/Baku"; + } else if (country.equals("TH") == true) { + timezone = "Asia/Bangkok"; + } else if (country.equals("LB") == true) { + timezone = "Asia/Beirut"; + } else if (country.equals("KG") == true) { + timezone = "Asia/Bishkek"; + } else if (country.equals("BN") == true) { + timezone = "Asia/Brunei"; + } else if (country.equals("IN") == true) { + timezone = "Asia/Calcutta"; + } else if (country.equals("MN") == true) { + timezone = "Asia/Choibalsan"; + } else if (country.equals("LK") == true) { + timezone = "Asia/Colombo"; + } else if (country.equals("BD") == true) { + timezone = "Asia/Dhaka"; + } else if (country.equals("AE") == true) { + timezone = "Asia/Dubai"; + } else if (country.equals("TJ") == true) { + timezone = "Asia/Dushanbe"; + } else if (country.equals("HK") == true) { + timezone = "Asia/Hong_Kong"; + } else if (country.equals("TR") == true) { + timezone = "Asia/Istanbul"; + } else if (country.equals("IL") == true) { + timezone = "Asia/Jerusalem"; + } else if (country.equals("AF") == true) { + timezone = "Asia/Kabul"; + } else if (country.equals("PK") == true) { + timezone = "Asia/Karachi"; + } else if (country.equals("NP") == true) { + timezone = "Asia/Katmandu"; + } else if (country.equals("KW") == true) { + timezone = "Asia/Kuwait"; + } else if (country.equals("MO") == true) { + timezone = "Asia/Macao"; + } else if (country.equals("PH") == true) { + timezone = "Asia/Manila"; + } else if (country.equals("OM") == true) { + timezone = "Asia/Muscat"; + } else if (country.equals("CY") == true) { + timezone = "Asia/Nicosia"; + } else if (country.equals("KP") == true) { + timezone = "Asia/Pyongyang"; + } else if (country.equals("QA") == true) { + timezone = "Asia/Qatar"; + } else if (country.equals("MM") == true) { + timezone = "Asia/Rangoon"; + } else if (country.equals("SA") == true) { + timezone = "Asia/Riyadh"; + } else if (country.equals("KR") == true) { + timezone = "Asia/Seoul"; + } else if (country.equals("SG") == true) { + timezone = "Asia/Singapore"; + } else if (country.equals("TW") == true) { + timezone = "Asia/Taipei"; + } else if (country.equals("GE") == true) { + timezone = "Asia/Tbilisi"; + } else if (country.equals("BT") == true) { + timezone = "Asia/Thimphu"; + } else if (country.equals("JP") == true) { + timezone = "Asia/Tokyo"; + } else if (country.equals("LA") == true) { + timezone = "Asia/Vientiane"; + } else if (country.equals("AM") == true) { + timezone = "Asia/Yerevan"; + } else if (country.equals("BM") == true) { + timezone = "Atlantic/Bermuda"; + } else if (country.equals("CV") == true) { + timezone = "Atlantic/Cape_Verde"; + } else if (country.equals("FO") == true) { + timezone = "Atlantic/Faeroe"; + } else if (country.equals("IS") == true) { + timezone = "Atlantic/Reykjavik"; + } else if (country.equals("GS") == true) { + timezone = "Atlantic/South_Georgia"; + } else if (country.equals("SH") == true) { + timezone = "Atlantic/St_Helena"; + } else if (country.equals("CL") == true) { + timezone = "Chile/Continental"; + } else if (country.equals("NL") == true) { + timezone = "Europe/Amsterdam"; + } else if (country.equals("AD") == true) { + timezone = "Europe/Andorra"; + } else if (country.equals("GR") == true) { + timezone = "Europe/Athens"; + } else if (country.equals("YU") == true) { + timezone = "Europe/Belgrade"; + } else if (country.equals("DE") == true) { + timezone = "Europe/Berlin"; + } else if (country.equals("SK") == true) { + timezone = "Europe/Bratislava"; + } else if (country.equals("BE") == true) { + timezone = "Europe/Brussels"; + } else if (country.equals("RO") == true) { + timezone = "Europe/Bucharest"; + } else if (country.equals("HU") == true) { + timezone = "Europe/Budapest"; + } else if (country.equals("DK") == true) { + timezone = "Europe/Copenhagen"; + } else if (country.equals("IE") == true) { + timezone = "Europe/Dublin"; + } else if (country.equals("GI") == true) { + timezone = "Europe/Gibraltar"; + } else if (country.equals("FI") == true) { + timezone = "Europe/Helsinki"; + } else if (country.equals("SI") == true) { + timezone = "Europe/Ljubljana"; + } else if (country.equals("GB") == true) { + timezone = "Europe/London"; + } else if (country.equals("LU") == true) { + timezone = "Europe/Luxembourg"; + } else if (country.equals("MT") == true) { + timezone = "Europe/Malta"; + } else if (country.equals("BY") == true) { + timezone = "Europe/Minsk"; + } else if (country.equals("MC") == true) { + timezone = "Europe/Monaco"; + } else if (country.equals("NO") == true) { + timezone = "Europe/Oslo"; + } else if (country.equals("CZ") == true) { + timezone = "Europe/Prague"; + } else if (country.equals("LV") == true) { + timezone = "Europe/Riga"; + } else if (country.equals("IT") == true) { + timezone = "Europe/Rome"; + } else if (country.equals("SM") == true) { + timezone = "Europe/San_Marino"; + } else if (country.equals("BA") == true) { + timezone = "Europe/Sarajevo"; + } else if (country.equals("MK") == true) { + timezone = "Europe/Skopje"; + } else if (country.equals("BG") == true) { + timezone = "Europe/Sofia"; + } else if (country.equals("SE") == true) { + timezone = "Europe/Stockholm"; + } else if (country.equals("EE") == true) { + timezone = "Europe/Tallinn"; + } else if (country.equals("AL") == true) { + timezone = "Europe/Tirane"; + } else if (country.equals("LI") == true) { + timezone = "Europe/Vaduz"; + } else if (country.equals("VA") == true) { + timezone = "Europe/Vatican"; + } else if (country.equals("AT") == true) { + timezone = "Europe/Vienna"; + } else if (country.equals("LT") == true) { + timezone = "Europe/Vilnius"; + } else if (country.equals("PL") == true) { + timezone = "Europe/Warsaw"; + } else if (country.equals("HR") == true) { + timezone = "Europe/Zagreb"; + } else if (country.equals("IR") == true) { + timezone = "Asia/Tehran"; + } else if (country.equals("MG") == true) { + timezone = "Indian/Antananarivo"; + } else if (country.equals("CX") == true) { + timezone = "Indian/Christmas"; + } else if (country.equals("CC") == true) { + timezone = "Indian/Cocos"; + } else if (country.equals("KM") == true) { + timezone = "Indian/Comoro"; + } else if (country.equals("MV") == true) { + timezone = "Indian/Maldives"; + } else if (country.equals("MU") == true) { + timezone = "Indian/Mauritius"; + } else if (country.equals("YT") == true) { + timezone = "Indian/Mayotte"; + } else if (country.equals("RE") == true) { + timezone = "Indian/Reunion"; + } else if (country.equals("FJ") == true) { + timezone = "Pacific/Fiji"; + } else if (country.equals("TV") == true) { + timezone = "Pacific/Funafuti"; + } else if (country.equals("GU") == true) { + timezone = "Pacific/Guam"; + } else if (country.equals("NR") == true) { + timezone = "Pacific/Nauru"; + } else if (country.equals("NU") == true) { + timezone = "Pacific/Niue"; + } else if (country.equals("NF") == true) { + timezone = "Pacific/Norfolk"; + } else if (country.equals("PW") == true) { + timezone = "Pacific/Palau"; + } else if (country.equals("PN") == true) { + timezone = "Pacific/Pitcairn"; + } else if (country.equals("CK") == true) { + timezone = "Pacific/Rarotonga"; + } else if (country.equals("WS") == true) { + timezone = "Pacific/Samoa"; + } else if (country.equals("KI") == true) { + timezone = "Pacific/Tarawa"; + } else if (country.equals("TO") == true) { + timezone = "Pacific/Tongatapu"; + } else if (country.equals("WF") == true) { + timezone = "Pacific/Wallis"; + } else if (country.equals("TZ") == true) { + timezone = "Africa/Dar_es_Salaam"; + } else if (country.equals("VN") == true) { + timezone = "Asia/Phnom_Penh"; + } else if (country.equals("KH") == true) { + timezone = "Asia/Phnom_Penh"; + } else if (country.equals("CM") == true) { + timezone = "Africa/Lagos"; + } else if (country.equals("DO") == true) { + timezone = "America/Santo_Domingo"; + } else if (country.equals("ET") == true) { + timezone = "Africa/Addis_Ababa"; + } else if (country.equals("FX") == true) { + timezone = "Europe/Paris"; + } else if (country.equals("HT") == true) { + timezone = "America/Port-au-Prince"; + } else if (country.equals("CH") == true) { + timezone = "Europe/Zurich"; + } else if (country.equals("AN") == true) { + timezone = "America/Curacao"; + } else if (country.equals("BJ") == true) { + timezone = "Africa/Porto-Novo"; + } else if (country.equals("EH") == true) { + timezone = "Africa/El_Aaiun"; + } else if (country.equals("FK") == true) { + timezone = "Atlantic/Stanley"; + } else if (country.equals("GF") == true) { + timezone = "America/Cayenne"; + } else if (country.equals("IO") == true) { + timezone = "Indian/Chagos"; + } else if (country.equals("MD") == true) { + timezone = "Europe/Chisinau"; + } else if (country.equals("MP") == true) { + timezone = "Pacific/Saipan"; + } else if (country.equals("MW") == true) { + timezone = "Africa/Blantyre"; + } else if (country.equals("NA") == true) { + timezone = "Africa/Windhoek"; + } else if (country.equals("NC") == true) { + timezone = "Pacific/Noumea"; + } else if (country.equals("PG") == true) { + timezone = "Pacific/Port_Moresby"; + } else if (country.equals("PM") == true) { + timezone = "America/Miquelon"; + } else if (country.equals("PS") == true) { + timezone = "Asia/Gaza"; + } else if (country.equals("PY") == true) { + timezone = "America/Asuncion"; + } else if (country.equals("SB") == true) { + timezone = "Pacific/Guadalcanal"; + } else if (country.equals("SC") == true) { + timezone = "Indian/Mahe"; + } else if (country.equals("SJ") == true) { + timezone = "Arctic/Longyearbyen"; + } else if (country.equals("SY") == true) { + timezone = "Asia/Damascus"; + } else if (country.equals("TC") == true) { + timezone = "America/Grand_Turk"; + } else if (country.equals("TF") == true) { + timezone = "Indian/Kerguelen"; + } else if (country.equals("TK") == true) { + timezone = "Pacific/Fakaofo"; + } else if (country.equals("TT") == true) { + timezone = "America/Port_of_Spain"; + } else if (country.equals("VG") == true) { + timezone = "America/Tortola"; + } else if (country.equals("VI") == true) { + timezone = "America/St_Thomas"; + } else if (country.equals("VU") == true) { + timezone = "Pacific/Efate"; + } else if (country.equals("RS") == true) { + timezone = "Europe/Belgrade"; + } else if (country.equals("ME") == true) { + timezone = "Europe/Podgorica"; + } else if (country.equals("AX") == true) { + timezone = "Europe/Mariehamn"; + } else if (country.equals("GG") == true) { + timezone = "Europe/Guernsey"; + } else if (country.equals("IM") == true) { + timezone = "Europe/Isle_of_Man"; + } else if (country.equals("JE") == true) { + timezone = "Europe/Jersey"; + } else if (country.equals("BL") == true) { + timezone = "America/St_Barthelemy"; + } else if (country.equals("MF") == true) { + timezone = "America/Marigot"; + } else if (country.equals("AR") == true) { + if (region.equals("01") == true) { + timezone = "America/Argentina/Buenos_Aires"; + } else if (region.equals("02") == true) { + timezone = "America/Argentina/Catamarca"; + } else if (region.equals("03") == true) { + timezone = "America/Argentina/Tucuman"; + } else if (region.equals("04") == true) { + timezone = "America/Argentina/Rio_Gallegos"; + } else if (region.equals("05") == true) { + timezone = "America/Argentina/Cordoba"; + } else if (region.equals("06") == true) { + timezone = "America/Argentina/Tucuman"; + } else if (region.equals("07") == true) { + timezone = "America/Argentina/Buenos_Aires"; + } else if (region.equals("08") == true) { + timezone = "America/Argentina/Buenos_Aires"; + } else if (region.equals("09") == true) { + timezone = "America/Argentina/Tucuman"; + } else if (region.equals("10") == true) { + timezone = "America/Argentina/Jujuy"; + } else if (region.equals("11") == true) { + timezone = "America/Argentina/San_Luis"; + } else if (region.equals("12") == true) { + timezone = "America/Argentina/La_Rioja"; + } else if (region.equals("13") == true) { + timezone = "America/Argentina/Mendoza"; + } else if (region.equals("14") == true) { + timezone = "America/Argentina/Buenos_Aires"; + } else if (region.equals("15") == true) { + timezone = "America/Argentina/San_Luis"; + } else if (region.equals("16") == true) { + timezone = "America/Argentina/Buenos_Aires"; + } else if (region.equals("17") == true) { + timezone = "America/Argentina/Salta"; + } else if (region.equals("18") == true) { + timezone = "America/Argentina/San_Juan"; + } else if (region.equals("19") == true) { + timezone = "America/Argentina/San_Luis"; + } else if (region.equals("20") == true) { + timezone = "America/Argentina/Rio_Gallegos"; + } else if (region.equals("21") == true) { + timezone = "America/Argentina/Buenos_Aires"; + } else if (region.equals("22") == true) { + timezone = "America/Argentina/Catamarca"; + } else if (region.equals("23") == true) { + timezone = "America/Argentina/Ushuaia"; + } else if (region.equals("24") == true) { + timezone = "America/Argentina/Tucuman"; + } + } else if (country.equals("BR") == true) { + if (region.equals("01") == true) { + timezone = "America/Rio_Branco"; + } else if (region.equals("02") == true) { + timezone = "America/Maceio"; + } else if (region.equals("03") == true) { + timezone = "America/Sao_Paulo"; + } else if (region.equals("04") == true) { + timezone = "America/Manaus"; + } else if (region.equals("05") == true) { + timezone = "America/Bahia"; + } else if (region.equals("06") == true) { + timezone = "America/Fortaleza"; + } else if (region.equals("07") == true) { + timezone = "America/Sao_Paulo"; + } else if (region.equals("08") == true) { + timezone = "America/Sao_Paulo"; + } else if (region.equals("11") == true) { + timezone = "America/Campo_Grande"; + } else if (region.equals("13") == true) { + timezone = "America/Belem"; + } else if (region.equals("14") == true) { + timezone = "America/Cuiaba"; + } else if (region.equals("15") == true) { + timezone = "America/Sao_Paulo"; + } else if (region.equals("16") == true) { + timezone = "America/Belem"; + } else if (region.equals("17") == true) { + timezone = "America/Recife"; + } else if (region.equals("18") == true) { + timezone = "America/Sao_Paulo"; + } else if (region.equals("20") == true) { + timezone = "America/Fortaleza"; + } else if (region.equals("21") == true) { + timezone = "America/Sao_Paulo"; + } else if (region.equals("22") == true) { + timezone = "America/Recife"; + } else if (region.equals("23") == true) { + timezone = "America/Sao_Paulo"; + } else if (region.equals("24") == true) { + timezone = "America/Porto_Velho"; + } else if (region.equals("25") == true) { + timezone = "America/Boa_Vista"; + } else if (region.equals("26") == true) { + timezone = "America/Sao_Paulo"; + } else if (region.equals("27") == true) { + timezone = "America/Sao_Paulo"; + } else if (region.equals("28") == true) { + timezone = "America/Maceio"; + } else if (region.equals("29") == true) { + timezone = "America/Sao_Paulo"; + } else if (region.equals("30") == true) { + timezone = "America/Recife"; + } else if (region.equals("31") == true) { + timezone = "America/Araguaina"; + } + } else if (country.equals("CD") == true) { + if (region.equals("02") == true) { + timezone = "Africa/Kinshasa"; + } else if (region.equals("05") == true) { + timezone = "Africa/Lubumbashi"; + } else if (region.equals("06") == true) { + timezone = "Africa/Kinshasa"; + } else if (region.equals("08") == true) { + timezone = "Africa/Kinshasa"; + } else if (region.equals("10") == true) { + timezone = "Africa/Lubumbashi"; + } else if (region.equals("11") == true) { + timezone = "Africa/Lubumbashi"; + } else if (region.equals("12") == true) { + timezone = "Africa/Lubumbashi"; + } + } else if (country.equals("CN") == true) { + if (region.equals("01") == true) { + timezone = "Asia/Shanghai"; + } else if (region.equals("02") == true) { + timezone = "Asia/Shanghai"; + } else if (region.equals("03") == true) { + timezone = "Asia/Shanghai"; + } else if (region.equals("04") == true) { + timezone = "Asia/Shanghai"; + } else if (region.equals("05") == true) { + timezone = "Asia/Harbin"; + } else if (region.equals("06") == true) { + timezone = "Asia/Chongqing"; + } else if (region.equals("07") == true) { + timezone = "Asia/Shanghai"; + } else if (region.equals("08") == true) { + timezone = "Asia/Harbin"; + } else if (region.equals("09") == true) { + timezone = "Asia/Shanghai"; + } else if (region.equals("10") == true) { + timezone = "Asia/Shanghai"; + } else if (region.equals("11") == true) { + timezone = "Asia/Chongqing"; + } else if (region.equals("12") == true) { + timezone = "Asia/Shanghai"; + } else if (region.equals("13") == true) { + timezone = "Asia/Urumqi"; + } else if (region.equals("14") == true) { + timezone = "Asia/Chongqing"; + } else if (region.equals("15") == true) { + timezone = "Asia/Chongqing"; + } else if (region.equals("16") == true) { + timezone = "Asia/Chongqing"; + } else if (region.equals("18") == true) { + timezone = "Asia/Chongqing"; + } else if (region.equals("19") == true) { + timezone = "Asia/Harbin"; + } else if (region.equals("20") == true) { + timezone = "Asia/Harbin"; + } else if (region.equals("21") == true) { + timezone = "Asia/Chongqing"; + } else if (region.equals("22") == true) { + timezone = "Asia/Harbin"; + } else if (region.equals("23") == true) { + timezone = "Asia/Shanghai"; + } else if (region.equals("24") == true) { + timezone = "Asia/Chongqing"; + } else if (region.equals("25") == true) { + timezone = "Asia/Shanghai"; + } else if (region.equals("26") == true) { + timezone = "Asia/Chongqing"; + } else if (region.equals("28") == true) { + timezone = "Asia/Shanghai"; + } else if (region.equals("29") == true) { + timezone = "Asia/Chongqing"; + } else if (region.equals("30") == true) { + timezone = "Asia/Chongqing"; + } else if (region.equals("31") == true) { + timezone = "Asia/Chongqing"; + } else if (region.equals("32") == true) { + timezone = "Asia/Chongqing"; + } else if (region.equals("33") == true) { + timezone = "Asia/Chongqing"; + } + } else if (country.equals("EC") == true) { + if (region.equals("01") == true) { + timezone = "Pacific/Galapagos"; + } else if (region.equals("02") == true) { + timezone = "America/Guayaquil"; + } else if (region.equals("03") == true) { + timezone = "America/Guayaquil"; + } else if (region.equals("04") == true) { + timezone = "America/Guayaquil"; + } else if (region.equals("05") == true) { + timezone = "America/Guayaquil"; + } else if (region.equals("06") == true) { + timezone = "America/Guayaquil"; + } else if (region.equals("07") == true) { + timezone = "America/Guayaquil"; + } else if (region.equals("08") == true) { + timezone = "America/Guayaquil"; + } else if (region.equals("09") == true) { + timezone = "America/Guayaquil"; + } else if (region.equals("10") == true) { + timezone = "America/Guayaquil"; + } else if (region.equals("11") == true) { + timezone = "America/Guayaquil"; + } else if (region.equals("12") == true) { + timezone = "America/Guayaquil"; + } else if (region.equals("13") == true) { + timezone = "America/Guayaquil"; + } else if (region.equals("14") == true) { + timezone = "America/Guayaquil"; + } else if (region.equals("15") == true) { + timezone = "America/Guayaquil"; + } else if (region.equals("17") == true) { + timezone = "America/Guayaquil"; + } else if (region.equals("18") == true) { + timezone = "America/Guayaquil"; + } else if (region.equals("19") == true) { + timezone = "America/Guayaquil"; + } else if (region.equals("20") == true) { + timezone = "America/Guayaquil"; + } else if (region.equals("22") == true) { + timezone = "America/Guayaquil"; + } + } else if (country.equals("ES") == true) { + if (region.equals("07") == true) { + timezone = "Europe/Madrid"; + } else if (region.equals("27") == true) { + timezone = "Europe/Madrid"; + } else if (region.equals("29") == true) { + timezone = "Europe/Madrid"; + } else if (region.equals("31") == true) { + timezone = "Europe/Madrid"; + } else if (region.equals("32") == true) { + timezone = "Europe/Madrid"; + } else if (region.equals("34") == true) { + timezone = "Europe/Madrid"; + } else if (region.equals("39") == true) { + timezone = "Europe/Madrid"; + } else if (region.equals("51") == true) { + timezone = "Africa/Ceuta"; + } else if (region.equals("52") == true) { + timezone = "Europe/Madrid"; + } else if (region.equals("53") == true) { + timezone = "Atlantic/Canary"; + } else if (region.equals("54") == true) { + timezone = "Europe/Madrid"; + } else if (region.equals("55") == true) { + timezone = "Europe/Madrid"; + } else if (region.equals("56") == true) { + timezone = "Europe/Madrid"; + } else if (region.equals("57") == true) { + timezone = "Europe/Madrid"; + } else if (region.equals("58") == true) { + timezone = "Europe/Madrid"; + } else if (region.equals("59") == true) { + timezone = "Europe/Madrid"; + } else if (region.equals("60") == true) { + timezone = "Europe/Madrid"; + } + } else if (country.equals("GL") == true) { + if (region.equals("01") == true) { + timezone = "America/Thule"; + } else if (region.equals("02") == true) { + timezone = "America/Godthab"; + } else if (region.equals("03") == true) { + timezone = "America/Godthab"; + } + } else if (country.equals("ID") == true) { + if (region.equals("01") == true) { + timezone = "Asia/Pontianak"; + } else if (region.equals("02") == true) { + timezone = "Asia/Makassar"; + } else if (region.equals("03") == true) { + timezone = "Asia/Jakarta"; + } else if (region.equals("04") == true) { + timezone = "Asia/Jakarta"; + } else if (region.equals("05") == true) { + timezone = "Asia/Jakarta"; + } else if (region.equals("06") == true) { + timezone = "Asia/Jakarta"; + } else if (region.equals("07") == true) { + timezone = "Asia/Jakarta"; + } else if (region.equals("08") == true) { + timezone = "Asia/Jakarta"; + } else if (region.equals("09") == true) { + timezone = "Asia/Jayapura"; + } else if (region.equals("10") == true) { + timezone = "Asia/Jakarta"; + } else if (region.equals("11") == true) { + timezone = "Asia/Pontianak"; + } else if (region.equals("12") == true) { + timezone = "Asia/Makassar"; + } else if (region.equals("13") == true) { + timezone = "Asia/Makassar"; + } else if (region.equals("14") == true) { + timezone = "Asia/Makassar"; + } else if (region.equals("15") == true) { + timezone = "Asia/Jakarta"; + } else if (region.equals("16") == true) { + timezone = "Asia/Makassar"; + } else if (region.equals("17") == true) { + timezone = "Asia/Makassar"; + } else if (region.equals("18") == true) { + timezone = "Asia/Makassar"; + } else if (region.equals("19") == true) { + timezone = "Asia/Pontianak"; + } else if (region.equals("20") == true) { + timezone = "Asia/Makassar"; + } else if (region.equals("21") == true) { + timezone = "Asia/Makassar"; + } else if (region.equals("22") == true) { + timezone = "Asia/Makassar"; + } else if (region.equals("23") == true) { + timezone = "Asia/Makassar"; + } else if (region.equals("24") == true) { + timezone = "Asia/Jakarta"; + } else if (region.equals("25") == true) { + timezone = "Asia/Pontianak"; + } else if (region.equals("26") == true) { + timezone = "Asia/Pontianak"; + } else if (region.equals("30") == true) { + timezone = "Asia/Jakarta"; + } else if (region.equals("31") == true) { + timezone = "Asia/Makassar"; + } else if (region.equals("33") == true) { + timezone = "Asia/Jakarta"; + } + } else if (country.equals("KZ") == true) { + if (region.equals("01") == true) { + timezone = "Asia/Almaty"; + } else if (region.equals("02") == true) { + timezone = "Asia/Almaty"; + } else if (region.equals("03") == true) { + timezone = "Asia/Qyzylorda"; + } else if (region.equals("04") == true) { + timezone = "Asia/Aqtobe"; + } else if (region.equals("05") == true) { + timezone = "Asia/Qyzylorda"; + } else if (region.equals("06") == true) { + timezone = "Asia/Aqtau"; + } else if (region.equals("07") == true) { + timezone = "Asia/Oral"; + } else if (region.equals("08") == true) { + timezone = "Asia/Qyzylorda"; + } else if (region.equals("09") == true) { + timezone = "Asia/Aqtau"; + } else if (region.equals("10") == true) { + timezone = "Asia/Qyzylorda"; + } else if (region.equals("11") == true) { + timezone = "Asia/Almaty"; + } else if (region.equals("12") == true) { + timezone = "Asia/Qyzylorda"; + } else if (region.equals("13") == true) { + timezone = "Asia/Aqtobe"; + } else if (region.equals("14") == true) { + timezone = "Asia/Qyzylorda"; + } else if (region.equals("15") == true) { + timezone = "Asia/Almaty"; + } else if (region.equals("16") == true) { + timezone = "Asia/Aqtobe"; + } else if (region.equals("17") == true) { + timezone = "Asia/Almaty"; + } + } else if (country.equals("MX") == true) { + if (region.equals("01") == true) { + timezone = "America/Mexico_City"; + } else if (region.equals("02") == true) { + timezone = "America/Tijuana"; + } else if (region.equals("03") == true) { + timezone = "America/Hermosillo"; + } else if (region.equals("04") == true) { + timezone = "America/Merida"; + } else if (region.equals("05") == true) { + timezone = "America/Mexico_City"; + } else if (region.equals("06") == true) { + timezone = "America/Chihuahua"; + } else if (region.equals("07") == true) { + timezone = "America/Monterrey"; + } else if (region.equals("08") == true) { + timezone = "America/Mexico_City"; + } else if (region.equals("09") == true) { + timezone = "America/Mexico_City"; + } else if (region.equals("10") == true) { + timezone = "America/Mazatlan"; + } else if (region.equals("11") == true) { + timezone = "America/Mexico_City"; + } else if (region.equals("12") == true) { + timezone = "America/Mexico_City"; + } else if (region.equals("13") == true) { + timezone = "America/Mexico_City"; + } else if (region.equals("14") == true) { + timezone = "America/Mazatlan"; + } else if (region.equals("15") == true) { + timezone = "America/Chihuahua"; + } else if (region.equals("16") == true) { + timezone = "America/Mexico_City"; + } else if (region.equals("17") == true) { + timezone = "America/Mexico_City"; + } else if (region.equals("18") == true) { + timezone = "America/Mazatlan"; + } else if (region.equals("19") == true) { + timezone = "America/Monterrey"; + } else if (region.equals("20") == true) { + timezone = "America/Mexico_City"; + } else if (region.equals("21") == true) { + timezone = "America/Mexico_City"; + } else if (region.equals("22") == true) { + timezone = "America/Mexico_City"; + } else if (region.equals("23") == true) { + timezone = "America/Cancun"; + } else if (region.equals("24") == true) { + timezone = "America/Mexico_City"; + } else if (region.equals("25") == true) { + timezone = "America/Mazatlan"; + } else if (region.equals("26") == true) { + timezone = "America/Hermosillo"; + } else if (region.equals("27") == true) { + timezone = "America/Merida"; + } else if (region.equals("28") == true) { + timezone = "America/Monterrey"; + } else if (region.equals("29") == true) { + timezone = "America/Mexico_City"; + } else if (region.equals("30") == true) { + timezone = "America/Mexico_City"; + } else if (region.equals("31") == true) { + timezone = "America/Merida"; + } else if (region.equals("32") == true) { + timezone = "America/Monterrey"; + } + } else if (country.equals("MY") == true) { + if (region.equals("01") == true) { + timezone = "Asia/Kuala_Lumpur"; + } else if (region.equals("02") == true) { + timezone = "Asia/Kuala_Lumpur"; + } else if (region.equals("03") == true) { + timezone = "Asia/Kuala_Lumpur"; + } else if (region.equals("04") == true) { + timezone = "Asia/Kuala_Lumpur"; + } else if (region.equals("05") == true) { + timezone = "Asia/Kuala_Lumpur"; + } else if (region.equals("06") == true) { + timezone = "Asia/Kuala_Lumpur"; + } else if (region.equals("07") == true) { + timezone = "Asia/Kuala_Lumpur"; + } else if (region.equals("08") == true) { + timezone = "Asia/Kuala_Lumpur"; + } else if (region.equals("09") == true) { + timezone = "Asia/Kuala_Lumpur"; + } else if (region.equals("11") == true) { + timezone = "Asia/Kuching"; + } else if (region.equals("12") == true) { + timezone = "Asia/Kuala_Lumpur"; + } else if (region.equals("13") == true) { + timezone = "Asia/Kuala_Lumpur"; + } else if (region.equals("14") == true) { + timezone = "Asia/Kuala_Lumpur"; + } else if (region.equals("15") == true) { + timezone = "Asia/Kuching"; + } else if (region.equals("16") == true) { + timezone = "Asia/Kuching"; + } + } else if (country.equals("NZ") == true) { + if (region.equals("85") == true) { + timezone = "Pacific/Auckland"; + } else if (region.equals("E7") == true) { + timezone = "Pacific/Auckland"; + } else if (region.equals("E8") == true) { + timezone = "Pacific/Auckland"; + } else if (region.equals("E9") == true) { + timezone = "Pacific/Auckland"; + } else if (region.equals("F1") == true) { + timezone = "Pacific/Auckland"; + } else if (region.equals("F2") == true) { + timezone = "Pacific/Auckland"; + } else if (region.equals("F3") == true) { + timezone = "Pacific/Auckland"; + } else if (region.equals("F4") == true) { + timezone = "Pacific/Auckland"; + } else if (region.equals("F5") == true) { + timezone = "Pacific/Auckland"; + } else if (region.equals("F7") == true) { + timezone = "Pacific/Chatham"; + } else if (region.equals("F8") == true) { + timezone = "Pacific/Auckland"; + } else if (region.equals("F9") == true) { + timezone = "Pacific/Auckland"; + } else if (region.equals("G1") == true) { + timezone = "Pacific/Auckland"; + } else if (region.equals("G2") == true) { + timezone = "Pacific/Auckland"; + } else if (region.equals("G3") == true) { + timezone = "Pacific/Auckland"; + } + } else if (country.equals("PT") == true) { + if (region.equals("02") == true) { + timezone = "Europe/Lisbon"; + } else if (region.equals("03") == true) { + timezone = "Europe/Lisbon"; + } else if (region.equals("04") == true) { + timezone = "Europe/Lisbon"; + } else if (region.equals("05") == true) { + timezone = "Europe/Lisbon"; + } else if (region.equals("06") == true) { + timezone = "Europe/Lisbon"; + } else if (region.equals("07") == true) { + timezone = "Europe/Lisbon"; + } else if (region.equals("08") == true) { + timezone = "Europe/Lisbon"; + } else if (region.equals("09") == true) { + timezone = "Europe/Lisbon"; + } else if (region.equals("10") == true) { + timezone = "Atlantic/Madeira"; + } else if (region.equals("11") == true) { + timezone = "Europe/Lisbon"; + } else if (region.equals("13") == true) { + timezone = "Europe/Lisbon"; + } else if (region.equals("14") == true) { + timezone = "Europe/Lisbon"; + } else if (region.equals("16") == true) { + timezone = "Europe/Lisbon"; + } else if (region.equals("17") == true) { + timezone = "Europe/Lisbon"; + } else if (region.equals("18") == true) { + timezone = "Europe/Lisbon"; + } else if (region.equals("19") == true) { + timezone = "Europe/Lisbon"; + } else if (region.equals("20") == true) { + timezone = "Europe/Lisbon"; + } else if (region.equals("21") == true) { + timezone = "Europe/Lisbon"; + } else if (region.equals("22") == true) { + timezone = "Europe/Lisbon"; + } + } else if (country.equals("RU") == true) { + if (region.equals("01") == true) { + timezone = "Europe/Volgograd"; + } else if (region.equals("02") == true) { + timezone = "Asia/Irkutsk"; + } else if (region.equals("03") == true) { + timezone = "Asia/Novokuznetsk"; + } else if (region.equals("04") == true) { + timezone = "Asia/Novosibirsk"; + } else if (region.equals("05") == true) { + timezone = "Asia/Vladivostok"; + } else if (region.equals("06") == true) { + timezone = "Europe/Moscow"; + } else if (region.equals("07") == true) { + timezone = "Europe/Volgograd"; + } else if (region.equals("08") == true) { + timezone = "Europe/Samara"; + } else if (region.equals("09") == true) { + timezone = "Europe/Moscow"; + } else if (region.equals("10") == true) { + timezone = "Europe/Moscow"; + } else if (region.equals("11") == true) { + timezone = "Asia/Irkutsk"; + } else if (region.equals("13") == true) { + timezone = "Asia/Yekaterinburg"; + } else if (region.equals("14") == true) { + timezone = "Asia/Irkutsk"; + } else if (region.equals("15") == true) { + timezone = "Asia/Anadyr"; + } else if (region.equals("16") == true) { + timezone = "Europe/Samara"; + } else if (region.equals("17") == true) { + timezone = "Europe/Volgograd"; + } else if (region.equals("18") == true) { + timezone = "Asia/Krasnoyarsk"; + } else if (region.equals("20") == true) { + timezone = "Asia/Irkutsk"; + } else if (region.equals("21") == true) { + timezone = "Europe/Moscow"; + } else if (region.equals("22") == true) { + timezone = "Europe/Volgograd"; + } else if (region.equals("23") == true) { + timezone = "Europe/Kaliningrad"; + } else if (region.equals("24") == true) { + timezone = "Europe/Volgograd"; + } else if (region.equals("25") == true) { + timezone = "Europe/Moscow"; + } else if (region.equals("26") == true) { + timezone = "Asia/Kamchatka"; + } else if (region.equals("27") == true) { + timezone = "Europe/Volgograd"; + } else if (region.equals("28") == true) { + timezone = "Europe/Moscow"; + } else if (region.equals("29") == true) { + timezone = "Asia/Novokuznetsk"; + } else if (region.equals("30") == true) { + timezone = "Asia/Vladivostok"; + } else if (region.equals("31") == true) { + timezone = "Asia/Krasnoyarsk"; + } else if (region.equals("32") == true) { + timezone = "Asia/Omsk"; + } else if (region.equals("33") == true) { + timezone = "Asia/Yekaterinburg"; + } else if (region.equals("34") == true) { + timezone = "Asia/Yekaterinburg"; + } else if (region.equals("35") == true) { + timezone = "Asia/Yekaterinburg"; + } else if (region.equals("36") == true) { + timezone = "Asia/Anadyr"; + } else if (region.equals("37") == true) { + timezone = "Europe/Moscow"; + } else if (region.equals("38") == true) { + timezone = "Europe/Volgograd"; + } else if (region.equals("39") == true) { + timezone = "Asia/Krasnoyarsk"; + } else if (region.equals("40") == true) { + timezone = "Asia/Yekaterinburg"; + } else if (region.equals("41") == true) { + timezone = "Europe/Moscow"; + } else if (region.equals("42") == true) { + timezone = "Europe/Moscow"; + } else if (region.equals("43") == true) { + timezone = "Europe/Moscow"; + } else if (region.equals("44") == true) { + timezone = "Asia/Magadan"; + } else if (region.equals("45") == true) { + timezone = "Europe/Samara"; + } else if (region.equals("46") == true) { + timezone = "Europe/Samara"; + } else if (region.equals("47") == true) { + timezone = "Europe/Moscow"; + } else if (region.equals("48") == true) { + timezone = "Europe/Moscow"; + } else if (region.equals("49") == true) { + timezone = "Europe/Moscow"; + } else if (region.equals("50") == true) { + timezone = "Asia/Yekaterinburg"; + } else if (region.equals("51") == true) { + timezone = "Europe/Moscow"; + } else if (region.equals("52") == true) { + timezone = "Europe/Moscow"; + } else if (region.equals("53") == true) { + timezone = "Asia/Novosibirsk"; + } else if (region.equals("54") == true) { + timezone = "Asia/Omsk"; + } else if (region.equals("55") == true) { + timezone = "Europe/Samara"; + } else if (region.equals("56") == true) { + timezone = "Europe/Moscow"; + } else if (region.equals("57") == true) { + timezone = "Europe/Samara"; + } else if (region.equals("58") == true) { + timezone = "Asia/Yekaterinburg"; + } else if (region.equals("59") == true) { + timezone = "Asia/Vladivostok"; + } else if (region.equals("60") == true) { + timezone = "Europe/Kaliningrad"; + } else if (region.equals("61") == true) { + timezone = "Europe/Volgograd"; + } else if (region.equals("62") == true) { + timezone = "Europe/Moscow"; + } else if (region.equals("63") == true) { + timezone = "Asia/Yakutsk"; + } else if (region.equals("64") == true) { + timezone = "Asia/Sakhalin"; + } else if (region.equals("65") == true) { + timezone = "Europe/Samara"; + } else if (region.equals("66") == true) { + timezone = "Europe/Moscow"; + } else if (region.equals("67") == true) { + timezone = "Europe/Samara"; + } else if (region.equals("68") == true) { + timezone = "Europe/Volgograd"; + } else if (region.equals("69") == true) { + timezone = "Europe/Moscow"; + } else if (region.equals("70") == true) { + timezone = "Europe/Volgograd"; + } else if (region.equals("71") == true) { + timezone = "Asia/Yekaterinburg"; + } else if (region.equals("72") == true) { + timezone = "Europe/Moscow"; + } else if (region.equals("73") == true) { + timezone = "Europe/Samara"; + } else if (region.equals("74") == true) { + timezone = "Asia/Krasnoyarsk"; + } else if (region.equals("75") == true) { + timezone = "Asia/Novosibirsk"; + } else if (region.equals("76") == true) { + timezone = "Europe/Moscow"; + } else if (region.equals("77") == true) { + timezone = "Europe/Moscow"; + } else if (region.equals("78") == true) { + timezone = "Asia/Yekaterinburg"; + } else if (region.equals("79") == true) { + timezone = "Asia/Irkutsk"; + } else if (region.equals("80") == true) { + timezone = "Asia/Yekaterinburg"; + } else if (region.equals("81") == true) { + timezone = "Europe/Samara"; + } else if (region.equals("82") == true) { + timezone = "Asia/Irkutsk"; + } else if (region.equals("83") == true) { + timezone = "Europe/Moscow"; + } else if (region.equals("84") == true) { + timezone = "Europe/Volgograd"; + } else if (region.equals("85") == true) { + timezone = "Europe/Moscow"; + } else if (region.equals("86") == true) { + timezone = "Europe/Moscow"; + } else if (region.equals("87") == true) { + timezone = "Asia/Novosibirsk"; + } else if (region.equals("88") == true) { + timezone = "Europe/Moscow"; + } else if (region.equals("89") == true) { + timezone = "Asia/Vladivostok"; + } + } else if (country.equals("UA") == true) { + if (region.equals("01") == true) { + timezone = "Europe/Kiev"; + } else if (region.equals("02") == true) { + timezone = "Europe/Kiev"; + } else if (region.equals("03") == true) { + timezone = "Europe/Uzhgorod"; + } else if (region.equals("04") == true) { + timezone = "Europe/Zaporozhye"; + } else if (region.equals("05") == true) { + timezone = "Europe/Zaporozhye"; + } else if (region.equals("06") == true) { + timezone = "Europe/Uzhgorod"; + } else if (region.equals("07") == true) { + timezone = "Europe/Zaporozhye"; + } else if (region.equals("08") == true) { + timezone = "Europe/Simferopol"; + } else if (region.equals("09") == true) { + timezone = "Europe/Kiev"; + } else if (region.equals("10") == true) { + timezone = "Europe/Zaporozhye"; + } else if (region.equals("11") == true) { + timezone = "Europe/Simferopol"; + } else if (region.equals("13") == true) { + timezone = "Europe/Kiev"; + } else if (region.equals("14") == true) { + timezone = "Europe/Zaporozhye"; + } else if (region.equals("15") == true) { + timezone = "Europe/Uzhgorod"; + } else if (region.equals("16") == true) { + timezone = "Europe/Zaporozhye"; + } else if (region.equals("17") == true) { + timezone = "Europe/Simferopol"; + } else if (region.equals("18") == true) { + timezone = "Europe/Zaporozhye"; + } else if (region.equals("19") == true) { + timezone = "Europe/Kiev"; + } else if (region.equals("20") == true) { + timezone = "Europe/Simferopol"; + } else if (region.equals("21") == true) { + timezone = "Europe/Kiev"; + } else if (region.equals("22") == true) { + timezone = "Europe/Uzhgorod"; + } else if (region.equals("23") == true) { + timezone = "Europe/Kiev"; + } else if (region.equals("24") == true) { + timezone = "Europe/Uzhgorod"; + } else if (region.equals("25") == true) { + timezone = "Europe/Uzhgorod"; + } else if (region.equals("26") == true) { + timezone = "Europe/Zaporozhye"; + } else if (region.equals("27") == true) { + timezone = "Europe/Kiev"; + } + } else if (country.equals("UZ") == true) { + if (region.equals("01") == true) { + timezone = "Asia/Tashkent"; + } else if (region.equals("02") == true) { + timezone = "Asia/Samarkand"; + } else if (region.equals("03") == true) { + timezone = "Asia/Tashkent"; + } else if (region.equals("06") == true) { + timezone = "Asia/Tashkent"; + } else if (region.equals("07") == true) { + timezone = "Asia/Samarkand"; + } else if (region.equals("08") == true) { + timezone = "Asia/Samarkand"; + } else if (region.equals("09") == true) { + timezone = "Asia/Samarkand"; + } else if (region.equals("10") == true) { + timezone = "Asia/Samarkand"; + } else if (region.equals("12") == true) { + timezone = "Asia/Samarkand"; + } else if (region.equals("13") == true) { + timezone = "Asia/Tashkent"; + } else if (region.equals("14") == true) { + timezone = "Asia/Tashkent"; + } + } else if (country.equals("TL") == true) { + timezone = "Asia/Dili"; + } else if (country.equals("PF") == true) { + timezone = "Pacific/Marquesas"; + } + return timezone; + } +} diff --git a/EssentialsGeoIP/src/config.yml b/EssentialsGeoIP/src/config.yml new file mode 100644 index 000000000..70d7a51ba --- /dev/null +++ b/EssentialsGeoIP/src/config.yml @@ -0,0 +1,10 @@ +database: + show-cities: false + download-if-missing: true + # Url for country + download-url: "http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz" + # Url for cities + download-url-city: "http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz" + +show-on-login: true +show-on-whois: true
\ No newline at end of file diff --git a/EssentialsGeoIP/src/plugin.yml b/EssentialsGeoIP/src/plugin.yml new file mode 100644 index 000000000..26d75ce77 --- /dev/null +++ b/EssentialsGeoIP/src/plugin.yml @@ -0,0 +1,8 @@ +# This determines the command prefix when there are conflicts (/name:home, /name:help, etc.) +name: EssentialsGeoIP +main: com.earth2me.essentials.geoip.EssentialsGeoIP +# Note to developers: This next line cannot change, or the automatic versioning system will break. +version: TeamCity +website: http://www.earth2me.net:8001/ +description: Shows the country or city of a user on login and /whois. +authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo]
\ No newline at end of file |