Skip to content

Commit

Permalink
Includes a copy of in
Browse files Browse the repository at this point in the history
https://publicsuffix.org/list/effective_tld_names.dat
in httpclient5/src/test/resources/org/publicsuffix/list/effective_tld_names.dat

Cleanly separate the concerns of which file to copy and whether to
filter it or not by using two <resource> elements:

- We want the .properties file copied and filtered. The git master
version causes only the properties file to be copied, the .dat file is
not copied.
- We want to the .dat file copied but not filtered.
  • Loading branch information
garydgregory committed Aug 25, 2024
1 parent 5b546de commit 648690f
Show file tree
Hide file tree
Showing 7 changed files with 15,874 additions and 9 deletions.
5 changes: 5 additions & 0 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ Copyright 1999-2023 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).

This product includes a copy of in https://publicsuffix.org/list/effective_tld_names.dat
in httpclient5/src/test/resources/org/publicsuffix/list/effective_tld_names.dat
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
9 changes: 7 additions & 2 deletions httpclient5/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@
<include>**/*.properties</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.dat</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
Expand All @@ -123,8 +129,7 @@
</goals>
<configuration>
<url>https://publicsuffix.org/list/effective_tld_names.dat</url>
<outputDirectory>${project.build.outputDirectory}/mozilla</outputDirectory>
<outputFileName>public-suffix-list.txt</outputFileName>
<outputDirectory>${project.basedir}/src/main/resources/org/publicsuffix/list</outputDirectory>
</configuration>
</execution>
</executions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
@Contract(threading = ThreadingBehavior.SAFE)
public final class PublicSuffixMatcherLoader {

private static final String PUBLIC_SUFFIX_LIST = "org/publicsuffix/list/effective_tld_names.dat";

private static final Logger LOG = LoggerFactory.getLogger(PublicSuffixMatcherLoader.class);

private static final ReentrantLock lock = new ReentrantLock();
Expand Down Expand Up @@ -81,9 +83,8 @@ public static PublicSuffixMatcher getDefault() {
if (DEFAULT_INSTANCE == null) {
lock.lock();
try {
if (DEFAULT_INSTANCE == null){
final URL url = PublicSuffixMatcherLoader.class.getResource(
"/mozilla/public-suffix-list.txt");
if (DEFAULT_INSTANCE == null) {
final URL url = PublicSuffixMatcherLoader.class.getResource(PUBLIC_SUFFIX_LIST);
if (url != null) {
try {
DEFAULT_INSTANCE = load(url);
Expand Down
Loading

0 comments on commit 648690f

Please sign in to comment.