Skip to content

Commit 4c50275

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 9fc3c17 commit 4c50275

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.19.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.3</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
@@ -39,7 +39,7 @@
3939
import java.security.MessageDigest;
4040
import java.security.NoSuchAlgorithmException;
4141

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

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

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

0 commit comments

Comments
 (0)