Skip to content

Commit 4fc2100

Browse files
Downgrade to commons-io 2.8.0
- comment out all usages of BoundedInputStream available only from commons-io 2.16.0 upwards
1 parent 5164d06 commit 4fc2100

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@
385385
<properties>
386386
<!-- Dependencies -->
387387

388-
<commons-io.version>2.21.0</commons-io.version>
388+
<commons-io.version>2.8.0</commons-io.version>
389389
<slf4j-api.version>2.0.17</slf4j-api.version>
390390
<junit.version>5.13.4</junit.version>
391391
<slf4j-log4j12.version>1.7.33</slf4j-log4j12.version>

src/main/java/crawlercommons/domains/EffectiveTldFinder.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
import java.security.MessageDigest;
4141
import java.security.NoSuchAlgorithmException;
4242

43-
import org.apache.commons.io.input.BoundedInputStream;
43+
// import org.apache.commons.io.input.BoundedInputStream;
4444
import org.slf4j.Logger;
4545
import org.slf4j.LoggerFactory;
4646

@@ -167,8 +167,9 @@ public boolean initialize(InputStream effectiveTldDataStream) {
167167
boolean inPrivateDomainSection = false;
168168
try {
169169
int linesRead = 0, rulesRead = 0;
170-
BoundedInputStream isCounting = BoundedInputStream.builder().setInputStream(effectiveTldDataStream).get();
171-
InputStream is = isCounting;
170+
// BoundedInputStream isCounting = BoundedInputStream.builder().setInputStream(effectiveTldDataStream).get();
171+
// InputStream is = isCounting;
172+
InputStream is = effectiveTldDataStream;
172173
List<MessageDigest> digests = new ArrayList<>();
173174
try {
174175
MessageDigest md5 = MessageDigest.getInstance("MD5");
@@ -209,8 +210,9 @@ public boolean initialize(InputStream effectiveTldDataStream) {
209210
configured = true;
210211

211212
is.close();
212-
long bytesRead = isCounting.getCount();
213-
LOGGER.info("Successfully read public suffix list: {} bytes, {} lines, {} rules", bytesRead, linesRead, rulesRead);
213+
// long bytesRead = isCounting.getCount();
214+
// LOGGER.info("Successfully read public suffix list: {} bytes, {} lines, {} rules", bytesRead, linesRead, rulesRead);
215+
LOGGER.info("Successfully read public suffix list: {} lines, {} rules", linesRead, rulesRead);
214216
for (MessageDigest digest : digests) {
215217
byte[] d = digest.digest();
216218
BigInteger bi = new BigInteger(1, d);

0 commit comments

Comments
 (0)