public static PublicSuffixMatcher load(final URL url) throws IOException { if (url == null) { throw new IllegalArgumentException("URL is null"); } try (InputStream in = url.openStream()) { return load(in); } }
public static HostnameVerifier getHostnameVerifier(TLSClientParameters tlsClientParameters) { HostnameVerifier verifier; if (tlsClientParameters.getHostnameVerifier() != null) { verifier = tlsClientParameters.getHostnameVerifier(); } else if (tlsClientParameters.isUseHttpsURLConnectionDefaultHostnameVerifier()) { verifier = HttpsURLConnection.getDefaultHostnameVerifier(); } else if (tlsClientParameters.isDisableCNCheck()) { verifier = new AllowAllHostnameVerifier(); } else { verifier = new DefaultHostnameVerifier(PublicSuffixMatcherLoader.getDefault()); } return verifier; }
verifier = new AllowAllHostnameVerifier(); } else { verifier = new DefaultHostnameVerifier(PublicSuffixMatcherLoader.getDefault());
public static PublicSuffixMatcher load(final File file) throws IOException { if (file == null) { throw new IllegalArgumentException("File is null"); } try (InputStream in = Files.newInputStream(file.toPath())) { return load(in); } }
public static HostnameVerifier getHostnameVerifier(TLSClientParameters tlsClientParameters) { HostnameVerifier verifier; if (tlsClientParameters.getHostnameVerifier() != null) { verifier = tlsClientParameters.getHostnameVerifier(); } else if (tlsClientParameters.isUseHttpsURLConnectionDefaultHostnameVerifier()) { verifier = HttpsURLConnection.getDefaultHostnameVerifier(); } else if (tlsClientParameters.isDisableCNCheck()) { verifier = new AllowAllHostnameVerifier(); } else { verifier = new DefaultHostnameVerifier(PublicSuffixMatcherLoader.getDefault()); } return verifier; }
public static PublicSuffixMatcher getDefault() { if (defaultInstance == null) { synchronized (PublicSuffixMatcherLoader.class) { if (defaultInstance == null) { final URL url = PublicSuffixMatcherLoader.class.getResource( "/mozilla/public-suffix-list.txt"); if (url != null) { try { defaultInstance = load(url); } catch (final IOException ex) { // Should never happen if (LOG.isLoggable(Level.WARNING)) { LOG.log(Level.WARNING, "Failure loading public suffix list from default resource", ex); } } } else { defaultInstance = new PublicSuffixMatcher(Arrays.asList("com"), null); } } } } return defaultInstance; }
public static PublicSuffixMatcher load(final URL url) throws IOException { if (url == null) { throw new IllegalArgumentException("URL is null"); } try (InputStream in = url.openStream()) { return load(in); } }
public static PublicSuffixMatcher load(final File file) throws IOException { if (file == null) { throw new IllegalArgumentException("File is null"); } try (InputStream in = Files.newInputStream(file.toPath())) { return load(in); } }
public static PublicSuffixMatcher load(final File file) throws IOException { if (file == null) { throw new IllegalArgumentException("File is null"); } final InputStream in = new FileInputStream(file); try { return load(in); } finally { in.close(); } }
public static PublicSuffixMatcher load(final URL url) throws IOException { if (url == null) { throw new IllegalArgumentException("URL is null"); } final InputStream in = url.openStream(); try { return load(in); } finally { in.close(); } }
public static PublicSuffixMatcher getDefault() { if (defaultInstance == null) { synchronized (PublicSuffixMatcherLoader.class) { if (defaultInstance == null) { final URL url = PublicSuffixMatcherLoader.class.getResource( "/mozilla/public-suffix-list.txt"); if (url != null) { try { defaultInstance = load(url); } catch (final IOException ex) { // Should never happen if (LOG.isLoggable(Level.WARNING)) { LOG.log(Level.WARNING, "Failure loading public suffix list from default resource", ex); } } } else { defaultInstance = new PublicSuffixMatcher(Arrays.asList("com"), null); } } } } return defaultInstance; }
public static PublicSuffixMatcher getDefault() { if (defaultInstance == null) { synchronized (PublicSuffixMatcherLoader.class) { if (defaultInstance == null) { final URL url = PublicSuffixMatcherLoader.class.getResource( "/mozilla/public-suffix-list.txt"); if (url != null) { try { defaultInstance = load(url); } catch (IOException ex) { // Should never happen if (LOG.isLoggable(Level.WARNING)) { LOG.log(Level.WARNING, "Failure loading public suffix list from default resource", ex); } } } else { defaultInstance = new PublicSuffixMatcher(Arrays.asList("com"), null); } } } } return defaultInstance; }