String (String url) { try { URLConnection connection = new URL(url).openConnection(); try (InputStream ignored = connection.getInputStream()) { return connection.getURL().toString(); } } catch (IOException e) { return null; } }