summaryrefslogtreecommitdiffstats
path: root/EssentialsGeoIP
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2011-11-21 02:55:26 +0100
committersnowleo <schneeleo@gmail.com>2011-11-21 02:55:26 +0100
commit220d68f375bd117587c91f9478434eee517a33d7 (patch)
tree6344f983d195a4c8d091afffc9d2f8bdbca929bb /EssentialsGeoIP
parent19f5a2340d9fdb3902f5c388f463fd569943db07 (diff)
downloadEssentials-220d68f375bd117587c91f9478434eee517a33d7.tar
Essentials-220d68f375bd117587c91f9478434eee517a33d7.tar.gz
Essentials-220d68f375bd117587c91f9478434eee517a33d7.tar.lz
Essentials-220d68f375bd117587c91f9478434eee517a33d7.tar.xz
Essentials-220d68f375bd117587c91f9478434eee517a33d7.zip
Switch to the new I18n class and format cleanup of all classes
Diffstat (limited to 'EssentialsGeoIP')
-rw-r--r--EssentialsGeoIP/nbproject/project.properties2
-rw-r--r--EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java11
-rw-r--r--EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java25
-rw-r--r--EssentialsGeoIP/src/com/maxmind/geoip/DatabaseInfo.java4
-rw-r--r--EssentialsGeoIP/src/com/maxmind/geoip/LookupService.java4
5 files changed, 23 insertions, 23 deletions
diff --git a/EssentialsGeoIP/nbproject/project.properties b/EssentialsGeoIP/nbproject/project.properties
index cee848726..1b6ef450d 100644
--- a/EssentialsGeoIP/nbproject/project.properties
+++ b/EssentialsGeoIP/nbproject/project.properties
@@ -28,6 +28,7 @@ auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blank
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesBeforeClass=2
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement=NEW_LINE
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.expand-tabs=false
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.importGroupsOrder=*
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indent-shift-width=4
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indentCasesFromSwitch=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement=NEW_LINE
@@ -36,6 +37,7 @@ auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.place
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeElseOnNewLine=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeFinallyOnNewLine=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeWhileOnNewLine=true
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.separateImportGroups=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceAfterTypeCast=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaces-per-tab=4
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.tab-size=4
diff --git a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java
index 5a4049a62..6bc0c2022 100644
--- a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java
+++ b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java
@@ -1,7 +1,7 @@
package com.earth2me.essentials.geoip;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.IEssentials;
-import com.earth2me.essentials.Util;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.event.Event.Priority;
@@ -31,11 +31,12 @@ public class EssentialsGeoIP extends JavaPlugin
final EssentialsGeoIPPlayerListener playerListener = new EssentialsGeoIPPlayerListener(getDataFolder(), ess);
pm.registerEvent(Type.PLAYER_JOIN, playerListener, Priority.Monitor, this);
- if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion())) {
- logger.log(Level.WARNING, Util.i18n("versionMismatchAll"));
+ if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion()))
+ {
+ logger.log(Level.WARNING, _("versionMismatchAll"));
}
- logger.info(Util.format("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), "essentials team"));
-
+ logger.info(_("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), "essentials team"));
+
logger.log(Level.INFO, "This product includes GeoLite data created by MaxMind, available from http://www.maxmind.com/.");
}
}
diff --git a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java
index 8926f77e8..ee187c2aa 100644
--- a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java
+++ b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java
@@ -1,18 +1,14 @@
package com.earth2me.essentials.geoip;
import com.earth2me.essentials.EssentialsConf;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.IConf;
import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
import com.maxmind.geoip.Location;
import com.maxmind.geoip.LookupService;
import com.maxmind.geoip.regionName;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
+import java.io.*;
import java.net.InetAddress;
import java.net.MalformedURLException;
import java.net.URL;
@@ -84,8 +80,9 @@ public class EssentialsGeoIPPlayerListener extends PlayerListener implements ICo
for (Player player : event.getPlayer().getServer().getOnlinePlayers())
{
User user = ess.getUser(player);
- if (user.isAuthorized("essentials.geoip.show")) {
- user.sendMessage(Util.format("geoipJoinFormat", u.getDisplayName(), sb.toString()));
+ if (user.isAuthorized("essentials.geoip.show"))
+ {
+ user.sendMessage(_("geoipJoinFormat", u.getDisplayName(), sb.toString()));
}
}
}
@@ -112,7 +109,7 @@ public class EssentialsGeoIPPlayerListener extends PlayerListener implements ICo
}
else
{
- logger.log(Level.SEVERE, Util.i18n("cantFindGeoIpDB"));
+ logger.log(Level.SEVERE, _("cantFindGeoIpDB"));
return;
}
}
@@ -122,7 +119,7 @@ public class EssentialsGeoIPPlayerListener extends PlayerListener implements ICo
}
catch (IOException ex)
{
- logger.log(Level.SEVERE, Util.i18n("cantReadGeoIpDB"), ex);
+ logger.log(Level.SEVERE, _("cantReadGeoIpDB"), ex);
}
}
@@ -141,10 +138,10 @@ public class EssentialsGeoIPPlayerListener extends PlayerListener implements ICo
}
if (url == null || url.isEmpty())
{
- logger.log(Level.SEVERE, Util.i18n("geoIpUrlEmpty"));
+ logger.log(Level.SEVERE, _("geoIpUrlEmpty"));
return;
}
- logger.log(Level.INFO, Util.i18n("downloadingGeoIp"));
+ logger.log(Level.INFO, _("downloadingGeoIp"));
URL downloadUrl = new URL(url);
URLConnection conn = downloadUrl.openConnection();
conn.setConnectTimeout(10000);
@@ -167,12 +164,12 @@ public class EssentialsGeoIPPlayerListener extends PlayerListener implements ICo
}
catch (MalformedURLException ex)
{
- logger.log(Level.SEVERE, Util.i18n("geoIpUrlInvalid"), ex);
+ logger.log(Level.SEVERE, _("geoIpUrlInvalid"), ex);
return;
}
catch (IOException ex)
{
- logger.log(Level.SEVERE, Util.i18n("connectionFailed"), ex);
+ logger.log(Level.SEVERE, _("connectionFailed"), ex);
}
}
}
diff --git a/EssentialsGeoIP/src/com/maxmind/geoip/DatabaseInfo.java b/EssentialsGeoIP/src/com/maxmind/geoip/DatabaseInfo.java
index dfed516a5..939259ebb 100644
--- a/EssentialsGeoIP/src/com/maxmind/geoip/DatabaseInfo.java
+++ b/EssentialsGeoIP/src/com/maxmind/geoip/DatabaseInfo.java
@@ -20,9 +20,9 @@
package com.maxmind.geoip;
-import java.util.Date;
-import java.text.SimpleDateFormat;
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
diff --git a/EssentialsGeoIP/src/com/maxmind/geoip/LookupService.java b/EssentialsGeoIP/src/com/maxmind/geoip/LookupService.java
index 406cda004..19da6c8f5 100644
--- a/EssentialsGeoIP/src/com/maxmind/geoip/LookupService.java
+++ b/EssentialsGeoIP/src/com/maxmind/geoip/LookupService.java
@@ -20,16 +20,16 @@
package com.maxmind.geoip;
+
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
-import java.net.InetAddress;
import java.net.Inet6Address;
+import java.net.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;