MCPcopy Create free account
hub / github.com/M66B/FairEmail / getOrganization

Method getOrganization

app/src/main/java/eu/faircode/email/IPInfo.java:53–66  ·  view source on GitHub ↗
(@NonNull Uri uri, Context context)

Source from the content-addressed store, hash-verified

51 private final static int FETCH_TIMEOUT = 15 * 1000; // milliseconds
52
53 static Pair<InetAddress, IPInfo> getOrganization(@NonNull Uri uri, Context context) throws IOException, ParseException, JSONException {
54 String host = UriHelper.getHost(uri);
55 if (host == null)
56 throw new UnknownHostException();
57
58 try {
59 host = IDN.toASCII(host, IDN.ALLOW_UNASSIGNED);
60 } catch (Throwable ex) {
61 Log.i(ex);
62 }
63
64 InetAddress address = DnsHelper.getByName(context, host);
65 return new Pair<>(address, getOrganization(address, context));
66 }
67
68 static IPInfo getOrganization(InetAddress address, Context context) throws IOException, JSONException {
69 synchronized (addressOrganization) {

Callers 2

onExecuteMethod · 0.95
processSourceIpMethod · 0.95

Calls 12

getHostMethod · 0.95
iMethod · 0.95
getByNameMethod · 0.95
setUserAgentMethod · 0.95
readStreamMethod · 0.95
containsKeyMethod · 0.80
getHostAddressMethod · 0.80
getInputStreamMethod · 0.65
getMethod · 0.45
connectMethod · 0.45
disconnectMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected