diff options
25 files changed, 289 insertions, 20780 deletions
diff --git a/.gitignore b/.gitignore index ed9bf34b0..995062169 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ build.xml # maven target jars +dependency-reduced-pom.xml # vim .*.sw[a-p] @@ -30,6 +31,3 @@ manifest.mf *.ipr *.iws .idea/ - -EssentialsRelease/ -/Essentials/dependency-reduced-pom.xml
\ No newline at end of file diff --git a/EssentialsGeoIP/pom.xml b/EssentialsGeoIP/pom.xml index 6327d48c5..b59cdd63b 100644 --- a/EssentialsGeoIP/pom.xml +++ b/EssentialsGeoIP/pom.xml @@ -1,20 +1,42 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> + <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>net.essentials3</groupId> - <artifactId>BuildAll</artifactId> - <version>3.0-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> + <parent> + <groupId>net.essentials3</groupId> + <artifactId>BuildAll</artifactId> + <version>3.0-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> - <artifactId>EssentialsGeoIP</artifactId> - <dependencies> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>Essentials</artifactId> - <version>${project.version}</version> - </dependency> - </dependencies> + <artifactId>EssentialsGeoIP</artifactId> + <dependencies> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>Essentials</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.kohsuke</groupId> + <artifactId>geoip</artifactId> + <version>1.2.5</version> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-shade-plugin</artifactId> + <version>2.0</version> + <executions> + <execution> + <goals> + <goal>shade</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> </project> diff --git a/EssentialsGeoIP/src/com/maxmind/LICENSE b/EssentialsGeoIP/src/com/maxmind/LICENSE deleted file mode 100644 index 5ab7695ab..000000000 --- a/EssentialsGeoIP/src/com/maxmind/LICENSE +++ /dev/null @@ -1,504 +0,0 @@ - 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 deleted file mode 100644 index d250eb766..000000000 --- a/EssentialsGeoIP/src/com/maxmind/geoip/Country.java +++ /dev/null @@ -1,61 +0,0 @@ -/** - * 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 deleted file mode 100644 index dac8c33a1..000000000 --- a/EssentialsGeoIP/src/com/maxmind/geoip/DatabaseInfo.java +++ /dev/null @@ -1,117 +0,0 @@ -/** - * 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.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; - -/** - * 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.isEmpty()) { - 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 deleted file mode 100644 index 040fcb6b1..000000000 --- a/EssentialsGeoIP/src/com/maxmind/geoip/Location.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - * 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 deleted file mode 100644 index 19da6c8f5..000000000 --- a/EssentialsGeoIP/src/com/maxmind/geoip/LookupService.java +++ /dev/null @@ -1,1046 +0,0 @@ -/** - * 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.Inet6Address; -import java.net.InetAddress; -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 deleted file mode 100644 index cba0594b6..000000000 --- a/EssentialsGeoIP/src/com/maxmind/geoip/Region.java +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index 3755acf35..000000000 --- a/EssentialsGeoIP/src/com/maxmind/geoip/regionName.java +++ /dev/null @@ -1,13400 +0,0 @@ -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.isEmpty()) { 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 deleted file mode 100644 index c47802a8e..000000000 --- a/EssentialsGeoIP/src/com/maxmind/geoip/timeZone.java +++ /dev/null @@ -1,1403 +0,0 @@ -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/EssentialsProtect/pom.xml b/EssentialsProtect/pom.xml index ecc54bf47..a575964b3 100644 --- a/EssentialsProtect/pom.xml +++ b/EssentialsProtect/pom.xml @@ -1,21 +1,20 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> + <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>net.essentials3</groupId> - <artifactId>BuildAll</artifactId> - <version>3.0-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> - - <artifactId>EssentialsProtect</artifactId> - <dependencies> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>Essentials</artifactId> - <version>${project.version}</version> - </dependency> - </dependencies> + <parent> + <groupId>net.essentials3</groupId> + <artifactId>BuildAll</artifactId> + <version>3.0-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + <artifactId>EssentialsProtect</artifactId> + <dependencies> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>Essentials</artifactId> + <version>${project.version}</version> + </dependency> + </dependencies> </project> diff --git a/EssentialsUpdate/pom.xml b/EssentialsUpdate/pom.xml index 89c76dda8..a21f26876 100644 --- a/EssentialsUpdate/pom.xml +++ b/EssentialsUpdate/pom.xml @@ -1,21 +1,43 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> + <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>net.essentials3</groupId> - <artifactId>BuildAll</artifactId> - <version>3.0-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> + <parent> + <groupId>net.essentials3</groupId> + <artifactId>BuildAll</artifactId> + <version>3.0-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> - <artifactId>EssentialsUpdate</artifactId> - <dependencies> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.10</version> - <scope>test</scope> - </dependency> - </dependencies> + <artifactId>EssentialsUpdate</artifactId> + <dependencies> + <dependency> + <groupId>pircbot</groupId> + <artifactId>pircbot</artifactId> + <version>1.5.0</version> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.10</version> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-shade-plugin</artifactId> + <version>2.0</version> + <executions> + <execution> + <goals> + <goal>shade</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> </project> diff --git a/EssentialsUpdate/src/org/jibble/pircbot/Colors.java b/EssentialsUpdate/src/org/jibble/pircbot/Colors.java deleted file mode 100755 index c763cba22..000000000 --- a/EssentialsUpdate/src/org/jibble/pircbot/Colors.java +++ /dev/null @@ -1,293 +0,0 @@ -/* -Copyright Paul James Mutton, 2001-2009, http://www.jibble.org/ - -This file is part of PircBot. - -This software is dual-licensed, allowing you to choose between the GNU -General Public License (GPL) and the www.jibble.org Commercial License. -Since the GPL may be too restrictive for use in a proprietary application, -a commercial license is also provided. Full license information can be -found at http://www.jibble.org/licenses/ - -*/ - - -package org.jibble.pircbot; - -/** - * The Colors class provides several static fields and methods that you may - * find useful when writing an IRC Bot. - * <p> - * This class contains constants that are useful for formatting lines - * sent to IRC servers. These constants allow you to apply various - * formatting to the lines, such as colours, boldness, underlining - * and reverse text. - * <p> - * The class contains static methods to remove colours and formatting - * from lines of IRC text. - * <p> - * Here are some examples of how to use the contants from within a - * class that extends PircBot and imports org.jibble.pircbot.*; - * - * <pre> sendMessage("#cs", Colors.BOLD + "A bold hello!"); - * <b>A bold hello!</b> - * sendMessage("#cs", Colors.RED + "Red" + Colors.NORMAL + " text"); - * <font color="red">Red</font> text - * sendMessage("#cs", Colors.BOLD + Colors.RED + "Bold and red"); - * <b><font color="red">Bold and red</font></b></pre> - * - * Please note that some IRC channels may be configured to reject any - * messages that use colours. Also note that older IRC clients may be - * unable to correctly display lines that contain colours and other - * control characters. - * <p> - * Note that this class name has been spelt in the American style in - * order to remain consistent with the rest of the Java API. - * - * - * @since 0.9.12 - * @author Paul James Mutton, - * <a href="http://www.jibble.org/">http://www.jibble.org/</a> - * @version 1.5.0 (Build time: Mon Dec 14 20:07:17 2009) - */ -public class Colors { - - - /** - * Removes all previously applied color and formatting attributes. - */ - public static final String NORMAL = "\u000f"; - - - /** - * Bold text. - */ - public static final String BOLD = "\u0002"; - - - /** - * Underlined text. - */ - public static final String UNDERLINE = "\u001f"; - - - /** - * Reversed text (may be rendered as italic text in some clients). - */ - public static final String REVERSE = "\u0016"; - - - /** - * White coloured text. - */ - public static final String WHITE = "\u000300"; - - - /** - * Black coloured text. - */ - public static final String BLACK = "\u000301"; - - - /** - * Dark blue coloured text. - */ - public static final String DARK_BLUE = "\u000302"; - - - /** - * Dark green coloured text. - */ - public static final String DARK_GREEN = "\u000303"; - - - /** - * Red coloured text. - */ - public static final String RED = "\u000304"; - - - /** - * Brown coloured text. - */ - public static final String BROWN = "\u000305"; - - - /** - * Purple coloured text. - */ - public static final String PURPLE = "\u000306"; - - - /** - * Olive coloured text. - */ - public static final String OLIVE = "\u000307"; - - - /** - * Yellow coloured text. - */ - public static final String YELLOW = "\u000308"; - - - /** - * Green coloured text. - */ - public static final String GREEN = "\u000309"; - - - /** - * Teal coloured text. - */ - public static final String TEAL = "\u000310"; - - - /** - * Cyan coloured text. - */ - public static final String CYAN = "\u000311"; - - - /** - * Blue coloured text. - */ - public static final String BLUE = "\u000312"; - - - /** - * Magenta coloured text. - */ - public static final String MAGENTA = "\u000313"; - - - /** - * Dark gray coloured text. - */ - public static final String DARK_GRAY = "\u000314"; - - - /** - * Light gray coloured text. - */ - public static final String LIGHT_GRAY = "\u000315"; - - - /** - * This class should not be constructed. - */ - private Colors() { - - } - - - /** - * Removes all colours from a line of IRC text. - * - * @since PircBot 1.2.0 - * - * @param line the input text. - * - * @return the same text, but with all colours removed. - */ - public static String removeColors(String line) { - int length = line.length(); - StringBuffer buffer = new StringBuffer(); - int i = 0; - while (i < length) { - char ch = line.charAt(i); - if (ch == '\u0003') { - i++; - // Skip "x" or "xy" (foreground color). - if (i < length) { - ch = line.charAt(i); - if (Character.isDigit(ch)) { - i++; - if (i < length) { - ch = line.charAt(i); - if (Character.isDigit(ch)) { - i++; - } - } - // Now skip ",x" or ",xy" (background color). - if (i < length) { - ch = line.charAt(i); - if (ch == ',') { - i++; - if (i < length) { - ch = line.charAt(i); - if (Character.isDigit(ch)) { - i++; - if (i < length) { - ch = line.charAt(i); - if (Character.isDigit(ch)) { - i++; - } - } - } - else { - // Keep the comma. - i--; - } - } - else { - // Keep the comma. - i--; - } - } - } - } - } - } - else if (ch == '\u000f') { - i++; - } - else { - buffer.append(ch); - i++; - } - } - return buffer.toString(); - } - - - /** - * Remove formatting from a line of IRC text. - * - * @since PircBot 1.2.0 - * - * @param line the input text. - * - * @return the same text, but without any bold, underlining, reverse, etc. - */ - public static String removeFormatting(String line) { - int length = line.length(); - StringBuffer buffer = new StringBuffer(); - for (int i = 0; i < length; i++) { - char ch = line.charAt(i); - if (ch == '\u000f' || ch == '\u0002' || ch == '\u001f' || ch == '\u0016') { - // Don't add this character. - } - else { - buffer.append(ch); - } - } - return buffer.toString(); - } - - - /** - * Removes all formatting and colours from a line of IRC text. - * - * @since PircBot 1.2.0 - * - * @param line the input text. - * - * @return the same text, but without formatting and colour characters. - * - */ - public static String removeFormattingAndColors(String line) { - return removeFormatting(removeColors(line)); - } - -} diff --git a/EssentialsUpdate/src/org/jibble/pircbot/InputThread.java b/EssentialsUpdate/src/org/jibble/pircbot/InputThread.java deleted file mode 100755 index a24815210..000000000 --- a/EssentialsUpdate/src/org/jibble/pircbot/InputThread.java +++ /dev/null @@ -1,169 +0,0 @@ -/* -Copyright Paul James Mutton, 2001-2009, http://www.jibble.org/ - -This file is part of PircBot. - -This software is dual-licensed, allowing you to choose between the GNU -General Public License (GPL) and the www.jibble.org Commercial License. -Since the GPL may be too restrictive for use in a proprietary application, -a commercial license is also provided. Full license information can be -found at http://www.jibble.org/licenses/ - -*/ - - -package org.jibble.pircbot; - -import java.io.*; -import java.net.Socket; -import java.util.StringTokenizer; - -/** - * A Thread which reads lines from the IRC server. It then - * passes these lines to the PircBot without changing them. - * This running Thread also detects disconnection from the server - * and is thus used by the OutputThread to send lines to the server. - * - * @author Paul James Mutton, - * <a href="http://www.jibble.org/">http://www.jibble.org/</a> - * @version 1.5.0 (Build time: Mon Dec 14 20:07:17 2009) - */ -public class InputThread extends Thread { - - /** - * The InputThread reads lines from the IRC server and allows the - * PircBot to handle them. - * - * @param bot An instance of the underlying PircBot. - * @param breader The BufferedReader that reads lines from the server. - * @param bwriter The BufferedWriter that sends lines to the server. - */ - InputThread(PircBot bot, Socket socket, BufferedReader breader, BufferedWriter bwriter) { - _bot = bot; - _socket = socket; - _breader = breader; - _bwriter = bwriter; - this.setName(this.getClass() + "-Thread"); - } - - - /** - * Sends a raw line to the IRC server as soon as possible, bypassing the - * outgoing message queue. - * - * @param line The raw line to send to the IRC server. - */ - void sendRawLine(String line) { - OutputThread.sendRawLine(_bot, _bwriter, line); - } - - - /** - * Returns true if this InputThread is connected to an IRC server. - * The result of this method should only act as a rough guide, - * as the result may not be valid by the time you act upon it. - * - * @return True if still connected. - */ - boolean isConnected() { - return _isConnected; - } - - - /** - * Called to start this Thread reading lines from the IRC server. - * When a line is read, this method calls the handleLine method - * in the PircBot, which may subsequently call an 'onXxx' method - * in the PircBot subclass. If any subclass of Throwable (i.e. - * any Exception or Error) is thrown by your method, then this - * method will print the stack trace to the standard output. It - * is probable that the PircBot may still be functioning normally - * after such a problem, but the existance of any uncaught exceptions - * in your code is something you should really fix. - */ - public void run() { - try { - boolean running = true; - while (running) { - try { - String line = null; - while ((line = _breader.readLine()) != null) { - try { - _bot.handleLine(line); - } - catch (Throwable t) { - // Stick the whole stack trace into a String so we can output it nicely. - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - t.printStackTrace(pw); - pw.flush(); - StringTokenizer tokenizer = new StringTokenizer(sw.toString(), "\r\n"); - synchronized (_bot) { - _bot.log("### Your implementation of PircBot is faulty and you have"); - _bot.log("### allowed an uncaught Exception or Error to propagate in your"); - _bot.log("### code. It may be possible for PircBot to continue operating"); - _bot.log("### normally. Here is the stack trace that was produced: -"); - _bot.log("### "); - while (tokenizer.hasMoreTokens()) { - _bot.log("### " + tokenizer.nextToken()); - } - } - } - } - if (line == null) { - // The server must have disconnected us. - running = false; - } - } - catch (InterruptedIOException iioe) { - // This will happen if we haven't received anything from the server for a while. - // So we shall send it a ping to check that we are still connected. - this.sendRawLine("PING " + (System.currentTimeMillis() / 1000)); - // Now we go back to listening for stuff from the server... - } - } - } - catch (Exception e) { - // Do nothing. - } - - // If we reach this point, then we must have disconnected. - try { - _socket.close(); - } - catch (Exception e) { - // Just assume the socket was already closed. - } - - if (!_disposed) { - _bot.log("*** Disconnected."); - _isConnected = false; - _bot.onDisconnect(); - } - - } - - - /** - * Closes the socket without onDisconnect being called subsequently. - */ - public void dispose () { - try { - _disposed = true; - _socket.close(); - } - catch (Exception e) { - // Do nothing. - } - } - - private PircBot _bot = null; - private Socket _socket = null; - private BufferedReader _breader = null; - private BufferedWriter _bwriter = null; - private boolean _isConnected = true; - private boolean _disposed = false; - - public static final int MAX_LINE_LENGTH = 512; - -} diff --git a/EssentialsUpdate/src/org/jibble/pircbot/IrcException.java b/EssentialsUpdate/src/org/jibble/pircbot/IrcException.java deleted file mode 100755 index d07d8a956..000000000 --- a/EssentialsUpdate/src/org/jibble/pircbot/IrcException.java +++ /dev/null @@ -1,35 +0,0 @@ -/* -Copyright Paul James Mutton, 2001-2009, http://www.jibble.org/ - -This file is part of PircBot. - -This software is dual-licensed, allowing you to choose between the GNU -General Public License (GPL) and the www.jibble.org Commercial License. -Since the GPL may be too restrictive for use in a proprietary application, -a commercial license is also provided. Full license information can be -found at http://www.jibble.org/licenses/ - -*/ - -package org.jibble.pircbot; - -/** - * An IrcException class. - * - * @since 0.9 - * @author Paul James Mutton, - * <a href="http://www.jibble.org/">http://www.jibble.org/</a> - * @version 1.5.0 (Build time: Mon Dec 14 20:07:17 2009) - */ -public class IrcException extends Exception { - - /** - * Constructs a new IrcException. - * - * @param e The error message to report. - */ - public IrcException(String e) { - super(e); - } - -} diff --git a/EssentialsUpdate/src/org/jibble/pircbot/NickAlreadyInUseException.java b/EssentialsUpdate/src/org/jibble/pircbot/NickAlreadyInUseException.java deleted file mode 100755 index 33887be34..000000000 --- a/EssentialsUpdate/src/org/jibble/pircbot/NickAlreadyInUseException.java +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright Paul James Mutton, 2001-2009, http://www.jibble.org/ - -This file is part of PircBot. - -This software is dual-licensed, allowing you to choose between the GNU -General Public License (GPL) and the www.jibble.org Commercial License. -Since the GPL may be too restrictive for use in a proprietary application, -a commercial license is also provided. Full license information can be -found at http://www.jibble.org/licenses/ - -*/ - - -package org.jibble.pircbot; - -/** - * A NickAlreadyInUseException class. This exception is - * thrown when the PircBot attempts to join an IRC server - * with a user name that is already in use. - * - * @since 0.9 - * @author Paul James Mutton, - * <a href="http://www.jibble.org/">http://www.jibble.org/</a> - * @version 1.5.0 (Build time: Mon Dec 14 20:07:17 2009) - */ -public class NickAlreadyInUseException extends IrcException { - - /** - * Constructs a new IrcException. - * - * @param e The error message to report. - */ - public NickAlreadyInUseException(String e) { - super(e); - } - -} diff --git a/EssentialsUpdate/src/org/jibble/pircbot/OutputThread.java b/EssentialsUpdate/src/org/jibble/pircbot/OutputThread.java deleted file mode 100755 index 7eddee873..000000000 --- a/EssentialsUpdate/src/org/jibble/pircbot/OutputThread.java +++ /dev/null @@ -1,104 +0,0 @@ -/* -Copyright Paul James Mutton, 2001-2009, http://www.jibble.org/ - -This file is part of PircBot. - -This software is dual-licensed, allowing you to choose between the GNU -General Public License (GPL) and the www.jibble.org Commercial License. -Since the GPL may be too restrictive for use in a proprietary application, -a commercial license is also provided. Full license information can be -found at http://www.jibble.org/licenses/ - -*/ - - -package org.jibble.pircbot; - -import java.io.BufferedWriter; - -/** - * A Thread which is responsible for sending messages to the IRC server. - * Messages are obtained from the outgoing message queue and sent - * immediately if possible. If there is a flood of messages, then to - * avoid getting kicked from a channel, we put a small delay between - * each one. - * - * @author Paul James Mutton, - * <a href="http://www.jibble.org/">http://www.jibble.org/</a> - * @version 1.5.0 (Build time: Mon Dec 14 20:07:17 2009) - */ -public class OutputThread extends Thread { - - - /** - * Constructs an OutputThread for the underlying PircBot. All messages - * sent to the IRC server are sent by this OutputThread to avoid hammering - * the server. Messages are sent immediately if possible. If there are - * multiple messages queued, then there is a delay imposed. - * - * @param bot The underlying PircBot instance. - * @param outQueue The Queue from which we will obtain our messages. - */ - OutputThread(PircBot bot, Queue outQueue) { - _bot = bot; - _outQueue = outQueue; - this.setName(this.getClass() + "-Thread"); - } - - - /** - * A static method to write a line to a BufferedOutputStream and then pass - * the line to the log method of the supplied PircBot instance. - * - * @param bot The underlying PircBot instance. - * @param out The BufferedOutputStream to write to. - * @param line The line to be written. "\r\n" is appended to the end. - * @param encoding The charset to use when encoing this string into a - * byte array. - */ - static void sendRawLine(PircBot bot, BufferedWriter bwriter, String line) { - if (line.length() > bot.getMaxLineLength() - 2) { - line = line.substring(0, bot.getMaxLineLength() - 2); - } - synchronized(bwriter) { - try { - bwriter.write(line + "\r\n"); - bwriter.flush(); - bot.log(">>>" + line); - } - catch (Exception e) { - // Silent response - just lose the line. - } - } - } - - - /** - * This method starts the Thread consuming from the outgoing message - * Queue and sending lines to the server. - */ - public void run() { - try { - boolean running = true; - while (running) { - // Small delay to prevent spamming of the channel - Thread.sleep(_bot.getMessageDelay()); - - String line = (String) _outQueue.next(); - if (line != null) { - _bot.sendRawLine(line); - } - else { - running = false; - } - } - } - catch (InterruptedException e) { - // Just let the method return naturally... - } - } - - private PircBot _bot = null; - private Queue _outQueue = null; - -} diff --git a/EssentialsUpdate/src/org/jibble/pircbot/PircBot.java b/EssentialsUpdate/src/org/jibble/pircbot/PircBot.java deleted file mode 100755 index 28148075f..000000000 --- a/EssentialsUpdate/src/org/jibble/pircbot/PircBot.java +++ /dev/null @@ -1,2809 +0,0 @@ -/* -Copyright Paul James Mutton, 2001-2009, http://www.jibble.org/ - -This file is part of PircBot. - -This software is dual-licensed, allowing you to choose between the GNU -General Public License (GPL) and the www.jibble.org Commercial License. -Since the GPL may be too restrictive for use in a proprietary application, -a commercial license is also provided. Full license information can be -found at http://www.jibble.org/licenses/ - -*/ - - -package org.jibble.pircbot; - -import java.io.*; -import java.net.InetAddress; -import java.net.Socket; -import java.util.*; - -/** - * PircBot is a Java framework for writing IRC bots quickly and easily. - * <p> - * It provides an event-driven architecture to handle common IRC - * events, flood protection, DCC support, ident support, and more. - * The comprehensive logfile format is suitable for use with pisg to generate - * channel statistics. - * <p> - * Methods of the PircBot class can be called to send events to the IRC server - * that it connects to. For example, calling the sendMessage method will - * send a message to a channel or user on the IRC server. Multiple servers - * can be supported using multiple instances of PircBot. - * <p> - * To perform an action when the PircBot receives a normal message from the IRC - * server, you would override the onMessage method defined in the PircBot - * class. All on<i>XYZ</i> methods in the PircBot class are automatically called - * when the event <i>XYZ</i> happens, so you would override these if you wish - * to do something when it does happen. - * <p> - * Some event methods, such as onPing, should only really perform a specific - * function (i.e. respond to a PING from the server). For your convenience, such - * methods are already correctly implemented in the PircBot and should not - * normally need to be overridden. Please read the full documentation for each - * method to see which ones are already implemented by the PircBot class. - * <p> - * Please visit the PircBot homepage at - * <a href="http://www.jibble.org/pircbot.php">http://www.jibble.org/pircbot.php</a> - * for full revision history, a beginners guide to creating your first PircBot - * and a list of some existing Java IRC bots and clients that use the PircBot - * framework. - * - * @author Paul James Mutton, - * <a href="http://www.jibble.org/">http://www.jibble.org/</a> - * @version 1.5.0 (Build time: Mon Dec 14 20:07:17 2009) - */ -public abstract class PircBot implements ReplyConstants { - - - /** - * The definitive version number of this release of PircBot. - * (Note: Change this before automatically building releases) - */ - public static final String VERSION = "1.5.0"; - - - private static final int OP_ADD = 1; - private static final int OP_REMOVE = 2; - private static final int VOICE_ADD = 3; - private static final int VOICE_REMOVE = 4; - - - /** - * Constructs a PircBot with the default settings. Your own constructors - * in classes which extend the PircBot abstract class should be responsible - * for changing the default settings if required. - */ - public PircBot() {} - - - /** - * Attempt to connect to the specified IRC server. - * The onConnect method is called upon success. - * - * @param hostname The hostname of the server to connect to. - * - * @throws IOException if it was not possible to connect to the server. - * @throws IrcException if the server would not let us join it. - * @throws NickAlreadyInUseException if our nick is already in use on the server. - */ - public final synchronized void connect(String hostname) throws IOException, IrcException, NickAlreadyInUseException { - this.connect(hostname, 6667, null); - } - - - /** - * Attempt to connect to the specified IRC server and port number. - * The onConnect method is called upon success. - * - * @param hostname The hostname of the server to connect to. - * @param port The port number to connect to on the server. - * - * @throws IOException if it was not possible to connect to the server. - * @throws IrcException if the server would not let us join it. - * @throws NickAlreadyInUseException if our nick is already in use on the server. - */ - public final synchronized void connect(String hostname, int port) throws IOException, IrcException, NickAlreadyInUseException { - this.connect(hostname, port, null); - } - - - /** - * Attempt to connect to the specified IRC server using the supplied - * password. - * The onConnect method is called upon success. - * - * @param hostname The hostname of the server to connect to. - * @param port The port number to connect to on the server. - * @param password The password to use to join the server. - * - * @throws IOException if it was not possible to connect to the server. - * @throws IrcException if the server would not let us join it. - * @throws NickAlreadyInUseException if our nick is already in use on the server. - */ - public final synchronized void connect(String hostname, int port, String password) throws IOException, IrcException, NickAlreadyInUseException { - - _server = hostname; - _port = port; - _password = password; - - if (isConnected()) { - throw new IOException("The PircBot is already connected to an IRC server. Disconnect first."); - } - - // Don't clear the outqueue - there might be something important in it! - - // Clear everything we may have know about channels. - this.removeAllChannels(); - - // Connect to the server. - Socket socket = new Socket(hostname, port); - this.log("*** Connected to server."); - - _inetAddress = socket.getLocalAddress(); - - InputStreamReader inputStreamReader = null; - OutputStreamWriter outputStreamWriter = null; - if (getEncoding() != null) { - // Assume the specified encoding is valid for this JVM. - inputStreamReader = new InputStreamReader(socket.getInputStream(), getEncoding()); - outputStreamWriter = new OutputStreamWriter(socket.getOutputStream(), getEncoding()); - } - else { - // Otherwise, just use the JVM's default encoding. - inputStreamReader = new InputStreamReader(socket.getInputStream()); - outputStreamWriter = new OutputStreamWriter(socket.getOutputStream()); - } - - BufferedReader breader = new BufferedReader(inputStreamReader); - BufferedWriter bwriter = new BufferedWriter(outputStreamWriter); - - // Attempt to join the server. - if (password != null && !password.equals("")) { - OutputThread.sendRawLine(this, bwriter, "PASS " + password); - } - String nick = this.getName(); - OutputThread.sendRawLine(this, bwriter, "NICK " + nick); - OutputThread.sendRawLine(this, bwriter, "USER " + this.getLogin() + " 8 * :" + this.getVersion()); - - _inputThread = new InputThread(this, socket, breader, bwriter); - - // Read stuff back from the server to see if we connected. - String line = null; - int tries = 1; - while ((line = breader.readLine()) != null) { - - this.handleLine(line); - - int firstSpace = line.indexOf(" "); - int secondSpace = line.indexOf(" ", firstSpace + 1); - if (secondSpace >= 0) { - String code = line.substring(firstSpace + 1, secondSpace); - - if (code.equals("004")) { - // We're connected to the server. - break; - } - else if (code.equals("433")) { - if (_autoNickChange) { - tries++; - nick = getName() + tries; - OutputThread.sendRawLine(this, bwriter, "NICK " + nick); - } - else { - socket.close(); - _inputThread = null; - throw new NickAlreadyInUseException(line); - } - } - else if (code.equals("439")) { - // No action required. - } - else if (code.startsWith("5") || code.startsWith("4")) { - socket.close(); - _inputThread = null; - throw new IrcException("Could not log into the IRC server: " + line); - } - } - this.setNick(nick); - - } - - this.log("*** Logged onto server."); - - // This makes the socket timeout on read operations after 5 minutes. - // Maybe in some future version I will let the user change this at runtime. - socket.setSoTimeout(5 * 60 * 1000); - - // Now start the InputThread to read all other lines from the server. - _inputThread.start(); - - // Now start the outputThread that will be used to send all messages. - if (_outputThread == null) { - _outputThread = new OutputThread(this, _outQueue); - _outputThread.start(); - } - - this.onConnect(); - - } - - - /** - * Reconnects to the IRC server that we were previously connected to. - * If necessary, the appropriate port number and password will be used. - * This method will throw an IrcException if we have never connected - * to an IRC server previously. - * - * @since PircBot 0.9.9 - * - * @throws IOException if it was not possible to connect to the server. - * @throws IrcException if the server would not let us join it. - * @throws NickAlreadyInUseException if our nick is already in use on the server. - */ - public final synchronized void reconnect() throws IOException, IrcException, NickAlreadyInUseException{ - if (getServer() == null) { - throw new IrcException("Cannot reconnect to an IRC server because we were never connected to one previously!"); - } - connect(getServer(), getPort(), getPassword()); - } - - - /** - * This method disconnects from the server cleanly by calling the - * quitServer() method. Providing the PircBot was connected to an - * IRC server, the onDisconnect() will be called as soon as the - * disconnection is made by the server. - * - * @see #quitServer() quitServer - * @see #quitServer(String) quitServer - */ - public final synchronized void disconnect() { - this.quitServer(); - } - - - /** - * When you connect to a server and your nick is already in use and - * this is set to true, a new nick will be automatically chosen. - * This is done by adding numbers to the end of the nick until an - * available nick is found. - * - * @param autoNickChange Set to true if you want automatic nick changes - * during connection. - */ - public void setAutoNickChange(boolean autoNickChange) { - _autoNickChange = autoNickChange; - } - - /** - * Joins a channel. - * - * @param channel The name of the channel to join (eg "#cs"). - */ - public final void joinChannel(String channel) { - this.sendRawLine("JOIN " + channel); - } - - - /** - * Joins a channel with a key. - * - * @param channel The name of the channel to join (eg "#cs"). - * @param key The key that will be used to join the channel. - */ - public final void joinChannel(String channel, String key) { - this.joinChannel(channel + " " + key); - } - - - /** - * Parts a channel. - * - * @param channel The name of the channel to leave. - */ - public final void partChannel(String channel) { - this.sendRawLine("PART " + channel); - } - - - /** - * Parts a channel, giving a reason. - * - * @param channel The name of the channel to leave. - * @param reason The reason for parting the channel. - */ - public final void partChannel(String channel, String reason) { - this.sendRawLine("PART " + channel + " :" + reason); - } - - - /** - * Quits from the IRC server. - * Providing we are actually connected to an IRC server, the - * onDisconnect() method will be called as soon as the IRC server - * disconnects us. - */ - public final void quitServer() { - this.quitServer(""); - } - - - /** - * Quits from the IRC server with a reason. - * Providing we are actually connected to an IRC server, the - * onDisconnect() method will be called as soon as the IRC server - * disconnects us. - * - * @param reason The reason for quitting the server. - */ - public final void quitServer(String reason) { - this.sendRawLine("QUIT :" + reason); - } - - - /** - * Sends a raw line to the IRC server as soon as possible, bypassing the - * outgoing message queue. - * - * @param line The raw line to send to the IRC server. - */ - public final synchronized void sendRawLine(String line) { - if (isConnected()) { - _inputThread.sendRawLine(line); - } - } - - /** - * Sends a raw line through the outgoing message queue. - * - * @param line The raw line to send to the IRC server. - */ - public final synchronized void sendRawLineViaQueue(String line) { - if (line == null) { - throw new NullPointerException("Cannot send null messages to server"); - } - if (isConnected()) { - _outQueue.add(line); - } - } - - - /** - * Sends a message to a channel or a private message to a user. These - * messages are added to the outgoing message queue and sent at the - * earliest possible opportunity. - * <p> - * Some examples: - - * <pre> // Send the message "Hello!" to the channel #cs. - * sendMessage("#cs", "Hello!"); - * - * // Send a private message to Paul that says "Hi". - * sendMessage("Paul", "Hi");</pre> - * - * You may optionally apply colours, boldness, underlining, etc to - * the message by using the <code>Colors</code> class. - * - * @param target The name of the channel or user nick to send to. - * @param message The message to send. - * - * @see Colors - */ - public final void sendMessage(String target, String message) { - _outQueue.add("PRIVMSG " + target + " :" + message); - } - - - /** - * Sends an action to the channel or to a user. - * - * @param target The name of the channel or user nick to send to. - * @param action The action to send. - * - * @see Colors - */ - public final void sendAction(String target, String action) { - sendCTCPCommand(target, "ACTION " + action); - } - - - /** - * Sends a notice to the channel or to a user. - * - * @param target The name of the channel or user nick to send to. - * @param notice The notice to send. - */ - public final void sendNotice(String target, String notice) { - _outQueue.add("NOTICE " + target + " :" + notice); - } - - - /** - * Sends a CTCP command to a channel or user. (Client to client protocol). - * Examples of such commands are "PING <number>", "FINGER", "VERSION", etc. - * For example, if you wish to request the version of a user called "Dave", - * then you would call <code>sendCTCPCommand("Dave", "VERSION");</code>. - * The type of response to such commands is largely dependant on the target - * client software. - * - * @since PircBot 0.9.5 - * - * @param target The name of the channel or user to send the CTCP message to. - * @param command The CTCP command to send. - */ - public final void sendCTCPCommand(String target, String command) { - _outQueue.add("PRIVMSG " + target + " :\u0001" + command + "\u0001"); - } - - - /** - * Attempt to change the current nick (nickname) of the bot when it - * is connected to an IRC server. - * After confirmation of a successful nick change, the getNick method - * will return the new nick. - * - * @param newNick The new nick to use. - */ - public final void changeNick(String newNick) { - this.sendRawLine("NICK " + newNick); - } - - - /** - * Identify the bot with NickServ, supplying the appropriate password. - * Some IRC Networks (such as freenode) require users to <i>register</i> and - * <i>identify</i> with NickServ before they are able to send private messages - * to other users, thus reducing the amount of spam. If you are using - * an IRC network where this kind of policy is enforced, you will need - * to make your bot <i>identify</i> itself to NickServ before you can send - * private messages. Assuming you have already registered your bot's - * nick with NickServ, this method can be used to <i>identify</i> with - * the supplied password. It usually makes sense to identify with NickServ - * immediately after connecting to a server. - * <p> - * This method issues a raw NICKSERV command to the server, and is therefore - * safer than the alternative approach of sending a private message to - * NickServ. The latter approach is considered dangerous, as it may cause - * you to inadvertently transmit your password to an untrusted party if you - * connect to a network which does not run a NickServ service and where the - * untrusted party has assumed the nick "NickServ". However, if your IRC - * network is only compatible with the private message approach, you may - * typically identify like so: - * <pre>sendMessage("NickServ", "identify PASSWORD");</pre> - * - * @param password The password which will be used to identify with NickServ. - */ - public final void identify(String password) { - this.sendRawLine("NICKSERV IDENTIFY " + password); - } - - - /** - * Set the mode of a channel. - * This method attempts to set the mode of a channel. This - * may require the bot to have operator status on the channel. - * For example, if the bot has operator status, we can grant - * operator status to "Dave" on the #cs channel - * by calling setMode("#cs", "+o Dave"); - * An alternative way of doing this would be to use the op method. - * - * @param channel The channel on which to perform the mode change. - * @param mode The new mode to apply to the channel. This may include - * zero or more arguments if necessary. - * - * @see #op(String,String) op - */ - public final void setMode(String channel, String mode) { - this.sendRawLine("MODE " + channel + " " + mode); - } - - - /** - * Sends an invitation to join a channel. Some channels can be marked - * as "invite-only", so it may be useful to allow a bot to invite people - * into it. - * - * @param nick The nick of the user to invite - * @param channel The channel you are inviting the user to join. - * - */ - public final void sendInvite(String nick, String channel) { - this.sendRawLine("INVITE " + nick + " :" + channel); - } - - - /** - * Bans a user from a channel. An example of a valid hostmask is - * "*!*compu@*.18hp.net". This may be used in conjunction with the - * kick method to permanently remove a user from a channel. - * Successful use of this method may require the bot to have operator - * status itself. - * - * @param channel The channel to ban the user from. - * @param hostmask A hostmask representing the user we're banning. - */ - public final void ban(String channel, String hostmask) { - this.sendRawLine("MODE " + channel + " +b " + hostmask); - } - - - /** - * Unbans a user from a channel. An example of a valid hostmask is - * "*!*compu@*.18hp.net". - * Successful use of this method may require the bot to have operator - * status itself. - * - * @param channel The channel to unban the user from. - * @param hostmask A hostmask representing the user we're unbanning. - */ - public final void unBan(String channel, String hostmask) { - this.sendRawLine("MODE " + channel + " -b " + hostmask); - } - - - /** - * Grants operator privilidges to a user on a channel. - * Successful use of this method may require the bot to have operator - * status itself. - * - * @param channel The channel we're opping the user on. - * @param nick The nick of the user we are opping. - */ - public final void op(String channel, String nick) { - this.setMode(channel, "+o " + nick); - } - - - /** - * Removes operator privilidges from a user on a channel. - * Successful use of this method may require the bot to have operator - * status itself. - * - * @param channel The channel we're deopping the user on. - * @param nick The nick of the user we are deopping. - */ - public final void deOp(String channel, String nick) { - this.setMode(channel, "-o " + nick); - } - - - /** - * Grants voice privilidges to a user on a channel. - * Successful use of this method may require the bot to have operator - * status itself. - * - * @param channel The channel we're voicing the user on. - * @param nick The nick of the user we are voicing. - */ - public final void voice(String channel, String nick) { - this.setMode(channel, "+v " + nick); - } - - - /** - * Removes voice privilidges from a user on a channel. - * Successful use of this method may require the bot to have operator - * status itself. - * - * @param channel The channel we're devoicing the user on. - * @param nick The nick of the user we are devoicing. - */ - public final void deVoice(String channel, String nick) { - this.setMode(channel, "-v " + nick); - } - - - /** - * Set the topic for a channel. - * This method attempts to set the topic of a channel. This - * may require the bot to have operator status if the topic - * is protected. - * - * @param channel The channel on which to perform the mode change. - * @param topic The new topic for the channel. - * - */ - public final void setTopic(String channel, String topic) { - this.sendRawLine("TOPIC " + channel + " :" + topic); - } - - - /** - * Kicks a user from a channel. - * This method attempts to kick a user from a channel and - * may require the bot to have operator status in the channel. - * - * @param channel The channel to kick the user from. - * @param nick The nick of the user to kick. - */ - public final void kick(String channel, String nick) { - this.kick(channel, nick, ""); - } - - - /** - * Kicks a user from a channel, giving a reason. - * This method attempts to kick a user from a channel and - * may require the bot to have operator status in the channel. - * - * @param channel The channel to kick the user from. - * @param nick The nick of the user to kick. - * @param reason A description of the reason for kicking a user. - */ - public final void kick(String channel, String nick, String reason) { - this.sendRawLine("KICK " + channel + " " + nick + " :" + reason); - } - - - /** - * Issues a request for a list of all channels on the IRC server. - * When the PircBot receives information for each channel, it will - * call the onChannelInfo method, which you will need to override - * if you want it to do anything useful. - * - * @see #onChannelInfo(String,int,String) onChannelInfo - */ - public final void listChannels() { - this.listChannels(null); - } - - - /** - * Issues a request for a list of all channels on the IRC server. - * When the PircBot receives information for each channel, it will - * call the onChannelInfo method, which you will need to override - * if you want it to do anything useful. - * <p> - * Some IRC servers support certain parameters for LIST requests. - * One example is a parameter of ">10" to list only those channels - * that have more than 10 users in them. Whether these parameters - * are supported or not will depend on the IRC server software. - * - * @param parameters The parameters to supply when requesting the - * list. - * - * @see #onChannelInfo(String,int,String) onChannelInfo - */ - public final void listChannels(String parameters) { - if (parameters == null) { - this.sendRawLine("LIST"); - } - else { - this.sendRawLine("LIST " + parameters); - } - } - - /** - * Adds a line to the log. This log is currently output to the standard - * output and is in the correct format for use by tools such as pisg, the - * Perl IRC Statistics Generator. You may override this method if you wish - * to do something else with log entries. - * Each line in the log begins with a number which - * represents the logging time (as the number of milliseconds since the - * epoch). This timestamp and the following log entry are separated by - * a single space character, " ". Outgoing messages are distinguishable - * by a log entry that has ">>>" immediately following the space character - * after the timestamp. DCC events use "+++" and warnings about unhandled - * Exceptions and Errors use "###". - * <p> - * This implementation of the method will only cause log entries to be - * output if the PircBot has had its verbose mode turned on by calling - * setVerbose(true); - * - * @param line The line to add to the log. - */ - public void log(String line) { - if (_verbose) { - System.out.println(System.currentTimeMillis() + " " + line); - } - } - - - /** - * This method handles events when any line of text arrives from the server, - * then calling the appropriate method in the PircBot. This method is - * protected and only called by the InputThread for this instance. - * <p> - * This method may not be overridden! - * - * @param line The raw line of text from the server. - */ - protected void handleLine(String line) { - this.log(line); - - // Check for server pings. - if (line.startsWith("PING ")) { - // Respond to the ping and return immediately. - this.onServerPing(line.substring(5)); - return; - } - - String sourceNick = ""; - String sourceLogin = ""; - String sourceHostname = ""; - - StringTokenizer tokenizer = new StringTokenizer(line); - String senderInfo = tokenizer.nextToken(); - String command = tokenizer.nextToken(); - String target = null; - - int exclamation = senderInfo.indexOf("!"); - int at = senderInfo.indexOf("@"); - if (senderInfo.startsWith(":")) { - if (exclamation > 0 && at > 0 && exclamation < at) { - sourceNick = senderInfo.substring(1, exclamation); - sourceLogin = senderInfo.substring(exclamation + 1, at); - sourceHostname = senderInfo.substring(at + 1); - } - else { - - if (tokenizer.hasMoreTokens()) { - String token = command; - - int code = -1; - try { - code = Integer.parseInt(token); - } - catch (NumberFormatException e) { - // Keep the existing value. - } - - if (code != -1) { - String errorStr = token; - String response = line.substring(line.indexOf(errorStr, senderInfo.length()) + 4, line.length()); - this.processServerResponse(code, response); - // Return from the method. - return; - } - else { - // This is not a server response. - // It must be a nick without login and hostname. - // (or maybe a NOTICE or suchlike from the server) - sourceNick = senderInfo; - target = token; - } - } - else { - // We don't know what this line means. - this.onUnknown(line); - // Return from the method; - return; - } - - } - } - - command = command.toUpperCase(Locale.ENGLISH); - if (sourceNick.startsWith(":")) { - sourceNick = sourceNick.substring(1); - } - if (target == null) { - target = tokenizer.nextToken(); - } - if (target.startsWith(":")) { - target = target.substring(1); - } - - // Check for CTCP requests. - if (command.equals("PRIVMSG") && line.indexOf(":\u0001") > 0 && line.endsWith("\u0001")) { - String request = line.substring(line.indexOf(":\u0001") + 2, line.length() - 1); - if (request.equals("VERSION")) { - // VERSION request - this.onVersion(sourceNick, sourceLogin, sourceHostname, target); - } - else if (request.startsWith("ACTION ")) { - // ACTION request - this.onAction(sourceNick, sourceLogin, sourceHostname, target, request.substring(7)); - } - else if (request.startsWith("PING ")) { - // PING request - this.onPing(sourceNick, sourceLogin, sourceHostname, target, request.substring(5)); - } - else if (request.equals("TIME")) { - // TIME request - this.onTime(sourceNick, sourceLogin, sourceHostname, target); - } - else if (request.equals("FINGER")) { - // FINGER request - this.onFinger(sourceNick, sourceLogin, sourceHostname, target); - } - else { - // An unknown CTCP message - ignore it. - this.onUnknown(line); - } - } - else if (command.equals("PRIVMSG") && _channelPrefixes.indexOf(target.charAt(0)) >= 0) { - // This is a normal message to a channel. - this.onMessage(target, sourceNick, sourceLogin, sourceHostname, line.substring(line.indexOf(" :") + 2)); - } - else if (command.equals("PRIVMSG")) { - // This is a private message to us. - this.onPrivateMessage(sourceNick, sourceLogin, sourceHostname, line.substring(line.indexOf(" :") + 2)); - } - else if (command.equals("JOIN")) { - // Someone is joining a channel. - String channel = target; - this.addUser(channel, new User("", sourceNick)); - this.onJoin(channel, sourceNick, sourceLogin, sourceHostname); - } - else if (command.equals("PART")) { - // Someone is parting from a channel. - this.removeUser(target, sourceNick); - if (sourceNick.equals(this.getNick())) { - this.removeChannel(target); - } - this.onPart(target, sourceNick, sourceLogin, sourceHostname); - } - else if (command.equals("NICK")) { - // Somebody is changing their nick. - String newNick = target; - this.renameUser(sourceNick, newNick); - if (sourceNick.equals(this.getNick())) { - // Update our nick if it was us that changed nick. - this.setNick(newNick); - } - this.onNickChange(sourceNick, sourceLogin, sourceHostname, newNick); - } - else if (command.equals("NOTICE")) { - // Someone is sending a notice. - this.onNotice(sourceNick, sourceLogin, sourceHostname, target, line.substring(line.indexOf(" :") + 2)); - } - else if (command.equals("QUIT")) { - // Someone has quit from the IRC server. - if (sourceNick.equals(this.getNick())) { - this.removeAllChannels(); - } - else { - this.removeUser(sourceNick); - } - this.onQuit(sourceNick, sourceLogin, sourceHostname, line.substring(line.indexOf(" :") + 2)); - } - else if (command.equals("KICK")) { - // Somebody has been kicked from a channel. - String recipient = tokenizer.nextToken(); - if (recipient.equals(this.getNick())) { - this.removeChannel(target); - } - this.removeUser(target, recipient); - this.onKick(target, sourceNick, sourceLogin, sourceHostname, recipient, line.substring(line.indexOf(" :") + 2)); - } - else if (command.equals("MODE")) { - // Somebody is changing the mode on a channel or user. - String mode = line.substring(line.indexOf(target, 2) + target.length() + 1); - if (mode.startsWith(":")) { - mode = mode.substring(1); - } - this.processMode(target, sourceNick, sourceLogin, sourceHostname, mode); - } - else if (command.equals("TOPIC")) { - // Someone is changing the topic. - this.onTopic(target, line.substring(line.indexOf(" :") + 2), sourceNick, System.currentTimeMillis(), true); - } - else if (command.equals("INVITE")) { - // Somebody is inviting somebody else into a channel. - this.onInvite(target, sourceNick, sourceLogin, sourceHostname, line.substring(line.indexOf(" :") + 2)); - } - else { - // If we reach this point, then we've found something that the PircBot - // Doesn't currently deal with. - this.onUnknown(line); - } - - } - - - /** - * This method is called once the PircBot has successfully connected to - * the IRC server. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @since PircBot 0.9.6 - */ - protected void onConnect() {} - - - /** - * This method carries out the actions to be performed when the PircBot - * gets disconnected. This may happen if the PircBot quits from the - * server, or if the connection is unexpectedly lost. - * <p> - * Disconnection from the IRC server is detected immediately if either - * we or the server close the connection normally. If the connection to - * the server is lost, but neither we nor the server have explicitly closed - * the connection, then it may take a few minutes to detect (this is - * commonly referred to as a "ping timeout"). - * <p> - * If you wish to get your IRC bot to automatically rejoin a server after - * the connection has been lost, then this is probably the ideal method to - * override to implement such functionality. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - */ - protected void onDisconnect() {} - - - /** - * This method is called by the PircBot when a numeric response - * is received from the IRC server. We use this method to - * allow PircBot to process various responses from the server - * before then passing them on to the onServerResponse method. - * <p> - * Note that this method is private and should not appear in any - * of the javadoc generated documenation. - * - * @param code The three-digit numerical code for the response. - * @param response The full response from the IRC server. - */ - private final void processServerResponse(int code, String response) { - - if (code == RPL_LIST) { - // This is a bit of information about a channel. - int firstSpace = response.indexOf(' '); - int secondSpace = response.indexOf(' ', firstSpace + 1); - int thirdSpace = response.indexOf(' ', secondSpace + 1); - int colon = response.indexOf(':'); - String channel = response.substring(firstSpace + 1, secondSpace); - int userCount = 0; - try { - userCount = Integer.parseInt(response.substring(secondSpace + 1, thirdSpace)); - } - catch (NumberFormatException e) { - // Stick with the value of zero. - } - String topic = response.substring(colon + 1); - this.onChannelInfo(channel, userCount, topic); - } - else if (code == RPL_TOPIC) { - // This is topic information about a channel we've just joined. - int firstSpace = response.indexOf(' '); - int secondSpace = response.indexOf(' ', firstSpace + 1); - int colon = response.indexOf(':'); - String channel = response.substring(firstSpace + 1, secondSpace); - String topic = response.substring(colon + 1); - - _topics.put(channel, topic); - - // For backwards compatibility only - this onTopic method is deprecated. - this.onTopic(channel, topic); - } - else if (code == RPL_TOPICINFO) { - StringTokenizer tokenizer = new StringTokenizer(response); - tokenizer.nextToken(); - String channel = tokenizer.nextToken(); - String setBy = tokenizer.nextToken(); - long date = 0; - try { - date = Long.parseLong(tokenizer.nextToken()) * 1000; - } - catch (NumberFormatException e) { - // Stick with the default value of zero. - } - - String topic = (String) _topics.get(channel); - _topics.remove(channel); - - this.onTopic(channel, topic, setBy, date, false); - } - else if (code == RPL_NAMREPLY) { - // This is a list of nicks in a channel that we've just joined. - int channelEndIndex = response.indexOf(" :"); - String channel = response.substring(response.lastIndexOf(' ', channelEndIndex - 1) + 1, channelEndIndex); - - StringTokenizer tokenizer = new StringTokenizer(response.substring(response.indexOf(" :") + 2)); - while (tokenizer.hasMoreTokens()) { - String nick = tokenizer.nextToken(); - String prefix = ""; - if (nick.startsWith("@")) { - // User is an operator in this channel. - prefix = "@"; - } - else if (nick.startsWith("+")) { - // User is voiced in this channel. - prefix = "+"; - } - else if (nick.startsWith(".")) { - // Some wibbly status I've never seen before... - prefix = "."; - } - nick = nick.substring(prefix.length()); - this.addUser(channel, new User(prefix, nick)); - } - } - else if (code == RPL_ENDOFNAMES) { - // This is the end of a NAMES list, so we know that we've got - // the full list of users in the channel that we just joined. - String channel = response.substring(response.indexOf(' ') + 1, response.indexOf(" :")); - User[] users = this.getUsers(channel); - this.onUserList(channel, users); - } - - this.onServerResponse(code, response); - } - - - /** - * This method is called when we receive a numeric response from the - * IRC server. - * <p> - * Numerics in the range from 001 to 099 are used for client-server - * connections only and should never travel between servers. Replies - * generated in response to commands are found in the range from 200 - * to 399. Error replies are found in the range from 400 to 599. - * <p> - * For example, we can use this method to discover the topic of a - * channel when we join it. If we join the channel #test which - * has a topic of "I am King of Test" then the response - * will be "<code>PircBot #test :I Am King of Test</code>" - * with a code of 332 to signify that this is a topic. - * (This is just an example - note that overriding the - * <code>onTopic</code> method is an easier way of finding the - * topic for a channel). Check the IRC RFC for the full list of other - * command response codes. - * <p> - * PircBot implements the interface ReplyConstants, which contains - * contstants that you may find useful here. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @param code The three-digit numerical code for the response. - * @param response The full response from the IRC server. - * - * @see ReplyConstants - */ - protected void onServerResponse(int code, String response) {} - - - /** - * This method is called when we receive a user list from the server - * after joining a channel. - * <p> - * Shortly after joining a channel, the IRC server sends a list of all - * users in that channel. The PircBot collects this information and - * calls this method as soon as it has the full list. - * <p> - * To obtain the nick of each user in the channel, call the getNick() - * method on each User object in the array. - * <p> - * At a later time, you may call the getUsers method to obtain an - * up to date list of the users in the channel. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @since PircBot 1.0.0 - * - * @param channel The name of the channel. - * @param users An array of User objects belonging to this channel. - * - * @see User - */ - protected void onUserList(String channel, User[] users) {} - - - /** - * This method is called whenever a message is sent to a channel. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @param channel The channel to which the message was sent. - * @param sender The nick of the person who sent the message. - * @param login The login of the person who sent the message. - * @param hostname The hostname of the person who sent the message. - * @param message The actual message sent to the channel. - */ - protected void onMessage(String channel, String sender, String login, String hostname, String message) {} - - - /** - * This method is called whenever a private message is sent to the PircBot. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @param sender The nick of the person who sent the private message. - * @param login The login of the person who sent the private message. - * @param hostname The hostname of the person who sent the private message. - * @param message The actual message. - */ - protected void onPrivateMessage(String sender, String login, String hostname, String message) {} - - - /** - * This method is called whenever an ACTION is sent from a user. E.g. - * such events generated by typing "/me goes shopping" in most IRC clients. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @param sender The nick of the user that sent the action. - * @param login The login of the user that sent the action. - * @param hostname The hostname of the user that sent the action. - * @param target The target of the action, be it a channel or our nick. - * @param action The action carried out by the user. - */ - protected void onAction(String sender, String login, String hostname, String target, String action) {} - - - /** - * This method is called whenever we receive a notice. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @param sourceNick The nick of the user that sent the notice. - * @param sourceLogin The login of the user that sent the notice. - * @param sourceHostname The hostname of the user that sent the notice. - * @param target The target of the notice, be it our nick or a channel name. - * @param notice The notice message. - */ - protected void onNotice(String sourceNick, String sourceLogin, String sourceHostname, String target, String notice) {} - - - /** - * This method is called whenever someone (possibly us) joins a channel - * which we are on. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @param channel The channel which somebody joined. - * @param sender The nick of the user who joined the channel. - * @param login The login of the user who joined the channel. - * @param hostname The hostname of the user who joined the channel. - */ - protected void onJoin(String channel, String sender, String login, String hostname) {} - - - /** - * This method is called whenever someone (possibly us) parts a channel - * which we are on. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @param channel The channel which somebody parted from. - * @param sender The nick of the user who parted from the channel. - * @param login The login of the user who parted from the channel. - * @param hostname The hostname of the user who parted from the channel. - */ - protected void onPart(String channel, String sender, String login, String hostname) {} - - - /** - * This method is called whenever someone (possibly us) changes nick on any - * of the channels that we are on. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @param oldNick The old nick. - * @param login The login of the user. - * @param hostname The hostname of the user. - * @param newNick The new nick. - */ - protected void onNickChange(String oldNick, String login, String hostname, String newNick) {} - - - /** - * This method is called whenever someone (possibly us) is kicked from - * any of the channels that we are in. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @param channel The channel from which the recipient was kicked. - * @param kickerNick The nick of the user who performed the kick. - * @param kickerLogin The login of the user who performed the kick. - * @param kickerHostname The hostname of the user who performed the kick. - * @param recipientNick The unfortunate recipient of the kick. - * @param reason The reason given by the user who performed the kick. - */ - protected void onKick(String channel, String kickerNick, String kickerLogin, String kickerHostname, String recipientNick, String reason) {} - - - /** - * This method is called whenever someone (possibly us) quits from the - * server. We will only observe this if the user was in one of the - * channels to which we are connected. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @param sourceNick The nick of the user that quit from the server. - * @param sourceLogin The login of the user that quit from the server. - * @param sourceHostname The hostname of the user that quit from the server. - * @param reason The reason given for quitting the server. - */ - protected void onQuit(String sourceNick, String sourceLogin, String sourceHostname, String reason) {} - - - /** - * This method is called whenever a user sets the topic, or when - * PircBot joins a new channel and discovers its topic. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @param channel The channel that the topic belongs to. - * @param topic The topic for the channel. - * - * @deprecated As of 1.2.0, replaced by {@link #onTopic(String,String,String,long,boolean)} - */ - protected void onTopic(String channel, String topic) {} - - - /** - * This method is called whenever a user sets the topic, or when - * PircBot joins a new channel and discovers its topic. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @param channel The channel that the topic belongs to. - * @param topic The topic for the channel. - * @param setBy The nick of the user that set the topic. - * @param date When the topic was set (milliseconds since the epoch). - * @param changed True if the topic has just been changed, false if - * the topic was already there. - * - */ - protected void onTopic(String channel, String topic, String setBy, long date, boolean changed) {} - - - /** - * After calling the listChannels() method in PircBot, the server - * will start to send us information about each channel on the - * server. You may override this method in order to receive the - * information about each channel as soon as it is received. - * <p> - * Note that certain channels, such as those marked as hidden, - * may not appear in channel listings. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @param channel The name of the channel. - * @param userCount The number of users visible in this channel. - * @param topic The topic for this channel. - * - * @see #listChannels() listChannels - */ - protected void onChannelInfo(String channel, int userCount, String topic) {} - - - /** - * Called when the mode of a channel is set. We process this in - * order to call the appropriate onOp, onDeop, etc method before - * finally calling the override-able onMode method. - * <p> - * Note that this method is private and is not intended to appear - * in the javadoc generated documentation. - * - * @param target The channel or nick that the mode operation applies to. - * @param sourceNick The nick of the user that set the mode. - * @param sourceLogin The login of the user that set the mode. - * @param sourceHostname The hostname of the user that set the mode. - * @param mode The mode that has been set. - */ - private final void processMode(String target, String sourceNick, String sourceLogin, String sourceHostname, String mode) { - - if (_channelPrefixes.indexOf(target.charAt(0)) >= 0) { - // The mode of a channel is being changed. - String channel = target; - StringTokenizer tok = new StringTokenizer(mode); - String[] params = new String[tok.countTokens()]; - - int t = 0; - while (tok.hasMoreTokens()) { - params[t] = tok.nextToken(); - t++; - } - - char pn = ' '; - int p = 1; - - // All of this is very large and ugly, but it's the only way of providing - // what the users want :-/ - for (int i = 0; i < params[0].length(); i++) { - char atPos = params[0].charAt(i); - - if (atPos == '+' || atPos == '-') { - pn = atPos; - } - else if (atPos == 'o') { - if (pn == '+') { - this.updateUser(channel, OP_ADD, params[p]); - onOp(channel, sourceNick, sourceLogin, sourceHostname, params[p]); - } - else { - this.updateUser(channel, OP_REMOVE, params[p]); - onDeop(channel, sourceNick, sourceLogin, sourceHostname, params[p]); - } - p++; - } - else if (atPos == 'v') { - if (pn == '+') { - this.updateUser(channel, VOICE_ADD, params[p]); - onVoice(channel, sourceNick, sourceLogin, sourceHostname, params[p]); - } - else { - this.updateUser(channel, VOICE_REMOVE, params[p]); - onDeVoice(channel, sourceNick, sourceLogin, sourceHostname, params[p]); - } - p++; - } - else if (atPos == 'k') { - if (pn == '+') { - onSetChannelKey(channel, sourceNick, sourceLogin, sourceHostname, params[p]); - } - else { - onRemoveChannelKey(channel, sourceNick, sourceLogin, sourceHostname, params[p]); - } - p++; - } - else if (atPos == 'l') { - if (pn == '+') { - onSetChannelLimit(channel, sourceNick, sourceLogin, sourceHostname, Integer.parseInt(params[p])); - p++; - } - else { - onRemoveChannelLimit(channel, sourceNick, sourceLogin, sourceHostname); - } - } - else if (atPos == 'b') { - if (pn == '+') { - onSetChannelBan(channel, sourceNick, sourceLogin, sourceHostname,params[p]); - } - else { - onRemoveChannelBan(channel, sourceNick, sourceLogin, sourceHostname, params[p]); - } - p++; - } - else if (atPos == 't') { - if (pn == '+') { - onSetTopicProtection(channel, sourceNick, sourceLogin, sourceHostname); - } - else { - onRemoveTopicProtection(channel, sourceNick, sourceLogin, sourceHostname); - } - } - else if (atPos == 'n') { - if (pn == '+') { - onSetNoExternalMessages(channel, sourceNick, sourceLogin, sourceHostname); - } - else { - onRemoveNoExternalMessages(channel, sourceNick, sourceLogin, sourceHostname); - } - } - else if (atPos == 'i') { - if (pn == '+') { - onSetInviteOnly(channel, sourceNick, sourceLogin, sourceHostname); - } - else { - onRemoveInviteOnly(channel, sourceNick, sourceLogin, sourceHostname); - } - } - else if (atPos == 'm') { - if (pn == '+') { - onSetModerated(channel, sourceNick, sourceLogin, sourceHostname); - } - else { - onRemoveModerated(channel, sourceNick, sourceLogin, sourceHostname); - } - } - else if (atPos == 'p') { - if (pn == '+') { - onSetPrivate(channel, sourceNick, sourceLogin, sourceHostname); - } - else { - onRemovePrivate(channel, sourceNick, sourceLogin, sourceHostname); - } - } - else if (atPos == 's') { - if (pn == '+') { - onSetSecret(channel, sourceNick, sourceLogin, sourceHostname); - } - else { - onRemoveSecret(channel, sourceNick, sourceLogin, sourceHostname); - } - } - } - - this.onMode(channel, sourceNick, sourceLogin, sourceHostname, mode); - } - else { - // The mode of a user is being changed. - String nick = target; - this.onUserMode(nick, sourceNick, sourceLogin, sourceHostname, mode); - } - } - - - /** - * Called when the mode of a channel is set. - * <p> - * You may find it more convenient to decode the meaning of the mode - * string by overriding the onOp, onDeOp, onVoice, onDeVoice, - * onChannelKey, onDeChannelKey, onChannelLimit, onDeChannelLimit, - * onChannelBan or onDeChannelBan methods as appropriate. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @param channel The channel that the mode operation applies to. - * @param sourceNick The nick of the user that set the mode. - * @param sourceLogin The login of the user that set the mode. - * @param sourceHostname The hostname of the user that set the mode. - * @param mode The mode that has been set. - * - */ - protected void onMode(String channel, String sourceNick, String sourceLogin, String sourceHostname, String mode) {} - - - /** - * Called when the mode of a user is set. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @since PircBot 1.2.0 - * - * @param targetNick The nick that the mode operation applies to. - * @param sourceNick The nick of the user that set the mode. - * @param sourceLogin The login of the user that set the mode. - * @param sourceHostname The hostname of the user that set the mode. - * @param mode The mode that has been set. - * - */ - protected void onUserMode(String targetNick, String sourceNick, String sourceLogin, String sourceHostname, String mode) {} - - - - /** - * Called when a user (possibly us) gets granted operator status for a channel. - * <p> - * This is a type of mode change and is also passed to the onMode - * method in the PircBot class. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @since PircBot 0.9.5 - * - * @param channel The channel in which the mode change took place. - * @param sourceNick The nick of the user that performed the mode change. - * @param sourceLogin The login of the user that performed the mode change. - * @param sourceHostname The hostname of the user that performed the mode change. - * @param recipient The nick of the user that got 'opped'. - */ - protected void onOp(String channel, String sourceNick, String sourceLogin, String sourceHostname, String recipient) {} - - - /** - * Called when a user (possibly us) gets operator status taken away. - * <p> - * This is a type of mode change and is also passed to the onMode - * method in the PircBot class. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @since PircBot 0.9.5 - * - * @param channel The channel in which the mode change took place. - * @param sourceNick The nick of the user that performed the mode change. - * @param sourceLogin The login of the user that performed the mode change. - * @param sourceHostname The hostname of the user that performed the mode change. - * @param recipient The nick of the user that got 'deopped'. - */ - protected void onDeop(String channel, String sourceNick, String sourceLogin, String sourceHostname, String recipient) {} - - - /** - * Called when a user (possibly us) gets voice status granted in a channel. - * <p> - * This is a type of mode change and is also passed to the onMode - * method in the PircBot class. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @since PircBot 0.9.5 - * - * @param channel The channel in which the mode change took place. - * @param sourceNick The nick of the user that performed the mode change. - * @param sourceLogin The login of the user that performed the mode change. - * @param sourceHostname The hostname of the user that performed the mode change. - * @param recipient The nick of the user that got 'voiced'. - */ - protected void onVoice(String channel, String sourceNick, String sourceLogin, String sourceHostname, String recipient) {} - - - /** - * Called when a user (possibly us) gets voice status removed. - * <p> - * This is a type of mode change and is also passed to the onMode - * method in the PircBot class. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @since PircBot 0.9.5 - * - * @param channel The channel in which the mode change took place. - * @param sourceNick The nick of the user that performed the mode change. - * @param sourceLogin The login of the user that performed the mode change. - * @param sourceHostname The hostname of the user that performed the mode change. - * @param recipient The nick of the user that got 'devoiced'. - */ - protected void onDeVoice(String channel, String sourceNick, String sourceLogin, String sourceHostname, String recipient) {} - - - /** - * Called when a channel key is set. When the channel key has been set, - * other users may only join that channel if they know the key. Channel keys - * are sometimes referred to as passwords. - * <p> - * This is a type of mode change and is also passed to the onMode - * method in the PircBot class. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @since PircBot 0.9.5 - * - * @param channel The channel in which the mode change took place. - * @param sourceNick The nick of the user that performed the mode change. - * @param sourceLogin The login of the user that performed the mode change. - * @param sourceHostname The hostname of the user that performed the mode change. - * @param key The new key for the channel. - */ - protected void onSetChannelKey(String channel, String sourceNick, String sourceLogin, String sourceHostname, String key) {} - - - /** - * Called when a channel key is removed. - * <p> - * This is a type of mode change and is also passed to the onMode - * method in the PircBot class. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @since PircBot 0.9.5 - * - * @param channel The channel in which the mode change took place. - * @param sourceNick The nick of the user that performed the mode change. - * @param sourceLogin The login of the user that performed the mode change. - * @param sourceHostname The hostname of the user that performed the mode change. - * @param key The key that was in use before the channel key was removed. - */ - protected void onRemoveChannelKey(String channel, String sourceNick, String sourceLogin, String sourceHostname, String key) {} - - - /** - * Called when a user limit is set for a channel. The number of users in - * the channel cannot exceed this limit. - * <p> - * This is a type of mode change and is also passed to the onMode - * method in the PircBot class. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @since PircBot 0.9.5 - * - * @param channel The channel in which the mode change took place. - * @param sourceNick The nick of the user that performed the mode change. - * @param sourceLogin The login of the user that performed the mode change. - * @param sourceHostname The hostname of the user that performed the mode change. - * @param limit The maximum number of users that may be in this channel at the same time. - */ - protected void onSetChannelLimit(String channel, String sourceNick, String sourceLogin, String sourceHostname, int limit) {} - - - /** - * Called when the user limit is removed for a channel. - * <p> - * This is a type of mode change and is also passed to the onMode - * method in the PircBot class. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @since PircBot 0.9.5 - * - * @param channel The channel in which the mode change took place. - * @param sourceNick The nick of the user that performed the mode change. - * @param sourceLogin The login of the user that performed the mode change. - * @param sourceHostname The hostname of the user that performed the mode change. - */ - protected void onRemoveChannelLimit(String channel, String sourceNick, String sourceLogin, String sourceHostname) {} - - - /** - * Called when a user (possibly us) gets banned from a channel. Being - * banned from a channel prevents any user with a matching hostmask from - * joining the channel. For this reason, most bans are usually directly - * followed by the user being kicked :-) - * <p> - * This is a type of mode change and is also passed to the onMode - * method in the PircBot class. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @since PircBot 0.9.5 - * - * @param channel The channel in which the mode change took place. - * @param sourceNick The nick of the user that performed the mode change. - * @param sourceLogin The login of the user that performed the mode change. - * @param sourceHostname The hostname of the user that performed the mode change. - * @param hostmask The hostmask of the user that has been banned. - */ - protected void onSetChannelBan(String channel, String sourceNick, String sourceLogin, String sourceHostname, String hostmask) {} - - - /** - * Called when a hostmask ban is removed from a channel. - * <p> - * This is a type of mode change and is also passed to the onMode - * method in the PircBot class. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @since PircBot 0.9.5 - * - * @param channel The channel in which the mode change took place. - * @param sourceNick The nick of the user that performed the mode change. - * @param sourceLogin The login of the user that performed the mode change. - * @param sourceHostname The hostname of the user that performed the mode change. - * @param hostmask - */ - protected void onRemoveChannelBan(String channel, String sourceNick, String sourceLogin, String sourceHostname, String hostmask) {} - - - /** - * Called when topic protection is enabled for a channel. Topic protection - * means that only operators in a channel may change the topic. - * <p> - * This is a type of mode change and is also passed to the onMode - * method in the PircBot class. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @since PircBot 0.9.5 - * - * @param channel The channel in which the mode change took place. - * @param sourceNick The nick of the user that performed the mode change. - * @param sourceLogin The login of the user that performed the mode change. - * @param sourceHostname The hostname of the user that performed the mode change. - */ - protected void onSetTopicProtection(String channel, String sourceNick, String sourceLogin, String sourceHostname) {} - - - /** - * Called when topic protection is removed for a channel. - * <p> - * This is a type of mode change and is also passed to the onMode - * method in the PircBot class. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @since PircBot 0.9.5 - * - * @param channel The channel in which the mode change took place. - * @param sourceNick The nick of the user that performed the mode change. - * @param sourceLogin The login of the user that performed the mode change. - * @param sourceHostname The hostname of the user that performed the mode change. - */ - protected void onRemoveTopicProtection(String channel, String sourceNick, String sourceLogin, String sourceHostname) {} - - - /** - * Called when a channel is set to only allow messages from users that - * are in the channel. - * <p> - * This is a type of mode change and is also passed to the onMode - * method in the PircBot class. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @since PircBot 0.9.5 - * - * @param channel The channel in which the mode change took place. - * @param sourceNick The nick of the user that performed the mode change. - * @param sourceLogin The login of the user that performed the mode change. - * @param sourceHostname The hostname of the user that performed the mode change. - */ - protected void onSetNoExternalMessages(String channel, String sourceNick, String sourceLogin, String sourceHostname) {} - - - /** - * Called when a channel is set to allow messages from any user, even - * if they are not actually in the channel. - * <p> - * This is a type of mode change and is also passed to the onMode - * method in the PircBot class. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @since PircBot 0.9.5 - * - * @param channel The channel in which the mode change took place. - * @param sourceNick The nick of the user that performed the mode change. - * @param sourceLogin The login of the user that performed the mode change. - * @param sourceHostname The hostname of the user that performed the mode change. - */ - protected void onRemoveNoExternalMessages(String channel, String sourceNick, String sourceLogin, String sourceHostname) {} - - - /** - * Called when a channel is set to 'invite only' mode. A user may only - * join the channel if they are invited by someone who is already in the - * channel. - * <p> - * This is a type of mode change and is also passed to the onMode - * method in the PircBot class. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @since PircBot 0.9.5 - * - * @param channel The channel in which the mode change took place. - * @param sourceNick The nick of the user that performed the mode change. - * @param sourceLogin The login of the user that performed the mode change. - * @param sourceHostname The hostname of the user that performed the mode change. - */ - protected void onSetInviteOnly(String channel, String sourceNick, String sourceLogin, String sourceHostname) {} - - - /** - * Called when a channel has 'invite only' removed. - * <p> - * This is a type of mode change and is also passed to the onMode - * method in the PircBot class. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @since PircBot 0.9.5 - * - * @param channel The channel in which the mode change took place. - * @param sourceNick The nick of the user that performed the mode change. - * @param sourceLogin The login of the user that performed the mode change. - * @param sourceHostname The hostname of the user that performed the mode change. - */ - protected void onRemoveInviteOnly(String channel, String sourceNick, String sourceLogin, String sourceHostname) {} - - - /** - * Called when a channel is set to 'moderated' mode. If a channel is - * moderated, then only users who have been 'voiced' or 'opped' may speak - * or change their nicks. - * <p> - * This is a type of mode change and is also passed to the onMode - * method in the PircBot class. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @since PircBot 0.9.5 - * - * @param channel The channel in which the mode change took place. - * @param sourceNick The nick of the user that performed the mode change. - * @param sourceLogin The login of the user that performed the mode change. - * @param sourceHostname The hostname of the user that performed the mode change. - */ - protected void onSetModerated(String channel, String sourceNick, String sourceLogin, String sourceHostname) {} - - - /** - * Called when a channel has moderated mode removed. - * <p> - * This is a type of mode change and is also passed to the onMode - * method in the PircBot class. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @since PircBot 0.9.5 - * - * @param channel The channel in which the mode change took place. - * @param sourceNick The nick of the user that performed the mode change. - * @param sourceLogin The login of the user that performed the mode change. - * @param sourceHostname The hostname of the user that performed the mode change. - */ - protected void onRemoveModerated(String channel, String sourceNick, String sourceLogin, String sourceHostname) {} - - - /** - * Called when a channel is marked as being in private mode. - * <p> - * This is a type of mode change and is also passed to the onMode - * method in the PircBot class. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @since PircBot 0.9.5 - * - * @param channel The channel in which the mode change took place. - * @param sourceNick The nick of the user that performed the mode change. - * @param sourceLogin The login of the user that performed the mode change. - * @param sourceHostname The hostname of the user that performed the mode change. - */ - protected void onSetPrivate(String channel, String sourceNick, String sourceLogin, String sourceHostname) {} - - - /** - * Called when a channel is marked as not being in private mode. - * <p> - * This is a type of mode change and is also passed to the onMode - * method in the PircBot class. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @since PircBot 0.9.5 - * - * @param channel The channel in which the mode change took place. - * @param sourceNick The nick of the user that performed the mode change. - * @param sourceLogin The login of the user that performed the mode change. - * @param sourceHostname The hostname of the user that performed the mode change. - */ - protected void onRemovePrivate(String channel, String sourceNick, String sourceLogin, String sourceHostname) {} - - - /** - * Called when a channel is set to be in 'secret' mode. Such channels - * typically do not appear on a server's channel listing. - * <p> - * This is a type of mode change and is also passed to the onMode - * method in the PircBot class. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @since PircBot 0.9.5 - * - * @param channel The channel in which the mode change took place. - * @param sourceNick The nick of the user that performed the mode change. - * @param sourceLogin The login of the user that performed the mode change. - * @param sourceHostname The hostname of the user that performed the mode change. - */ - protected void onSetSecret(String channel, String sourceNick, String sourceLogin, String sourceHostname) {} - - - /** - * Called when a channel has 'secret' mode removed. - * <p> - * This is a type of mode change and is also passed to the onMode - * method in the PircBot class. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @since PircBot 0.9.5 - * - * @param channel The channel in which the mode change took place. - * @param sourceNick The nick of the user that performed the mode change. - * @param sourceLogin The login of the user that performed the mode change. - * @param sourceHostname The hostname of the user that performed the mode change. - */ - protected void onRemoveSecret(String channel, String sourceNick, String sourceLogin, String sourceHostname) {} - - - /** - * Called when we are invited to a channel by a user. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @since PircBot 0.9.5 - * - * @param targetNick The nick of the user being invited - should be us! - * @param sourceNick The nick of the user that sent the invitation. - * @param sourceLogin The login of the user that sent the invitation. - * @param sourceHostname The hostname of the user that sent the invitation. - * @param channel The channel that we're being invited to. - */ - protected void onInvite(String targetNick, String sourceNick, String sourceLogin, String sourceHostname, String channel) {} - - - /** - * This method used to be called when a DCC SEND request was sent to the PircBot. - * Please use the onIncomingFileTransfer method to receive files, as it - * has better functionality and supports resuming. - * - * @deprecated As of PircBot 1.2.0, use {@link #onIncomingFileTransfer(DccFileTransfer)} - */ - protected void onDccSendRequest(String sourceNick, String sourceLogin, String sourceHostname, String filename, long address, int port, int size) {} - - - /** - * This method used to be called when a DCC CHAT request was sent to the PircBot. - * Please use the onIncomingChatRequest method to accept chats, as it - * has better functionality. - * - * @deprecated As of PircBot 1.2.0, use {@link #onIncomingChatRequest(DccChat)} - */ - protected void onDccChatRequest(String sourceNick, String sourceLogin, String sourceHostname, long address, int port) {} - - - /** - * This method is called whenever we receive a VERSION request. - * This abstract implementation responds with the PircBot's _version string, - * so if you override this method, be sure to either mimic its functionality - * or to call super.onVersion(...); - * - * @param sourceNick The nick of the user that sent the VERSION request. - * @param sourceLogin The login of the user that sent the VERSION request. - * @param sourceHostname The hostname of the user that sent the VERSION request. - * @param target The target of the VERSION request, be it our nick or a channel name. - */ - protected void onVersion(String sourceNick, String sourceLogin, String sourceHostname, String target) { - this.sendRawLine("NOTICE " + sourceNick + " :\u0001VERSION " + _version + "\u0001"); - } - - - /** - * This method is called whenever we receive a PING request from another - * user. - * <p> - * This abstract implementation responds correctly, so if you override this - * method, be sure to either mimic its functionality or to call - * super.onPing(...); - * - * @param sourceNick The nick of the user that sent the PING request. - * @param sourceLogin The login of the user that sent the PING request. - * @param sourceHostname The hostname of the user that sent the PING request. - * @param target The target of the PING request, be it our nick or a channel name. - * @param pingValue The value that was supplied as an argument to the PING command. - */ - protected void onPing(String sourceNick, String sourceLogin, String sourceHostname, String target, String pingValue) { - this.sendRawLine("NOTICE " + sourceNick + " :\u0001PING " + pingValue + "\u0001"); - } - - - /** - * The actions to perform when a PING request comes from the server. - * <p> - * This sends back a correct response, so if you override this method, - * be sure to either mimic its functionality or to call - * super.onServerPing(response); - * - * @param response The response that should be given back in your PONG. - */ - protected void onServerPing(String response) { - this.sendRawLine("PONG " + response); - } - - - /** - * This method is called whenever we receive a TIME request. - * <p> - * This abstract implementation responds correctly, so if you override this - * method, be sure to either mimic its functionality or to call - * super.onTime(...); - * - * @param sourceNick The nick of the user that sent the TIME request. - * @param sourceLogin The login of the user that sent the TIME request. - * @param sourceHostname The hostname of the user that sent the TIME request. - * @param target The target of the TIME request, be it our nick or a channel name. - */ - protected void onTime(String sourceNick, String sourceLogin, String sourceHostname, String target) { - this.sendRawLine("NOTICE " + sourceNick + " :\u0001TIME " + new Date().toString() + "\u0001"); - } - - - /** - * This method is called whenever we receive a FINGER request. - * <p> - * This abstract implementation responds correctly, so if you override this - * method, be sure to either mimic its functionality or to call - * super.onFinger(...); - * - * @param sourceNick The nick of the user that sent the FINGER request. - * @param sourceLogin The login of the user that sent the FINGER request. - * @param sourceHostname The hostname of the user that sent the FINGER request. - * @param target The target of the FINGER request, be it our nick or a channel name. - */ - protected void onFinger(String sourceNick, String sourceLogin, String sourceHostname, String target) { - this.sendRawLine("NOTICE " + sourceNick + " :\u0001FINGER " + _finger + "\u0001"); - } - - - /** - * This method is called whenever we receive a line from the server that - * the PircBot has not been programmed to recognise. - * <p> - * The implementation of this method in the PircBot abstract class - * performs no actions and may be overridden as required. - * - * @param line The raw line that was received from the server. - */ - protected void onUnknown(String line) { - // And then there were none :) - } - - - /** - * Sets the verbose mode. If verbose mode is set to true, then log entries - * will be printed to the standard output. The default value is false and - * will result in no output. For general development, we strongly recommend - * setting the verbose mode to true. - * - * @param verbose true if verbose mode is to be used. Default is false. - */ - public final void setVerbose(boolean verbose) { - _verbose = verbose; - } - - - /** - * Sets the name of the bot, which will be used as its nick when it - * tries to join an IRC server. This should be set before joining - * any servers, otherwise the default nick will be used. You would - * typically call this method from the constructor of the class that - * extends PircBot. - * <p> - * The changeNick method should be used if you wish to change your nick - * when you are connected to a server. - * - * @param name The new name of the Bot. - */ - protected final void setName(String name) { - _name = name; - } - - - /** - * Sets the internal nick of the bot. This is only to be called by the - * PircBot class in response to notification of nick changes that apply - * to us. - * - * @param nick The new nick. - */ - private final void setNick(String nick) { - _nick = nick; - } - - - /** - * Sets the internal login of the Bot. This should be set before joining - * any servers. - * - * @param login The new login of the Bot. - */ - protected final void setLogin(String login) { - _login = login; - } - - - /** - * Sets the internal version of the Bot. This should be set before joining - * any servers. - * - * @param version The new version of the Bot. - */ - protected final void setVersion(String version) { - _version = version; - } - - - /** - * Sets the interal finger message. This should be set before joining - * any servers. - * - * @param finger The new finger message for the Bot. - */ - protected final void setFinger(String finger) { - _finger = finger; - } - - - /** - * Gets the name of the PircBot. This is the name that will be used as - * as a nick when we try to join servers. - * - * @return The name of the PircBot. - */ - public final String getName() { - return _name; - } - - - /** - * Returns the current nick of the bot. Note that if you have just changed - * your nick, this method will still return the old nick until confirmation - * of the nick change is received from the server. - * <p> - * The nick returned by this method is maintained only by the PircBot - * class and is guaranteed to be correct in the context of the IRC server. - * - * @since PircBot 1.0.0 - * - * @return The current nick of the bot. - */ - public String getNick() { - return _nick; - } - - - /** - * Gets the internal login of the PircBot. - * - * @return The login of the PircBot. - */ - public final String getLogin() { - return _login; - } - - - /** - * Gets the internal version of the PircBot. - * - * @return The version of the PircBot. - */ - public final String getVersion() { - return _version; - } - - - /** - * Gets the internal finger message of the PircBot. - * - * @return The finger message of the PircBot. - */ - public final String getFinger() { - return _finger; - } - - - /** - * Returns whether or not the PircBot is currently connected to a server. - * The result of this method should only act as a rough guide, - * as the result may not be valid by the time you act upon it. - * - * @return True if and only if the PircBot is currently connected to a server. - */ - public final synchronized boolean isConnected() { - return _inputThread != null && _inputThread.isConnected(); - } - - - /** - * Sets the number of milliseconds to delay between consecutive - * messages when there are multiple messages waiting in the - * outgoing message queue. This has a default value of 1000ms. - * It is a good idea to stick to this default value, as it will - * prevent your bot from spamming servers and facing the subsequent - * wrath! However, if you do need to change this delay value (<b>not - * recommended</b>), then this is the method to use. - * - * @param delay The number of milliseconds between each outgoing message. - * - */ - public final void setMessageDelay(long delay) { - if (delay < 0) { - throw new IllegalArgumentException("Cannot have a negative time."); - } - _messageDelay = delay; - } - - - /** - * Returns the number of milliseconds that will be used to separate - * consecutive messages to the server from the outgoing message queue. - * - * @return Number of milliseconds. - */ - public final long getMessageDelay() { - return _messageDelay; - } - - - /** - * Gets the maximum length of any line that is sent via the IRC protocol. - * The IRC RFC specifies that line lengths, including the trailing \r\n - * must not exceed 512 bytes. Hence, there is currently no option to - * change this value in PircBot. All lines greater than this length - * will be truncated before being sent to the IRC server. - * - * @return The maximum line length (currently fixed at 512) - */ - public final int getMaxLineLength() { - return InputThread.MAX_LINE_LENGTH; - } - - - /** - * Gets the number of lines currently waiting in the outgoing message Queue. - * If this returns 0, then the Queue is empty and any new message is likely - * to be sent to the IRC server immediately. - * - * @since PircBot 0.9.9 - * - * @return The number of lines in the outgoing message Queue. - */ - public final int getOutgoingQueueSize() { - return _outQueue.size(); - } - - - /** - * Returns the name of the last IRC server the PircBot tried to connect to. - * This does not imply that the connection attempt to the server was - * successful (we suggest you look at the onConnect method). - * A value of null is returned if the PircBot has never tried to connect - * to a server. - * - * @return The name of the last machine we tried to connect to. Returns - * null if no connection attempts have ever been made. - */ - public final String getServer() { - return _server; - } - - - /** - * Returns the port number of the last IRC server that the PircBot tried - * to connect to. - * This does not imply that the connection attempt to the server was - * successful (we suggest you look at the onConnect method). - * A value of -1 is returned if the PircBot has never tried to connect - * to a server. - * - * @since PircBot 0.9.9 - * - * @return The port number of the last IRC server we connected to. - * Returns -1 if no connection attempts have ever been made. - */ - public final int getPort() { - return _port; - } - - - /** - * Returns the last password that we used when connecting to an IRC server. - * This does not imply that the connection attempt to the server was - * successful (we suggest you look at the onConnect method). - * A value of null is returned if the PircBot has never tried to connect - * to a server using a password. - * - * @since PircBot 0.9.9 - * - * @return The last password that we used when connecting to an IRC server. - * Returns null if we have not previously connected using a password. - */ - public final String getPassword() { - return _password; - } - - - /** - * A convenient method that accepts an IP address represented as a - * long and returns an integer array of size 4 representing the same - * IP address. - * - * @since PircBot 0.9.4 - * - * @param address the long value representing the IP address. - * - * @return An int[] of size 4. - */ - public int[] longToIp(long address) { - int[] ip = new int[4]; - for (int i = 3; i >= 0; i--) { - ip[i] = (int) (address % 256); - address = address / 256; - } - return ip; - } - - - /** - * A convenient method that accepts an IP address represented by a byte[] - * of size 4 and returns this as a long representation of the same IP - * address. - * - * @since PircBot 0.9.4 - * - * @param address the byte[] of size 4 representing the IP address. - * - * @return a long representation of the IP address. - */ - public long ipToLong(byte[] address) { - if (address.length != 4) { - throw new IllegalArgumentException("byte array must be of length 4"); - } - long ipNum = 0; - long multiplier = 1; - for (int i = 3; i >= 0; i--) { - int byteVal = (address[i] + 256) % 256; - ipNum += byteVal*multiplier; - multiplier *= 256; - } - return ipNum; - } - - - /** - * Sets the encoding charset to be used when sending or receiving lines - * from the IRC server. If set to null, then the platform's default - * charset is used. You should only use this method if you are - * trying to send text to an IRC server in a different charset, e.g. - * "GB2312" for Chinese encoding. If a PircBot is currently connected - * to a server, then it must reconnect before this change takes effect. - * - * @since PircBot 1.0.4 - * - * @param charset The new encoding charset to be used by PircBot. - * - * @throws UnsupportedEncodingException If the named charset is not - * supported. - */ - public void setEncoding(String charset) throws UnsupportedEncodingException { - // Just try to see if the charset is supported first... - "".getBytes(charset); - - _charset = charset; - } - - - /** - * Returns the encoding used to send and receive lines from - * the IRC server, or null if not set. Use the setEncoding - * method to change the encoding charset. - * - * @since PircBot 1.0.4 - * - * @return The encoding used to send outgoing messages, or - * null if not set. - */ - public String getEncoding() { - return _charset; - } - - /** - * Returns the InetAddress used by the PircBot. - * This can be used to find the I.P. address from which the PircBot is - * connected to a server. - * - * @since PircBot 1.4.4 - * - * @return The current local InetAddress, or null if never connected. - */ - public InetAddress getInetAddress() { - return _inetAddress; - } - - - /** - * Sets the InetAddress to be used when sending DCC chat or file transfers. - * This can be very useful when you are running a bot on a machine which - * is behind a firewall and you need to tell receiving clients to connect - * to a NAT/router, which then forwards the connection. - * - * @since PircBot 1.4.4 - * - * @param dccInetAddress The new InetAddress, or null to use the default. - */ - public void setDccInetAddress(InetAddress dccInetAddress) { - _dccInetAddress = dccInetAddress; - } - - - /** - * Returns the InetAddress used when sending DCC chat or file transfers. - * If this is null, the default InetAddress will be used. - * - * @since PircBot 1.4.4 - * - * @return The current DCC InetAddress, or null if left as default. - */ - public InetAddress getDccInetAddress() { - return _dccInetAddress; - } - - - /** - * Returns the set of port numbers to be used when sending a DCC chat - * or file transfer. This is useful when you are behind a firewall and - * need to set up port forwarding. The array of port numbers is traversed - * in sequence until a free port is found to listen on. A DCC tranfer will - * fail if all ports are already in use. - * If set to null, <i>any</i> free port number will be used. - * - * @since PircBot 1.4.4 - * - * @return An array of port numbers that PircBot can use to send DCC - * transfers, or null if any port is allowed. - */ - public int[] getDccPorts() { - if (_dccPorts == null || _dccPorts.length == 0) { - return null; - } - // Clone the array to prevent external modification. - return (int[]) _dccPorts.clone(); - } - - - /** - * Sets the choice of port numbers that can be used when sending a DCC chat - * or file transfer. This is useful when you are behind a firewall and - * need to set up port forwarding. The array of port numbers is traversed - * in sequence until a free port is found to listen on. A DCC tranfer will - * fail if all ports are already in use. - * If set to null, <i>any</i> free port number will be used. - * - * @since PircBot 1.4.4 - * - * @param ports The set of port numbers that PircBot may use for DCC - * transfers, or null to let it use any free port (default). - * - */ - public void setDccPorts(int[] ports) { - if (ports == null || ports.length == 0) { - _dccPorts = null; - } - else { - // Clone the array to prevent external modification. - _dccPorts = (int[]) ports.clone(); - } - } - - - /** - * Returns true if and only if the object being compared is the exact - * same instance as this PircBot. This may be useful if you are writing - * a multiple server IRC bot that uses more than one instance of PircBot. - * - * @since PircBot 0.9.9 - * - * @return true if and only if Object o is a PircBot and equal to this. - */ - public boolean equals(Object o) { - // This probably has the same effect as Object.equals, but that may change... - if (o instanceof PircBot) { - PircBot other = (PircBot) o; - return other == this; - } - return false; - } - - - /** - * Returns the hashCode of this PircBot. This method can be called by hashed - * collection classes and is useful for managing multiple instances of - * PircBots in such collections. - * - * @since PircBot 0.9.9 - * - * @return the hash code for this instance of PircBot. - */ - public int hashCode() { - return super.hashCode(); - } - - - /** - * Returns a String representation of this object. - * You may find this useful for debugging purposes, particularly - * if you are using more than one PircBot instance to achieve - * multiple server connectivity. The format of - * this String may change between different versions of PircBot - * but is currently something of the form - * <code> - * Version{PircBot x.y.z Java IRC Bot - www.jibble.org} - * Connected{true} - * Server{irc.dal.net} - * Port{6667} - * Password{} - * </code> - * - * @since PircBot 0.9.10 - * - * @return a String representation of this object. - */ - public String toString() { - return "Version{" + _version + "}" + - " Connected{" + isConnected() + "}" + - " Server{" + _server + "}" + - " Port{" + _port + "}" + - " Password{" + _password + "}"; - } - - - /** - * Returns an array of all users in the specified channel. - * <p> - * There are some important things to note about this method:- - * <ul> - * <li>This method may not return a full list of users if you call it - * before the complete nick list has arrived from the IRC server. - * </li> - * <li>If you wish to find out which users are in a channel as soon - * as you join it, then you should override the onUserList method - * instead of calling this method, as the onUserList method is only - * called as soon as the full user list has been received. - * </li> - * <li>This method will return immediately, as it does not require any - * interaction with the IRC server. - * </li> - * <li>The bot must be in a channel to be able to know which users are - * in it. - * </li> - * </ul> - * - * @since PircBot 1.0.0 - * - * @param channel The name of the channel to list. - * - * @return An array of User objects. This array is empty if we are not - * in the channel. - * - * @see #onUserList(String,User[]) onUserList - */ - public final User[] getUsers(String channel) { - channel = channel.toLowerCase(Locale.ENGLISH); - User[] userArray = new User[0]; - synchronized (_channels) { - Hashtable users = (Hashtable) _channels.get(channel); - if (users != null) { - userArray = new User[users.size()]; - Enumeration enumeration = users.elements(); - for (int i = 0; i < userArray.length; i++) { - User user = (User) enumeration.nextElement(); - userArray[i] = user; - } - } - } - return userArray; - } - - - /** - * Returns an array of all channels that we are in. Note that if you - * call this method immediately after joining a new channel, the new - * channel may not appear in this array as it is not possible to tell - * if the join was successful until a response is received from the - * IRC server. - * - * @since PircBot 1.0.0 - * - * @return A String array containing the names of all channels that we - * are in. - */ - public final String[] getChannels() { - String[] channels = new String[0]; - synchronized (_channels) { - channels = new String[_channels.size()]; - Enumeration enumeration = _channels.keys(); - for (int i = 0; i < channels.length; i++) { - channels[i] = (String) enumeration.nextElement(); - } - } - return channels; - } - - - /** - * Disposes of all thread resources used by this PircBot. This may be - * useful when writing bots or clients that use multiple servers (and - * therefore multiple PircBot instances) or when integrating a PircBot - * with an existing program. - * <p> - * Each PircBot runs its own threads for dispatching messages from its - * outgoing message queue and receiving messages from the server. - * Calling dispose() ensures that these threads are - * stopped, thus freeing up system resources and allowing the PircBot - * object to be garbage collected if there are no other references to - * it. - * <p> - * Once a PircBot object has been disposed, it should not be used again. - * Attempting to use a PircBot that has been disposed may result in - * unpredictable behaviour. - * - * @since 1.2.2 - */ - public synchronized void dispose() { - //System.out.println("disposing..."); - _outputThread.interrupt(); - _inputThread.dispose(); - } - - - /** - * Add a user to the specified channel in our memory. - * Overwrite the existing entry if it exists. - */ - private final void addUser(String channel, User user) { - channel = channel.toLowerCase(Locale.ENGLISH); - synchronized (_channels) { - Hashtable users = (Hashtable) _channels.get(channel); - if (users == null) { - users = new Hashtable(); - _channels.put(channel, users); - } - users.put(user, user); - } - } - - - /** - * Remove a user from the specified channel in our memory. - */ - private final User removeUser(String channel, String nick) { - channel = channel.toLowerCase(Locale.ENGLISH); - User user = new User("", nick); - synchronized (_channels) { - Hashtable users = (Hashtable) _channels.get(channel); - if (users != null) { - return (User) users.remove(user); - } - } - return null; - } - - - /** - * Remove a user from all channels in our memory. - */ - private final void removeUser(String nick) { - synchronized (_channels) { - Enumeration enumeration = _channels.keys(); - while (enumeration.hasMoreElements()) { - String channel = (String) enumeration.nextElement(); - this.removeUser(channel, nick); - } - } - } - - - /** - * Rename a user if they appear in any of the channels we know about. - */ - private final void renameUser(String oldNick, String newNick) { - synchronized (_channels) { - Enumeration enumeration = _channels.keys(); - while (enumeration.hasMoreElements()) { - String channel = (String) enumeration.nextElement(); - User user = this.removeUser(channel, oldNick); - if (user != null) { - user = new User(user.getPrefix(), newNick); - this.addUser(channel, user); - } - } - } - } - - - /** - * Removes an entire channel from our memory of users. - */ - private final void removeChannel(String channel) { - channel = channel.toLowerCase(Locale.ENGLISH); - synchronized (_channels) { - _channels.remove(channel); - } - } - - - /** - * Removes all channels from our memory of users. - */ - private final void removeAllChannels() { - synchronized(_channels) { - _channels = new Hashtable(); - } - } - - - private final void updateUser(String channel, int userMode, String nick) { - channel = channel.toLowerCase(Locale.ENGLISH); - synchronized (_channels) { - Hashtable users = (Hashtable) _channels.get(channel); - User newUser = null; - if (users != null) { - Enumeration enumeration = users.elements(); - while(enumeration.hasMoreElements()) { - User userObj = (User) enumeration.nextElement(); - if (userObj.getNick().equalsIgnoreCase(nick)) { - if (userMode == OP_ADD) { - if (userObj.hasVoice()) { - newUser = new User("@+", nick); - } - else { - newUser = new User("@", nick); - } - } - else if (userMode == OP_REMOVE) { - if(userObj.hasVoice()) { - newUser = new User("+", nick); - } - else { - newUser = new User("", nick); - } - } - else if (userMode == VOICE_ADD) { - if(userObj.isOp()) { - newUser = new User("@+", nick); - } - else { - newUser = new User("+", nick); - } - } - else if (userMode == VOICE_REMOVE) { - if(userObj.isOp()) { - newUser = new User("@", nick); - } - else { - newUser = new User("", nick); - } - } - } - } - } - if (newUser != null) { - users.put(newUser, newUser); - } - else { - // just in case ... - newUser = new User("", nick); - users.put(newUser, newUser); - } - } - } - - - // Connection stuff. - private InputThread _inputThread = null; - private OutputThread _outputThread = null; - private String _charset = null; - private InetAddress _inetAddress = null; - - // Details about the last server that we connected to. - private String _server = null; - private int _port = -1; - private String _password = null; - - // Outgoing message stuff. - private Queue _outQueue = new Queue(); - private long _messageDelay = 1000; - - // A Hashtable of channels that points to a selfreferential Hashtable of - // User objects (used to remember which users are in which channels). - private Hashtable _channels = new Hashtable(); - - // A Hashtable to temporarily store channel topics when we join them - // until we find out who set that topic. - private Hashtable _topics = new Hashtable(); - - private int[] _dccPorts = null; - private InetAddress _dccInetAddress = null; - - // Default settings for the PircBot. - private boolean _autoNickChange = false; - private boolean _verbose = false; - private String _name = "PircBot"; - private String _nick = _name; - private String _login = "PircBot"; - private String _version = "PircBot " + VERSION + " Java IRC Bot - www.jibble.org"; - private String _finger = "You ought to be arrested for fingering a bot!"; - - private String _channelPrefixes = "#&+!"; -} diff --git a/EssentialsUpdate/src/org/jibble/pircbot/Queue.java b/EssentialsUpdate/src/org/jibble/pircbot/Queue.java deleted file mode 100755 index fd8d47781..000000000 --- a/EssentialsUpdate/src/org/jibble/pircbot/Queue.java +++ /dev/null @@ -1,146 +0,0 @@ -/* -Copyright Paul James Mutton, 2001-2009, http://www.jibble.org/ - -This file is part of PircBot. - -This software is dual-licensed, allowing you to choose between the GNU -General Public License (GPL) and the www.jibble.org Commercial License. -Since the GPL may be too restrictive for use in a proprietary application, -a commercial license is also provided. Full license information can be -found at http://www.jibble.org/licenses/ - -*/ - - -package org.jibble.pircbot; - -import java.util.Vector; - -/** - * Queue is a definition of a data structure that may - * act as a queue - that is, data can be added to one end of the - * queue and data can be requested from the head end of the queue. - * This class is thread safe for multiple producers and a single - * consumer. The next() method will block until there is data in - * the queue. - * - * This has now been modified so that it is compatible with - * the earlier JDK1.1 in order to be suitable for running on - * mobile appliances. This means replacing the LinkedList with - * a Vector, which is hardly ideal, but this Queue is typically - * only polled every second before dispatching messages. - * - * @author Paul James Mutton, - * <a href="http://www.jibble.org/">http://www.jibble.org/</a> - * @version 1.5.0 (Build time: Mon Dec 14 20:07:17 2009) - */ -public class Queue { - - - /** - * Constructs a Queue object of unlimited size. - */ - public Queue() { - - } - - - /** - * Adds an Object to the end of the Queue. - * - * @param o The Object to be added to the Queue. - */ - public void add(Object o) { - synchronized(_queue) { - _queue.addElement(o); - _queue.notify(); - } - } - - - /** - * Adds an Object to the front of the Queue. - * - * @param o The Object to be added to the Queue. - */ - public void addFront(Object o) { - synchronized(_queue) { - _queue.insertElementAt(o, 0); - _queue.notify(); - } - } - - - /** - * Returns the Object at the front of the Queue. This - * Object is then removed from the Queue. If the Queue - * is empty, then this method shall block until there - * is an Object in the Queue to return. - * - * @return The next item from the front of the queue. - */ - public Object next() { - - Object o = null; - - // Block if the Queue is empty. - synchronized(_queue) { - if (_queue.size() == 0) { - try { - _queue.wait(); - } - catch (InterruptedException e) { - return null; - } - } - - // Return the Object. - try { - o = _queue.firstElement(); - _queue.removeElementAt(0); - } - catch (ArrayIndexOutOfBoundsException e) { - throw new InternalError("Race hazard in Queue object."); - } - } - - return o; - } - - - /** - * Returns true if the Queue is not empty. If another - * Thread empties the Queue before <b>next()</b> is - * called, then the call to <b>next()</b> shall block - * until the Queue has been populated again. - * - * @return True only if the Queue not empty. - */ - public boolean hasNext() { - return (this.size() != 0); - } - - - /** - * Clears the contents of the Queue. - */ - public void clear() { - synchronized(_queue) { - _queue.removeAllElements(); - } - } - - - /** - * Returns the size of the Queue. - * - * @return The current size of the queue. - */ - public int size() { - return _queue.size(); - } - - - private Vector _queue = new Vector(); - -} diff --git a/EssentialsUpdate/src/org/jibble/pircbot/ReplyConstants.java b/EssentialsUpdate/src/org/jibble/pircbot/ReplyConstants.java deleted file mode 100755 index 2d8e696d5..000000000 --- a/EssentialsUpdate/src/org/jibble/pircbot/ReplyConstants.java +++ /dev/null @@ -1,176 +0,0 @@ -/* -Copyright Paul James Mutton, 2001-2009, http://www.jibble.org/ - -This file is part of PircBot. - -This software is dual-licensed, allowing you to choose between the GNU -General Public License (GPL) and the www.jibble.org Commercial License. -Since the GPL may be too restrictive for use in a proprietary application, -a commercial license is also provided. Full license information can be -found at http://www.jibble.org/licenses/ - -*/ - - -package org.jibble.pircbot; - -/** - * This interface contains the values of all numeric replies specified - * in section 6 of RFC 1459. Refer to RFC 1459 for further information. - * <p> - * If you override the onServerResponse method in the PircBot class, - * you may find these constants useful when comparing the numeric - * value of a given code. - * - * @since 1.0.0 - * @author Paul James Mutton, - * <a href="http://www.jibble.org/">http://www.jibble.org/</a> - * @version 1.5.0 (Build time: Mon Dec 14 20:07:17 2009) - */ -public interface ReplyConstants { - - - // Error Replies. - public static final int ERR_NOSUCHNICK = 401; - public static final int ERR_NOSUCHSERVER = 402; - public static final int ERR_NOSUCHCHANNEL = 403; - public static final int ERR_CANNOTSENDTOCHAN = 404; - public static final int ERR_TOOMANYCHANNELS = 405; - public static final int ERR_WASNOSUCHNICK = 406; - public static final int ERR_TOOMANYTARGETS = 407; - public static final int ERR_NOORIGIN = 409; - public static final int ERR_NORECIPIENT = 411; - public static final int ERR_NOTEXTTOSEND = 412; - public static final int ERR_NOTOPLEVEL = 413; - public static final int ERR_WILDTOPLEVEL = 414; - public static final int ERR_UNKNOWNCOMMAND = 421; - public static final int ERR_NOMOTD = 422; - public static final int ERR_NOADMININFO = 423; - public static final int ERR_FILEERROR = 424; - public static final int ERR_NONICKNAMEGIVEN = 431; - public static final int ERR_ERRONEUSNICKNAME = 432; - public static final int ERR_NICKNAMEINUSE = 433; - public static final int ERR_NICKCOLLISION = 436; - public static final int ERR_USERNOTINCHANNEL = 441; - public static final int ERR_NOTONCHANNEL = 442; - public static final int ERR_USERONCHANNEL = 443; - public static final int ERR_NOLOGIN = 444; - public static final int ERR_SUMMONDISABLED = 445; - public static final int ERR_USERSDISABLED = 446; - public static final int ERR_NOTREGISTERED = 451; - public static final int ERR_NEEDMOREPARAMS = 461; - public static final int ERR_ALREADYREGISTRED = 462; - public static final int ERR_NOPERMFORHOST = 463; - public static final int ERR_PASSWDMISMATCH = 464; - public static final int ERR_YOUREBANNEDCREEP = 465; - public static final int ERR_KEYSET = 467; - public static final int ERR_CHANNELISFULL = 471; - public static final int ERR_UNKNOWNMODE = 472; - public static final int ERR_INVITEONLYCHAN = 473; - public static final int ERR_BANNEDFROMCHAN = 474; - public static final int ERR_BADCHANNELKEY = 475; - public static final int ERR_NOPRIVILEGES = 481; - public static final int ERR_CHANOPRIVSNEEDED = 482; - public static final int ERR_CANTKILLSERVER = 483; - public static final int ERR_NOOPERHOST = 491; - public static final int ERR_UMODEUNKNOWNFLAG = 501; - public static final int ERR_USERSDONTMATCH = 502; - - - // Command Responses. - public static final int RPL_TRACELINK = 200; - public static final int RPL_TRACECONNECTING = 201; - public static final int RPL_TRACEHANDSHAKE = 202; - public static final int RPL_TRACEUNKNOWN = 203; - public static final int RPL_TRACEOPERATOR = 204; - public static final int RPL_TRACEUSER = 205; - public static final int RPL_TRACESERVER = 206; - public static final int RPL_TRACENEWTYPE = 208; - public static final int RPL_STATSLINKINFO = 211; - public static final int RPL_STATSCOMMANDS = 212; - public static final int RPL_STATSCLINE = 213; - public static final int RPL_STATSNLINE = 214; - public static final int RPL_STATSILINE = 215; - public static final int RPL_STATSKLINE = 216; - public static final int RPL_STATSYLINE = 218; - public static final int RPL_ENDOFSTATS = 219; - public static final int RPL_UMODEIS = 221; - public static final int RPL_STATSLLINE = 241; - public static final int RPL_STATSUPTIME = 242; - public static final int RPL_STATSOLINE = 243; - public static final int RPL_STATSHLINE = 244; - public static final int RPL_LUSERCLIENT = 251; - public static final int RPL_LUSEROP = 252; - public static final int RPL_LUSERUNKNOWN = 253; - public static final int RPL_LUSERCHANNELS = 254; - public static final int RPL_LUSERME = 255; - public static final int RPL_ADMINME = 256; - public static final int RPL_ADMINLOC1 = 257; - public static final int RPL_ADMINLOC2 = 258; - public static final int RPL_ADMINEMAIL = 259; - public static final int RPL_TRACELOG = 261; - public static final int RPL_NONE = 300; - public static final int RPL_AWAY = 301; - public static final int RPL_USERHOST = 302; - public static final int RPL_ISON = 303; - public static final int RPL_UNAWAY = 305; - public static final int RPL_NOWAWAY = 306; - public static final int RPL_WHOISUSER = 311; - public static final int RPL_WHOISSERVER = 312; - public static final int RPL_WHOISOPERATOR = 313; - public static final int RPL_WHOWASUSER = 314; - public static final int RPL_ENDOFWHO = 315; - public static final int RPL_WHOISIDLE = 317; - public static final int RPL_ENDOFWHOIS = 318; - public static final int RPL_WHOISCHANNELS = 319; - public static final int RPL_LISTSTART = 321; - public static final int RPL_LIST = 322; - public static final int RPL_LISTEND = 323; - public static final int RPL_CHANNELMODEIS = 324; - public static final int RPL_NOTOPIC = 331; - public static final int RPL_TOPIC = 332; - public static final int RPL_TOPICINFO = 333; - public static final int RPL_INVITING = 341; - public static final int RPL_SUMMONING = 342; - public static final int RPL_VERSION = 351; - public static final int RPL_WHOREPLY = 352; - public static final int RPL_NAMREPLY = 353; - public static final int RPL_LINKS = 364; - public static final int RPL_ENDOFLINKS = 365; - public static final int RPL_ENDOFNAMES = 366; - public static final int RPL_BANLIST = 367; - public static final int RPL_ENDOFBANLIST = 368; - public static final int RPL_ENDOFWHOWAS = 369; - public static final int RPL_INFO = 371; - public static final int RPL_MOTD = 372; - public static final int RPL_ENDOFINFO = 374; - public static final int RPL_MOTDSTART = 375; - public static final int RPL_ENDOFMOTD = 376; - public static final int RPL_YOUREOPER = 381; - public static final int RPL_REHASHING = 382; - public static final int RPL_TIME = 391; - public static final int RPL_USERSSTART = 392; - public static final int RPL_USERS = 393; - public static final int RPL_ENDOFUSERS = 394; - public static final int RPL_NOUSERS = 395; - - - // Reserved Numerics. - public static final int RPL_TRACECLASS = 209; - public static final int RPL_STATSQLINE = 217; - public static final int RPL_SERVICEINFO = 231; - public static final int RPL_ENDOFSERVICES = 232; - public static final int RPL_SERVICE = 233; - public static final int RPL_SERVLIST = 234; - public static final int RPL_SERVLISTEND = 235; - public static final int RPL_WHOISCHANOP = 316; - public static final int RPL_KILLDONE = 361; - public static final int RPL_CLOSING = 362; - public static final int RPL_CLOSEEND = 363; - public static final int RPL_INFOSTART = 373; - public static final int RPL_MYPORTIS = 384; - public static final int ERR_YOUWILLBEBANNED = 466; - public static final int ERR_BADCHANMASK = 476; - public static final int ERR_NOSERVICEHOST = 492; - -} diff --git a/EssentialsUpdate/src/org/jibble/pircbot/User.java b/EssentialsUpdate/src/org/jibble/pircbot/User.java deleted file mode 100755 index 37f981b19..000000000 --- a/EssentialsUpdate/src/org/jibble/pircbot/User.java +++ /dev/null @@ -1,163 +0,0 @@ -/* -Copyright Paul James Mutton, 2001-2009, http://www.jibble.org/ - -This file is part of PircBot. - -This software is dual-licensed, allowing you to choose between the GNU -General Public License (GPL) and the www.jibble.org Commercial License. -Since the GPL may be too restrictive for use in a proprietary application, -a commercial license is also provided. Full license information can be -found at http://www.jibble.org/licenses/ - -*/ - -package org.jibble.pircbot; - -import java.util.Locale; - -/** - * This class is used to represent a user on an IRC server. - * Instances of this class are returned by the getUsers method - * in the PircBot class. - * <p> - * Note that this class no longer implements the Comparable interface - * for Java 1.1 compatibility reasons. - * - * @since 1.0.0 - * @author Paul James Mutton, - * <a href="http://www.jibble.org/">http://www.jibble.org/</a> - * @version 1.5.0 (Build time: Mon Dec 14 20:07:17 2009) - */ -public class User { - - - /** - * Constructs a User object with a known prefix and nick. - * - * @param prefix The status of the user, for example, "@". - * @param nick The nick of the user. - */ - User(String prefix, String nick) { - _prefix = prefix; - _nick = nick; - _lowerNick = nick.toLowerCase(Locale.ENGLISH); - } - - - /** - * Returns the prefix of the user. If the User object has been obtained - * from a list of users in a channel, then this will reflect the user's - * status in that channel. - * - * @return The prefix of the user. If there is no prefix, then an empty - * String is returned. - */ - public String getPrefix() { - return _prefix; - } - - - /** - * Returns whether or not the user represented by this object is an - * operator. If the User object has been obtained from a list of users - * in a channel, then this will reflect the user's operator status in - * that channel. - * - * @return true if the user is an operator in the channel. - */ - public boolean isOp() { - return _prefix.indexOf('@') >= 0; - } - - - /** - * Returns whether or not the user represented by this object has - * voice. If the User object has been obtained from a list of users - * in a channel, then this will reflect the user's voice status in - * that channel. - * - * @return true if the user has voice in the channel. - */ - public boolean hasVoice() { - return _prefix.indexOf('+') >= 0; - } - - - /** - * Returns the nick of the user. - * - * @return The user's nick. - */ - public String getNick() { - return _nick; - } - - - /** - * Returns the nick of the user complete with their prefix if they - * have one, e.g. "@Dave". - * - * @return The user's prefix and nick. - */ - public String toString() { - return this.getPrefix() + this.getNick(); - } - - - /** - * Returns true if the nick represented by this User object is the same - * as the argument. A case insensitive comparison is made. - * - * @return true if the nicks are identical (case insensitive). - */ - public boolean equals(String nick) { - return nick.toLowerCase(Locale.ENGLISH).equals(_lowerNick); - } - - - /** - * Returns true if the nick represented by this User object is the same - * as the nick of the User object given as an argument. - * A case insensitive comparison is made. - * - * @return true if o is a User object with a matching lowercase nick. - */ - public boolean equals(Object o) { - if (o instanceof User) { - User other = (User) o; - return other._lowerNick.equals(_lowerNick); - } - return false; - } - - - /** - * Returns the hash code of this User object. - * - * @return the hash code of the User object. - */ - public int hashCode() { - return _lowerNick.hashCode(); - } - - - /** - * Returns the result of calling the compareTo method on lowercased - * nicks. This is useful for sorting lists of User objects. - * - * @return the result of calling compareTo on lowercased nicks. - */ - public int compareTo(Object o) { - if (o instanceof User) { - User other = (User) o; - return other._lowerNick.compareTo(_lowerNick); - } - return -1; - } - - - private String _prefix; - private String _nick; - private String _lowerNick; - -} diff --git a/EssentialsXMPP/pom.xml b/EssentialsXMPP/pom.xml index dc75b7470..abcddfade 100644 --- a/EssentialsXMPP/pom.xml +++ b/EssentialsXMPP/pom.xml @@ -1,49 +1,49 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> + <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>net.essentials3</groupId> - <artifactId>BuildAll</artifactId> - <version>3.0-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> + <parent> + <groupId>net.essentials3</groupId> + <artifactId>BuildAll</artifactId> + <version>3.0-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> - <artifactId>EssentialsXMPP</artifactId> - <dependencies> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>Essentials</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>jivesoftware</groupId> - <artifactId>smack</artifactId> - <version>3.1.0</version> - </dependency> - </dependencies> + <artifactId>EssentialsXMPP</artifactId> + <dependencies> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>Essentials</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>jivesoftware</groupId> + <artifactId>smack</artifactId> + <version>3.1.0</version> + </dependency> + </dependencies> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-shade-plugin</artifactId> - <version>1.7</version> - <executions> - <execution> - <goals> - <goal>shade</goal> - </goals> - <configuration> - <artifactSet> - <includes> - <include>jivesoftware:smack</include> - </includes> - </artifactSet> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-shade-plugin</artifactId> + <version>2.0</version> + <executions> + <execution> + <goals> + <goal>shade</goal> + </goals> + <configuration> + <artifactSet> + <includes> + <include>jivesoftware:smack</include> + </includes> + </artifactSet> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> </project> diff --git a/WebPush/nbproject/project.xml b/WebPush/nbproject/project.xml index da4214310..6b1a15227 100644 --- a/WebPush/nbproject/project.xml +++ b/WebPush/nbproject/project.xml @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://www.netbeans.org/ns/project/1"> - <type>org.netbeans.modules.php.project</type> - <configuration> - <data xmlns="http://www.netbeans.org/ns/php-project/1"> - <name>Push</name> - </data> - </configuration> + <type>org.netbeans.modules.php.project</type> + <configuration> + <data xmlns="http://www.netbeans.org/ns/php-project/1"> + <name>Push</name> + </data> + </configuration> </project> diff --git a/packager.xml b/packager.xml index f7c3d0704..067d44173 100644 --- a/packager.xml +++ b/packager.xml @@ -1,14 +1,14 @@ <?xml version="1.0" encoding="UTF-8"?> <project default="collect"> - <target name="collect"> - <mkdir dir="jars"/> - <copy todir="jars"> - <fileset dir="."> - <include name="**/Essentials/src/config.yml"/> - <include name="**/target/classes/messages*.properties"/> - <include name="**/target/classes/items.csv"/> - </fileset> - <flattenmapper/> - </copy> - </target> + <target name="collect"> + <mkdir dir="jars"/> + <copy todir="jars"> + <fileset dir="."> + <include name="**/Essentials/src/config.yml"/> + <include name="**/target/classes/messages*.properties"/> + <include name="**/target/classes/items.csv"/> + </fileset> + <flattenmapper/> + </copy> + </target> </project> @@ -1,147 +1,147 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> + <modelVersion>4.0.0</modelVersion> - <groupId>net.essentials3</groupId> - <artifactId>BuildAll</artifactId> - <version>3.0-SNAPSHOT</version> - <packaging>pom</packaging> - <name>BuildAll</name> - <url>http://tiny.cc/EssentialsWiki</url> + <groupId>net.essentials3</groupId> + <artifactId>BuildAll</artifactId> + <version>3.0-SNAPSHOT</version> + <packaging>pom</packaging> + <name>BuildAll</name> + <url>http://tiny.cc/EssentialsWiki</url> - <modules> - <module>Essentials</module> - <module>Essentials2Compat</module> - <module>EssentialsChat</module> - <module>EssentialsExtra</module> - <module>EssentialsGeoIP</module> - <module>EssentialsGroupBridge</module> - <module>EssentialsGroupManager</module> - <module>EssentialsProtect</module> - <module>EssentialsSigns</module> - <module>EssentialsUpdate</module> - <module>EssentialsXMPP</module> - <module>EssentialsAntiBuild</module> - </modules> + <modules> + <module>Essentials</module> + <module>Essentials2Compat</module> + <module>EssentialsChat</module> + <module>EssentialsExtra</module> + <module>EssentialsGeoIP</module> + <module>EssentialsGroupBridge</module> + <module>EssentialsGroupManager</module> + <module>EssentialsProtect</module> + <module>EssentialsSigns</module> + <module>EssentialsUpdate</module> + <module>EssentialsXMPP</module> + <module>EssentialsAntiBuild</module> + </modules> - <repositories> - <repository> - <id>essentials-repo</id> - <url>http://ess.ementalo.com/nexus/content/groups/public/</url> - </repository> - </repositories> + <repositories> + <repository> + <id>essentials-repo</id> + <url>http://ess.ementalo.com/nexus/content/groups/public/</url> + </repository> + </repositories> - <dependencies> - <dependency> - <groupId>org.bukkit</groupId> - <artifactId>bukkit</artifactId> - <version>${bukkit.version}</version> - </dependency> - </dependencies> + <dependencies> + <dependency> + <groupId>org.bukkit</groupId> + <artifactId>bukkit</artifactId> + <version>${bukkit.version}</version> + </dependency> + </dependencies> - <build> - <finalName>${project.name}</finalName> - <sourceDirectory>${project.basedir}/src</sourceDirectory> - <testSourceDirectory>${project.basedir}/test</testSourceDirectory> - <resources> - <resource> - <directory>${project.basedir}/src</directory> - <filtering>true</filtering> - <includes> - <include>*.*</include> - </includes> - </resource> - </resources> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - <version>2.4</version> - <configuration> - <outputDirectory>../jars</outputDirectory> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>2.3.2</version> - <configuration> - <source>1.6</source> - <target>1.6</target> - </configuration> - </plugin> - </plugins> - </build> + <build> + <finalName>${project.name}</finalName> + <sourceDirectory>${project.basedir}/src</sourceDirectory> + <testSourceDirectory>${project.basedir}/test</testSourceDirectory> + <resources> + <resource> + <directory>${project.basedir}/src</directory> + <filtering>true</filtering> + <includes> + <include>*.*</include> + </includes> + </resource> + </resources> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>2.4</version> + <configuration> + <outputDirectory>../jars</outputDirectory> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>2.3.2</version> + <configuration> + <source>1.6</source> + <target>1.6</target> + </configuration> + </plugin> + </plugins> + </build> - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <bukkit.version>1.4.6-R0.3</bukkit.version> - <build.number>Unknown</build.number> - <org-netbeans-modules-editor-indent.CodeStyle.project.expand-tabs>true</org-netbeans-modules-editor-indent.CodeStyle.project.expand-tabs> - <org-netbeans-modules-editor-indent.CodeStyle.project.indent-shift-width>2</org-netbeans-modules-editor-indent.CodeStyle.project.indent-shift-width> - <org-netbeans-modules-editor-indent.CodeStyle.project.spaces-per-tab>2</org-netbeans-modules-editor-indent.CodeStyle.project.spaces-per-tab> - <org-netbeans-modules-editor-indent.CodeStyle.project.tab-size>2</org-netbeans-modules-editor-indent.CodeStyle.project.tab-size> - <org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width>120</org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width> - <org-netbeans-modules-editor-indent.CodeStyle.project.text-line-wrap>none</org-netbeans-modules-editor-indent.CodeStyle.project.text-line-wrap> - <org-netbeans-modules-editor-indent.CodeStyle.usedProfile>project</org-netbeans-modules-editor-indent.CodeStyle.usedProfile> - <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineAnnotationArgs>true - </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineAnnotationArgs> - <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineArrayInit>true - </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineArrayInit> - <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineAssignment>true - </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineAssignment> - <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineBinaryOp>true - </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineBinaryOp> - <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineCallArgs>true - </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineCallArgs> - <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineDisjunctiveCatchTypes>true - </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineDisjunctiveCatchTypes> - <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineFor>true - </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineFor> - <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineImplements>true - </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineImplements> - <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineMethodParams>true - </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineMethodParams> - <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineParenthesized>true - </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineParenthesized> - <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineTernaryOp>true - </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineTernaryOp> - <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineThrows>true - </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineThrows> - <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineTryResources>true - </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineTryResources> - <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesAfterClassHeader>0 - </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesAfterClassHeader> - <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesBeforeClass>2 - </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesBeforeClass> - <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement>NEW_LINE - </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement> - <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.expand-tabs>false - </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.expand-tabs> - <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.importGroupsOrder>* - </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.importGroupsOrder> - <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indent-shift-width>4 - </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indent-shift-width> - <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indentCasesFromSwitch>false - </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indentCasesFromSwitch> - <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement>NEW_LINE - </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement> - <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.otherBracePlacement>NEW_LINE - </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.otherBracePlacement> - <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeCatchOnNewLine>true - </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeCatchOnNewLine> - <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeElseOnNewLine>true - </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeElseOnNewLine> - <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeFinallyOnNewLine>true - </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeFinallyOnNewLine> - <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeWhileOnNewLine>true - </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeWhileOnNewLine> - <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.separateImportGroups>false - </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.separateImportGroups> - <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceAfterTypeCast>false - </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceAfterTypeCast> - <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaces-per-tab>4 - </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaces-per-tab> - <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.tab-size>4</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.tab-size> - </properties> + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <bukkit.version>1.4.6-R0.3</bukkit.version> + <build.number>Unknown</build.number> + <org-netbeans-modules-editor-indent.CodeStyle.project.expand-tabs>true</org-netbeans-modules-editor-indent.CodeStyle.project.expand-tabs> + <org-netbeans-modules-editor-indent.CodeStyle.project.indent-shift-width>2</org-netbeans-modules-editor-indent.CodeStyle.project.indent-shift-width> + <org-netbeans-modules-editor-indent.CodeStyle.project.spaces-per-tab>2</org-netbeans-modules-editor-indent.CodeStyle.project.spaces-per-tab> + <org-netbeans-modules-editor-indent.CodeStyle.project.tab-size>2</org-netbeans-modules-editor-indent.CodeStyle.project.tab-size> + <org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width>120</org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width> + <org-netbeans-modules-editor-indent.CodeStyle.project.text-line-wrap>none</org-netbeans-modules-editor-indent.CodeStyle.project.text-line-wrap> + <org-netbeans-modules-editor-indent.CodeStyle.usedProfile>project</org-netbeans-modules-editor-indent.CodeStyle.usedProfile> + <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineAnnotationArgs>true + </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineAnnotationArgs> + <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineArrayInit>true + </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineArrayInit> + <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineAssignment>true + </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineAssignment> + <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineBinaryOp>true + </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineBinaryOp> + <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineCallArgs>true + </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineCallArgs> + <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineDisjunctiveCatchTypes>true + </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineDisjunctiveCatchTypes> + <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineFor>true + </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineFor> + <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineImplements>true + </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineImplements> + <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineMethodParams>true + </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineMethodParams> + <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineParenthesized>true + </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineParenthesized> + <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineTernaryOp>true + </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineTernaryOp> + <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineThrows>true + </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineThrows> + <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineTryResources>true + </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineTryResources> + <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesAfterClassHeader>0 + </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesAfterClassHeader> + <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesBeforeClass>2 + </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesBeforeClass> + <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement>NEW_LINE + </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement> + <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.expand-tabs>false + </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.expand-tabs> + <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.importGroupsOrder>* + </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.importGroupsOrder> + <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indent-shift-width>4 + </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indent-shift-width> + <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indentCasesFromSwitch>false + </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indentCasesFromSwitch> + <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement>NEW_LINE + </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement> + <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.otherBracePlacement>NEW_LINE + </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.otherBracePlacement> + <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeCatchOnNewLine>true + </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeCatchOnNewLine> + <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeElseOnNewLine>true + </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeElseOnNewLine> + <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeFinallyOnNewLine>true + </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeFinallyOnNewLine> + <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeWhileOnNewLine>true + </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeWhileOnNewLine> + <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.separateImportGroups>false + </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.separateImportGroups> + <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceAfterTypeCast>false + </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceAfterTypeCast> + <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaces-per-tab>4 + </org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaces-per-tab> + <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.tab-size>4</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.tab-size> + </properties> </project> |