forked from I2P_Developers/i2p.i2p
Use new split()
This commit is contained in:
@ -211,7 +211,7 @@ public class WorkingDir {
|
||||
String[] files = dir.list();
|
||||
if (files == null)
|
||||
return false;
|
||||
String migrated[] = MIGRATE_BASE.split(",");
|
||||
String migrated[] = DataHelper.split(MIGRATE_BASE, ",");
|
||||
for (String file: files) {
|
||||
for (int i = 0; i < migrated.length; i++) {
|
||||
if (file.equals(migrated[i]))
|
||||
@ -282,7 +282,7 @@ public class WorkingDir {
|
||||
|
||||
private static boolean migrate(String list, File olddir, File todir) {
|
||||
boolean rv = true;
|
||||
String files[] = list.split(",");
|
||||
String files[] = DataHelper.split(list, ",");
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
File from = new File(olddir, files[i]);
|
||||
if (!copy(from, todir)) {
|
||||
|
@ -10,6 +10,7 @@ import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.router.transport.GeoIP;
|
||||
|
||||
/**
|
||||
@ -105,7 +106,7 @@ class Zones {
|
||||
try {
|
||||
if (line.charAt(0) == '#')
|
||||
continue;
|
||||
String[] s = line.split(",");
|
||||
String[] s = DataHelper.split(line, ",");
|
||||
String ucContinent = s[1].toUpperCase(Locale.US).trim();
|
||||
String zone = _continentToZone.get(ucContinent);
|
||||
if (zone == null)
|
||||
|
@ -17,6 +17,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.data.Hash;
|
||||
import net.i2p.router.Router;
|
||||
import net.i2p.router.RouterContext;
|
||||
@ -209,7 +210,7 @@ public class GeoIP {
|
||||
if (line.charAt(0) == '#') {
|
||||
continue;
|
||||
}
|
||||
String[] s = line.split(",");
|
||||
String[] s = DataHelper.split(line, ",");
|
||||
String lc = s[0].toLowerCase(Locale.US);
|
||||
_codeToName.put(lc, s[1]);
|
||||
_codeCache.put(lc, lc);
|
||||
@ -274,7 +275,7 @@ public class GeoIP {
|
||||
if (buf.charAt(0) == '#') {
|
||||
continue;
|
||||
}
|
||||
String[] s = buf.split(",");
|
||||
String[] s = DataHelper.split(buf, ",");
|
||||
long ip1 = Long.parseLong(s[0]);
|
||||
long ip2 = Long.parseLong(s[1]);
|
||||
while (idx < search.length && search[idx].longValue() < ip1) {
|
||||
|
@ -170,7 +170,7 @@ class GeoIPv6 {
|
||||
if (buf.charAt(0) == '#') {
|
||||
continue;
|
||||
}
|
||||
String[] s = buf.split(",");
|
||||
String[] s = DataHelper.split(buf, ",");
|
||||
String ips1 = s[0].replace("\"", "").trim();
|
||||
String ips2 = s[1].replace("\"", "").trim();
|
||||
byte[] ip1 = InetAddress.getByName(ips1).getAddress();
|
||||
|
@ -224,7 +224,7 @@ class UPnP extends ControlPoint implements DeviceChangeListener, EventListener {
|
||||
boolean ignore = false;
|
||||
String toIgnore = _context.getProperty(PROP_IGNORE);
|
||||
if (toIgnore != null) {
|
||||
String[] ignores = toIgnore.split("[,; \r\n\t]");
|
||||
String[] ignores = DataHelper.split(toIgnore, "[,; \r\n\t]");
|
||||
for (int i = 0; i < ignores.length; i++) {
|
||||
if (ignores[i].equals(udn)) {
|
||||
ignore = true;
|
||||
|
@ -340,7 +340,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
||||
|
||||
List<InetAddress> bindToAddrs = new ArrayList<InetAddress>(4);
|
||||
if (bindTo != null) {
|
||||
String[] bta = bindTo.split("[,; \r\n\t]");
|
||||
String[] bta = DataHelper.split(bindTo, "[,; \r\n\t]");
|
||||
for (int i = 0; i < bta.length; i++) {
|
||||
String bt = bta[i];
|
||||
if (bt.length() <= 0)
|
||||
@ -1896,7 +1896,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
||||
if (explicitAddressSpecified()) {
|
||||
host = _context.getProperty(PROP_EXTERNAL_HOST);
|
||||
if (host != null) {
|
||||
String[] hosts = host.split("[,; \r\n\t]");
|
||||
String[] hosts = DataHelper.split(host, "[,; \r\n\t]");
|
||||
RouterAddress rv = null;
|
||||
for (int i = 0; i < hosts.length; i++) {
|
||||
String h = hosts[i];
|
||||
|
@ -13,6 +13,7 @@ import java.util.SortedMap;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.util.SecureFileOutputStream;
|
||||
|
||||
/**
|
||||
@ -125,7 +126,7 @@ public class EventLog {
|
||||
String line = null;
|
||||
while ( (line = br.readLine()) != null) {
|
||||
try {
|
||||
String[] s = line.split(" ", 3);
|
||||
String[] s = DataHelper.split(line, " ", 3);
|
||||
if (!s[1].equals(event))
|
||||
continue;
|
||||
long time = Long.parseLong(s[0]);
|
||||
@ -167,7 +168,7 @@ public class EventLog {
|
||||
String line = null;
|
||||
while ( (line = br.readLine()) != null) {
|
||||
try {
|
||||
String[] s = line.split(" ", 2);
|
||||
String[] s = DataHelper.split(line, " ", 2);
|
||||
if (s.length < 2)
|
||||
continue;
|
||||
long time = Long.parseLong(s[0]);
|
||||
|
Reference in New Issue
Block a user